[ABAP] Informationen zu einem Dynpro lesen

* Dynproheaderstruktur
DATA: lv_header LIKE d020s.
* Dynprofeldtabelle
DATA: it_ftab TYPE STANDARD TABLE OF d021s WITH DEFAULT KEY.
* Tabelle für Dynproablauflogik
DATA: it_pltab TYPE STANDARD TABLE OF d022s WITH DEFAULT KEY.

* Dynproloadinformationen mit ABAP-Mitteln
* request:
*  - 'A' - Dynproheader u. Felder
*  - 'F' - Dynprofelder
*  - 'C' - Dynproablauflogik
*  - 'G' - Generiere
*  - 'H' - Dynproheader
*  - 'T' - Testharms
CALL FUNCTION 'RS_IMPORT_DYNPRO'
  EXPORTING
    dylang               = sy-langu       " Dynprogenerierungssprache
    dyname               = 'SAPLSD_ENTRY' " Name des Dynpros (SE11)
    dynumb               = '1000'         " Nummer des Dynpros
    suppress_checks      = abap_true
*    request              = 'A'
  IMPORTING
    header               = lv_header
  TABLES
    ftab                 = it_ftab
    pltab                = it_pltab
  EXCEPTIONS
    button_error         = 1
    dylanguage_invalid   = 2
    dylanguage_not_inst  = 3
    dyname_invalid       = 4
    dynproload_not_found = 5
    dynpro_old           = 6
    dynumb_invalid       = 7
    ftab_invalid         = 8
    gen_error            = 9
    gen_ok               = 10
    header_invalid       = 11
    internal_error       = 12
    no_dynpro            = 13
    no_ftab_row          = 14
    no_memory            = 15
    no_processlogic      = 16
    pltab_invalid        = 17
    request_invalid      = 18
    OTHERS               = 19.

IF sy-subrc = 0.
  cl_demo_output=>write_data( lv_header ).
  cl_demo_output=>write_data( it_ftab ).
  cl_demo_output=>write_data( it_pltab ).

*   HTML-Code vom Demo-Output holen
  DATA(lv_html) = cl_demo_output=>get( ).

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

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

Kommentare sind geschlossen.