[ABAP] ITS: Aufruf einer Transaktion über HTTPS in der WebGui

PARAMETERS: p_matnr TYPE mara-matnr.

START-OF-SELECTION.

  DATA: it_servlist TYPE STANDARD TABLE OF icm_sinfo2 WITH DEFAULT KEY.

* Statistikdaten des ICM lesen
  CALL FUNCTION 'ICM_GET_INFO2'
    TABLES
      servlist           = it_servlist
    EXCEPTIONS
      icm_error          = 1
      icm_timeout        = 2
      icm_not_authorized = 3
      OTHERS             = 4.

  IF sy-subrc = 0.
* protocol 1: HTTP
* protocol 2: HTTPS
    IF line_exists( it_servlist[ protocol = 2 ] ).
* URL für Transaktions-Anzeige in der ITS-WebGui zusammenbauen
* SICF-Service muss aktiv sein: /sap/bc/gui/sap/its/webgui
* Daten werden in der Klasse CL_HTTP_EXT_ITS prozessiert
      DATA(lv_server) = it_servlist[ protocol = 2 ].
      DATA(lv_html) = |https://{ lv_server-hostname }:{ lv_server-service }|.
      lv_html = lv_html && |/sap/bc/gui/sap/its/webgui?|.
      lv_html = lv_html && |~transaction=*MM03%20RMMG1-MATNR={ p_matnr ALPHA = OUT WIDTH = 10 }|. " MM03 + MATNR --> Selektionbild überspringen
      lv_html = lv_html && |&sap-client={ sy-mandt }|.
      lv_html = lv_html && |&sap-language=DE|.

* Browserfenster mit default_screen als Container
      DATA(o_hv) = NEW cl_gui_html_viewer( parent = cl_gui_container=>default_screen ).
* SSO
*      o_hv->enable_sapsso( enabled = abap_true ).
* ITS: WebGui inline (im SAPGUI) anzeigen
      o_hv->show_url( url      = CONV swk_url( lv_html )
                      in_place = abap_true ).

* Führt alle gesammelten OLE-Calls aus
      cl_gui_cfw=>flush( ).

* Toolbar ausblenden
      cl_abap_list_layout=>suppress_toolbar( ).

* erzwingt Anzeige über cl_gui_container=>default_screen
      WRITE: / space.
    ENDIF.
  ENDIF.

Links

[ABAP] ITS: HTML aus einem Dynpro generieren

* Paket: SITS_ABAP

* SE11 - Report
DATA: lv_prog TYPE d020s-prog VALUE 'SAPLSD_ENTRY'.
* Dynpro 1000
DATA: lv_dynnr TYPE d020s-dnum VALUE '1000'.
* '' / C - Classic, B - HTML-Business, W - WebGUI
DATA: lv_style TYPE w3style VALUE 'B'.

DATA: lv_html_xstr TYPE xstring.
DATA: it_html TYPE STANDARD TABLE OF w3html WITH DEFAULT KEY.

* Template von Dynpro generieren
CALL FUNCTION 'ITS_GENERATE_HTML_FROM_DYNPRO'
  EXPORTING
    progname                       = lv_prog
    dynnr                          = lv_dynnr
    style_2006                     = lv_style
  IMPORTING
    source_stream                  = lv_html_xstr
  TABLES
    meta_html                      = it_html
  EXCEPTIONS
    style_not_valid                = 1
    dynnr_or_programname_not_valid = 2
    css_not_valid                  = 3
    xsl_not_valid                  = 4
    placeholder_not_valid          = 5
    no_card_identifiers_used       = 6
    error_occured                  = 7
    OTHERS                         = 8.

IF sy-subrc = 0.
  cl_demo_output=>write_data( it_html ).
  DATA(lv_html) = cl_demo_output=>get( ).

* Daten im Inline-Browser im SAP-Fenster anzeigen
  cl_abap_browser=>show_html( EXPORTING
                                title        = 'HTML'
                                html_string  = lv_html
                                container    = cl_gui_container=>default_screen ).

* cl_gui_container=>default_screen erzwingen
  WRITE: space.
ENDIF.

[SAP] Internet Transaction Server (ITS) – Transaktion in der WebGUI aufrufen

Falls die WebGUI aktiv ist, können Transaktionen für die SAP-GUI auch im Browser aufgerufen werden:

* genereller Aufruf
https://<host>:<port>/sap/bc/gui/sap/its/webgui?sap-client=100&sap-language=DE&sap-user=XYZ&~OKCODE=<TCODE>%20<PARAM1>;<PARAM2>;...
* SAP-Menü 
https://<server-addr>:<port>/sap/bc/gui/sap/its/webgui 
* Transaktion "ME23N", Mandant "100", Sprache "DE"
https://<server-addr>:<port>/sap/bc/gui/sap/its/webgui?~transaction=ME23N&sap-client=100&sap-language=DE
* /IWFND/ERROR_LOG 
https://<server-addr>:<port>/sap/bc/gui/sap/its/webgui?~transaction=%2FIWFND%2FERROR_LOG
* MM60 mit Parameter Werk=10
https://<server-addr>:<port>/sap/bc/gui/sap/its/webgui?~transaction=*MM60%20MS_WERKS-LOW=10
* Ausführung erfolgt unter
cl_http_ext_its=>if_http_extension~handle_request

Links