[ABAP] Datenelemente anhand von Datentypen und Suchstrings (Tabelle DD01L, DD01T) suchen

In der Praxis kommt es oft vor, dass man zu einem Datenelement oder einer Tabelle einen passenden fertigen SAP-Datentyp aus dem DDIC sucht. Dieses kleine Programm hilft dabei, schnell und effizient das passende aus den Tabellen DD01L und DD01T zu suchen (Datentyp, Sprache, Kurztext).

* Datentyp
PARAMETERS: p_dtyp TYPE dd04l-datatype DEFAULT 'DATS'.
* Sprache
PARAMETERS: p_lang TYPE dd04t-ddlanguage DEFAULT 'D'.
* Suchtext für Suche in Kurzbeschreibung
PARAMETERS: p_search TYPE string LOWER CASE.

START-OF-SELECTION.

  SELECT dl~rollname,  " Datenelement
         dl~domname,   " Domäne
         dl~datatype,  " Datentyp
         dl~leng,      " Zahl der Stellen
         dl~memoryid,  " Parameter-Id
         dl~entitytab, " Wertetabelle
         dt~ddtext     " Kurzbeschreibung
    INTO TABLE @DATA(it_result)
    FROM dd04l AS dl
    INNER JOIN dd04t AS dt ON ( dl~rollname = dt~rollname AND dl~dtelmaster = dt~ddlanguage AND dl~as4local = dt~as4local AND dl~as4vers = dt~as4vers )
    WHERE dl~as4local   = 'A'
      AND dl~datatype   = @p_dtyp
      AND dt~ddlanguage = @p_lang.

  IF sy-subrc = 0.
    TRY.
        DATA(it_result2) = it_result.

* wenn nach bestimmten Inhalt gesucht werden soll -> Filtern
        IF NOT p_search IS INITIAL.
          it_result2 = VALUE #( FOR <s> IN it_result WHERE ( ddtext CS p_search )
                                (
                                   <s>
                                )
                              ).
        ENDIF.

* SALV-Table
        DATA: o_salv TYPE REF TO cl_salv_table.

        cl_salv_table=>factory( IMPORTING
                                  r_salv_table   = o_salv
                                CHANGING
                                  t_table        = it_result2 ).

* Grundeinstellungen
        o_salv->get_functions( )->set_all( abap_true ).
        o_salv->get_columns( )->set_optimize( abap_true ).
        o_salv->get_display_settings( )->set_list_header( 'Datentypen' ).
        o_salv->get_display_settings( )->set_striped_pattern( abap_true ).
        o_salv->get_selections( )->set_selection_mode( if_salv_c_selection_mode=>row_column ).

* Spaltenüberschriften: technischer Name und Beschreibungstexte
        LOOP AT o_salv->get_columns( )->get( ) ASSIGNING FIELD-SYMBOL(<c>).
          DATA(o_col) = <c>-r_column.
          o_col->set_short_text( |{ o_col->get_columnname( ) } [{ o_col->get_short_text( ) }]| ).
          o_col->set_medium_text( |{ o_col->get_columnname( ) } [{ o_col->get_medium_text( ) }]| ).
          o_col->set_long_text( |{ o_col->get_columnname( ) } [{ o_col->get_long_text( ) }]| ).
        ENDLOOP.

        o_salv->display( ).
      CATCH cx_root INTO DATA(e_txt).
        WRITE: / e_txt->get_text( ).
    ENDTRY.
  ENDIF.

Links

[ABAP] Einfache Charts anzeigen mit cl_time_chart_simple

* Kapselt: cl_gui_chart_engine
* Demo: RSORA_TCS_DEMO
* Vorteil: einfache Handhabung
* Nachteil: nur eingeschränktes Chart-Customizing (Einstellungen)
CONSTANTS: co_graph_id TYPE tcs_graph_id VALUE 'S_GRAPH1'.

CLASS lcl_events DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODS:
      on_click FOR EVENT click OF cl_time_chart_simple
        IMPORTING
            element
            series_nr
            point_nr
            clicked_entry
            clicked_series
            sender.
    CLASS-METHODS:
      on_property_change FOR EVENT property_change OF cl_time_chart_simple
        IMPORTING
            element
            name
            value
            sender.
ENDCLASS.

CLASS lcl_events IMPLEMENTATION.

  METHOD on_click.
    MESSAGE |{ element } { series_nr } { point_nr } { clicked_entry-yvalue } { clicked_series }| TYPE 'S'.
  ENDMETHOD.

  METHOD on_property_change.
    MESSAGE |{ element } { name } { value }| TYPE 'S'.
  ENDMETHOD.

ENDCLASS.

* Dummy-Screen für cl_gui_container=>default_screen deklarieren
SELECTION-SCREEN BEGIN OF SCREEN 100.
SELECTION-SCREEN END OF SCREEN 100.

START-OF-SELECTION.
  TRY.
      DATA(o_tcs) = NEW cl_time_chart_simple( i_container = cl_gui_container=>default_screen ).

* Customizing, leider nur vier Parameter einstellbar
* erweitertes Customizing nur über die Methoden load_customizing... möglich (s.u.)
      DATA(lv_cust) = VALUE tcs_s_customizing( charttype  = 'TimeScatter'
                                               charttitle = 'Time Chart Simple Demo'
                                               yaxistext  = 'Höhe'
                                               yaxisunit  = '[mm]'
                                             ).

      o_tcs->set_customizing( lv_cust ).

* Daten
      DATA(it_data) = VALUE tcs_t_data( ( series    = 'Series 1'
                                          timestamp = cl_time_chart_simple=>create_timestamp( i_date  = '20190101' i_time  = '100000' i_milli = '000' )
                                          yvalue    = '1.2'
                                        )
                                        ( series    = 'Series 1'
                                          timestamp = cl_time_chart_simple=>create_timestamp( i_date  = '20190101' i_time  = '110000' i_milli = '100' )
                                          yvalue    = '1.5'
                                        )
                                        ( series    = 'Series 1'
                                          timestamp = cl_time_chart_simple=>create_timestamp( i_date  = '20190101' i_time  = '120000' i_milli = '200' )
                                          yvalue    = '1.9'
                                        )

                                        ( series    = 'Series 2'
                                          timestamp = cl_time_chart_simple=>create_timestamp( i_date  = '20190101' i_time  = '100000' i_milli = '500' )
                                          yvalue    = '1.0'
                                        )
                                        ( series    = 'Series 2'
                                          timestamp = cl_time_chart_simple=>create_timestamp( i_date  = '20190101' i_time  = '110000' i_milli = '700' )
                                          yvalue    = '1.2'
                                        )
                                        ( series    = 'Series 2'
                                          timestamp = cl_time_chart_simple=>create_timestamp( i_date  = '20190101' i_time  = '120000' i_milli = '800' )
                                          yvalue    = '1.6'
                                        )
                                      ).

      o_tcs->set_data( it_data ).

* Events
      SET HANDLER lcl_events=>on_click FOR o_tcs.
      SET HANDLER lcl_events=>on_property_change FOR o_tcs.

* Einstellungen anzeigen
      o_tcs->toggle_customizing_mode( ).

** interessante Funktionen (sollten durch Buttons getriggert werden):
** Drucken
*  o_tcs->print_chart( ).
** Grafik speichern
*  o_tcs->save_chart( ).
** Filter
*  o_tcs->filter_data_top_n( 3 ).
*  o_tcs->filter_data_top_n( 0 ).
** Zoom
*  o_tcs->zoom_in( 40 ).
*  o_tcs->zoom_out( 40 ).
** Scroll
*  o_tcs->scroll_left_border(  ).
*  o_tcs->scroll_left( 100 ).
*  o_tcs->scroll_left( 25 ).
*  o_tcs->scroll_right( 25 ).
*  o_tcs->scroll_right( 100 ).
*  o_tcs->scroll_right_border( ).
** Customizing als Datei laden/speichern
*  o_tcs->load_customizing_frontend( ).
*  o_tcs->save_customizing_frontend( ).
** Customizing auf DB laden/speichern/löschen
*  o_tcs->load_customizing_db( co_graph_id ).
*  o_tcs->save_customizing_db( co_graph_id ).
*  o_tcs->delete_customizing_db( co_graph_id ).

* cl_gui_container=>default_screen erzwingen
      CALL SCREEN 100.

    CATCH cx_root INTO DATA(e_text).
      WRITE: / e_text->get_text( ).
  ENDTRY.

[ABAP] SAP Release Information lesen

TYPES: ty_it_supp_db TYPE STANDARD TABLE OF thllines WITH DEFAULT KEY.

DATA(lv_kern_rel) = VALUE thllines-thline( ).
DATA(lv_kern_dblib) = VALUE thllines-thline( ).
DATA(lv_kern_comp_on) = VALUE thllines-thline( ).
DATA(lv_kern_comp_time) = VALUE thllines-thline( ).
DATA(lv_kern_patchlevel) = VALUE thllines-thline( ).
DATA(lv_kern_supportlevel) = VALUE thllines-thline( ).
DATA(lv_kern_patchnumber) = VALUE thllines-thline( ).
DATA(lv_kern_sourceid) = VALUE thllines-thline( ).

DATA(it_supp_db_sap) = VALUE ty_it_supp_db( ).
DATA(it_supp_db_vendor) = VALUE ty_it_supp_db( ).
DATA(it_supp_op_sys) = VALUE ty_it_supp_db( ).
DATA(it_patchcomment) = VALUE ty_it_supp_db( ).

* ruft ThSysInfo
CALL FUNCTION 'TH_SAPREL3'
  IMPORTING
    kern_rel          = lv_kern_rel
    kern_dblib        = lv_kern_dblib
    kern_comp_on      = lv_kern_comp_on
    kern_comp_time    = lv_kern_comp_time
    kern_patchlevel   = lv_kern_patchlevel
    kern_supportlevel = lv_kern_supportlevel
    kern_patchnumber  = lv_kern_patchnumber
    kern_sourceid     = lv_kern_sourceid
  TABLES
    supp_db_sap       = it_supp_db_sap
    supp_db_vendor    = it_supp_db_vendor
    supp_op_sys       = it_supp_op_sys
    patchcomment      = it_patchcomment.

cl_demo_output=>write_data( lv_kern_rel ).
cl_demo_output=>write_data( lv_kern_dblib ).
cl_demo_output=>write_data( lv_kern_comp_on ).
cl_demo_output=>write_data( lv_kern_comp_time ).
cl_demo_output=>write_data( lv_kern_patchlevel ).
cl_demo_output=>write_data( lv_kern_supportlevel ).
cl_demo_output=>write_data( lv_kern_patchnumber ).
cl_demo_output=>write_data( lv_kern_sourceid ).
cl_demo_output=>write_data( it_supp_db_sap ).
cl_demo_output=>write_data( it_supp_db_vendor ).
cl_demo_output=>write_data( it_supp_op_sys ).
cl_demo_output=>write_data( it_patchcomment ).
cl_demo_output=>display( ).

[ABAP] Popupfenster mit Eingabefeldern (cl_gui_combobox, cl_gui_input_field)

CLASS lcl_events DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODS:
      on_close FOR EVENT close OF cl_gui_dialogbox_container
        IMPORTING sender.

    CLASS-METHODS:
      on_select FOR EVENT selected OF cl_gui_combobox
        IMPORTING
            key
            sender.

    CLASS-METHODS:
      on_submit FOR EVENT submit OF cl_gui_input_field
        IMPORTING
            input
            sender.

    CLASS-METHODS:
      on_auto_submit FOR EVENT auto_submit OF cl_gui_input_field
        IMPORTING
            input
            sender.
ENDCLASS.

CLASS lcl_events IMPLEMENTATION.
  METHOD on_close.
    IF sender IS NOT INITIAL.
      sender->free( ).
    ENDIF.
  ENDMETHOD.

  METHOD on_select.

    MESSAGE key && ' -> ' && sender->get_selected_item( ) TYPE 'S'.

    cl_gui_cfw=>flush( ).
  ENDMETHOD.

  METHOD on_submit.

    MESSAGE 'Submit:' && input && ' -> ' && sender->get_text( ) TYPE 'S'.

    cl_gui_cfw=>flush( ).
  ENDMETHOD.

  METHOD on_auto_submit.

    MESSAGE 'Auto-Submit:' &&  input && ' -> ' && sender->get_text( ) TYPE 'S'.

    cl_gui_cfw=>flush( ).
  ENDMETHOD.
ENDCLASS.

SELECTION-SCREEN: PUSHBUTTON 2(20) btn1 USER-COMMAND cmd_show.

AT SELECTION-SCREEN.
* wenn Button-Kommando 'CMD_SHOW'
  IF sy-ucomm = 'CMD_SHOW'.
* Container
    DATA(o_cnt) = NEW cl_gui_dialogbox_container( no_autodef_progid_dynnr = abap_true
                                                  caption                 = 'Werte'
                                                  top                     = 5
                                                  left                    = 5
                                                  width                   = 640
                                                  height                  = 240 ).

    SET HANDLER lcl_events=>on_close FOR o_cnt.

* Input
    DATA(o_input) = NEW cl_gui_input_field( parent               = o_cnt
                                            label_text           = 'InputLabel'
                                            label_width          = 10
                                            input_prompt_text    = 'Text'
                                            activate_find_button = abap_false
                                            activate_auto_submit = abap_true ).

    o_input->set_top( 30 ).
    o_input->set_text( '<default>' ).

    SET HANDLER lcl_events=>on_submit FOR o_input.
    SET HANDLER lcl_events=>on_auto_submit FOR o_input.

* Combobox
    DATA(o_combo) = NEW cl_gui_combobox( parent      = o_cnt
                                         label_text  = 'ComboLabel'
                                         label_width = 10 ).

    o_combo->set_items( VALUE vrm_values( ( key = 'A' text = 'Wert1' )
                                          ( key = 'B' text = 'Wert2' )
                                          ( key = 'C' text = 'Wert3' ) ) ).

    o_combo->set_selected_item( 'A' ).

    o_combo->activate_selection_event( ).

    o_combo->set_top( 10 ).

    SET HANDLER lcl_events=>on_select FOR o_combo.
  ENDIF.

[ABAP] XML-Datei einlesen und in String wandeln

TRY.
    DATA(o_doc) = NEW cl_xml_document( ).
* XML-Datei einlesen
    IF o_doc->import_from_file( 'c:\temp\temp.xml' ) = 0.
* Inhalt der XML-Document in String wandeln
      o_doc->render_2_string( EXPORTING
                                pretty_print = abap_true
                              IMPORTING
                                retcode = DATA(lv_rc)
                                size    = DATA(lv_size)
                                stream  = DATA(lv_xml_string) ).
      IF lv_rc = 0.
        WRITE: / lv_xml_string.
      ENDIF.
    ENDIF.
  CATCH cx_root INTO DATA(e_txt).
    WRITE: / e_txt->get_text( ).
ENDTRY.

[ABAP] IDoc: Basistyp lesen

TYPES: ty_it_pt_syntax TYPE STANDARD TABLE OF edi_iapi02 WITH DEFAULT KEY.
TYPES: ty_it_pt_extensions TYPE STANDARD TABLE OF edi_iapi04 WITH DEFAULT KEY.

* Segmenttyp
PARAMETERS: p_ityp TYPE edbas-idoctyp.

DATA(lv_pe_attributes) = VALUE edi_iapi01( ).
DATA(it_pt_syntax) = VALUE ty_it_pt_syntax( ).
DATA(it_pt_pre_syntax) = VALUE ty_it_pt_syntax( ).
DATA(it_pt_extensions) = VALUE ty_it_pt_extensions( ).

CALL FUNCTION 'IDOCTYPE_READ'
  EXPORTING
    pi_idoctyp       = p_ityp
  IMPORTING
    pe_attributes    = lv_pe_attributes
  TABLES
    pt_syntax        = it_pt_syntax
    pt_pre_syntax    = it_pt_pre_syntax
    pt_extensions    = it_pt_extensions
  EXCEPTIONS
    object_not_found = 1
    db_error         = 2
    no_authority     = 3
    OTHERS           = 4.

IF sy-subrc = 0.
  cl_demo_output=>write( lv_pe_attributes ).
  cl_demo_output=>write( it_pt_syntax ).
  cl_demo_output=>write( it_pt_pre_syntax ).
  cl_demo_output=>write( it_pt_extensions ).
  cl_demo_output=>display( ).
ENDIF.

[ABAP] Übersicht SAP-Klassen und -Interfaces

Klasse                        Paket                         Funktion

/ui2/cl_abap2json             /UI2/BASIS_SERVICES_START_UP  ABAP nach JSON konvertieren
/ui2/cl_json                  /UI2/NWBC_CORE                JSON converter
/ui2/cl_number                /UI2/BASIS_TINY_DATA          Generic compressed serialization class

/ui5/cl_theme_util            /UI5/THEMING_INFRA            UI Theming: Utility functions

cl_abap_browser               SABAPDOCU                     Anzeige einer HTML- oder XML-Datei
cl_abap_char_utilities        S ABP_CONVERT                 Hilfsmittel für Zeichenverarbeitung
cl_abap_classdescr            SABP_RTTI                     Run Time Type Services
cl_abap_codepage              SABP_CONVERT                  codepage utility class
cl_abap_conv_obj              SCP                           Ein CCC Converter-Objekt
cl_abap_container_utilities   SABP_CONVERT                  Container Programmierung
cl_abap_conv_in_ce            SABP_CONVERT                  Codepage- und Endian Konvertierung (Extern -> Systemformat)
cl_abap_conv_out_ce           SABP_CONVERT                  Codepage- und Endian Konvertierung (Systemformat -> Extern)
cl_abap_datadescr             SABP_RTTI                     Run Time Type Services
cl_abap_datfm                 SABP_CONVERT                  Internationalisierung und Datumsformat
cl_abap_dyn_prg               SABP                          Support for dynamic programming
cl_abap_elemdescr             SABP_RTTI                     Run Time Type Services
cl_abap_exceptional_values    SABP_CORE                     Liefert min,max...-Werte vordefinierter Typen
cl_abap_file_utilities        SABP                          Hilfsmittel für Files
cl_abap_format                SABP                          Hilfsmittel zur Formatierung
cl_abap_gzip                  ABAP_EXPIMP                   Klasse zur (De-) Kompression (gzip)
cl_abap_list_layout           SABP_LIST_TOOLS               Hilfsmittel für ABAP-Listen
cl_abap_matcher               SABP_REGEX                    Reguläre Ausdrücke
cl_abap_message_digest        SECH                          Kryptografischer Hash-Wert einer Nachricht
cl_abap_memory_utilities      SABP_CORE                     Hilfsmittel zur ABAP-Speicherverwaltung
cl_abap_random                SABP_RANDOM                   Pseudozufallszahlengenerator
cl_abap_random_int            SABP_RANDOM                   Integer Zufallszahlen
cl_abap_random_float          SABP_RANDOM                   Float Zufallszahlen
cl_abap_runtime               SABP_RUNTIME                  Hilfsklasse für Laufzeitmessungen
cl_abap_session_temperature   SABP_DAAG                     DB-Zugriffssteuerung für Data Aging
cl_abap_stack_temperature     SABP_DAAG                     DB-Zugriffssteuerung für Data Aging
cl_abap_structdescr           SABP_RTTI                     Run Time Type Services
cl_abap_syst                  SABP_CORE                     Sichere Ermittlung der SYST-Werte
cl_abap_tabledescr            SABP_RTTI                     Run Time Type Services
cl_abap_timefm                SABP_CONVERT                  Zeitformat
cl_abap_tstmp                 SABP_CONVERT                  Arithmetik- und Konvertierung für TimeStamps
cl_abap_typedescr             SABP_RTTI                     Run Time Type Services
cl_abap_zip                   ABAP_EXPIMP                   Zip-Utility

cl_alv_table_create           SLIS                          Dynamischer Create einer ALV-Datentabelle

cl_bcs_convert                SBCOMS                        BCS: Utilities für den Dokumenteninhalt
cl_bcs_message                SBCS_SEND                     BCS: Nachricht versenden
cl_bcs_utilities              SBCS_SEND                     Hilfsfunktionen zur Sendeschnittstelle

cl_bs_period_toolset_basics   BS_PERIOD_API                 Period Toolset - Basic Functions

cl_ci_query_attributes        S_CODE_INSPECTOR              Code Inspector: Abfrage von Attributen

cl_clb_tools                  S_CLB_COMMON                  Collaboration: Common Tools
cl_clb_parse_json             S_CLB_COMMON                  Utility Class to Parse JSON
cl_ctmenu                     SGUI                          Context Menu
cl_cts_language_file_io       STRALAN                       Filezugriffklasse des Sprachentransports

cl_db_sys                     SABP_CORE                     Abfragen von Datenbank-Informationen
cl_demo_output                SABAP_DEMOS_OUTPUT_STREAM     Demo-Ausgaben mit statischen Methoden oder Instanzmethoden

cl_fdt_xl_spreadsheet         SFDT_EXCEL_CORE               FDT:Spreadsheet document

cl_fxs_image_processor        S_XSLFO_SUPPLEMENTARY_IMAGE   Image Processor
cl_fxs_image_info             S_XSLFO_SUPPLEMENTARY_IMAGE   Image Information Determiner
cl_fxs_mime_types             S_XSLFO_SUPPLEMENTARY         Mime Type Constants

cl_gui_abapedit               SEDI                          Abap Edit Control
cl_gui_alv_grid               SLIS                          ALV List Viewer
cl_gui_calendar               SAPCALENDAR                   Calendar Control Proxy Class
cl_gui_cfw                    SCET                          Control Framework Basisklasse
cl_gui_chart_engine           SPIG                          Graphics: Präsentationsgrafiken
cl_gui_chart_engine_win       SPIG                          Graphics: Präsentationsgrafiken (WinGUI)
cl_gui_column_tree            SEU_TREE_CONTROL              Column Tree Control
cl_gui_container              SCET                          Abstracter Container fuer GUI Controls
cl_gui_control                SCET                          Proxy-Klasse für Control im GUI
cl_gui_custom_container       SCET                          Container fuer Custom Controls in der Dynpro Area
cl_gui_dialogbox_container    SCET                          Container fuer Custom Controls in der Dynpro Area
cl_gui_docking_container      SCET                          Docking Control Container
cl_gui_ecl_2dviewer           SECLVIEWER                    Engineering Client 2D Viewer
cl_gui_ecl_3dviewer           SECLVIEWER                    Engineering Client 3D Viewer
cl_gui_ecl_viewerbox          SECLVIEWER                    ECL Viewer als Pop-up Fenster
cl_gui_frontend_services      SCET                          Frontend Services
cl_gui_gos_container          SCET                          Generic Object Services Container
cl_gui_html_viewer            SAPHTML                       HTML Control proxy class
cl_gui_list_tree              SEU_TREE_CONTROL              List Tree Control
cl_gui_picture                SAPPICTURE                    SAP Picture Control
cl_gui_props_consumer         SCET                          Nimmt globale Gui-Props entgegen
cl_gui_simple_tree            SEU_TREE_CONTROL              Simple Tree Control
cl_gui_splitter_container     SCET                          Splitter Control
cl_gui_textedit               SAPTEXTEDIT                   SAP TextEdit Control
cl_gui_timer                  SCET                          SAP Timer Control
cl_gui_toolbar                SAPTOOLBAR                    Toolbar Control

cl_fdt_json                   SFDT_CORE                     Create JSON format from ABAP data and vice versa

cl_hrpad_date_computations    PAOC_PAD_DATE_COMPUTATIONS    Datumsberechnungen

cl_http_client                SHTTP                         HTTP client control block
cl_http_server                SIHTTP                        HTTP Framework (iHTTP) HTTP Server
cl_http_utility               SIHTTP                        HTTP Framework (iHTTP) HTTP Utilities

cl_icf_csv                    SHTTP                         ICF-Schnitstelle für CSV-File
cl_igs_image_converter        SPIG                          Internet Graphics Service: Image Converter

cl_openxml_helper             S_OOXML_CROSS                 OpenXML Helper Class

cl_s_aut_bal_log              S_AUT                         Meldungsprotokoll-Behandler

cl_salv_controller_metadata   SALV_OM_OBJECTS               ALV: abstrakter Controller
cl_salv_ex_util               SALV_EX                       utlity Klasse
cl_salv_table                 SALV_OM_OBJECTS               Basisklasse für einfache Tabellen

cl_time_chart_simple          S_DBMON_ORA_COCKPIT           Simple time chart (based on chart engine)

cl_xml_document               SWXML                         XML-Dokument für WF- WEB-Aktivität

if_salv_gui_table_ida         SALV_IDA_PUB                  ALV with integrated data access (ALV with IDA)

[ABAP] Popup für Werteauswahl

TYPES: BEGIN OF ty_sel_list,
         l TYPE char100,
       END OF ty_sel_list.

TYPES: ty_it_sel_list TYPE STANDARD TABLE OF ty_sel_list WITH DEFAULT KEY.

TYPES: ty_it_rsvbfidesc TYPE STANDARD TABLE OF rsvbfidesc WITH DEFAULT KEY.

START-OF-SELECTION.

  DATA(lv_ln) = 0.

  DATA(it_sel_list) = VALUE ty_it_sel_list(
                                            ( l = 'Feld 1' )
                                            ( l = 'Feld 2' )
                                            ( l = 'Feld 3' )
                                            ( l = 'Feld 4' )
                                            ( l = 'Feld 5' )
                                          ).

  DATA(it_rsvbfidesc) = VALUE ty_it_rsvbfidesc( ( fieldnum = 1 display = abap_true ) ).

  CALL FUNCTION 'RS_VALUES_BOX'
    EXPORTING
      cursor_field         = 1
      cursor_line          = 1
      left_upper_col       = 10
      left_upper_row       = 5
      title                = 'Auswahl'
    IMPORTING
      linenumber           = lv_ln
    TABLES
      field_desc           = it_rsvbfidesc
      value_tab            = it_sel_list
    EXCEPTIONS
      clear_contents       = 1
      invalid_coordinates  = 2
      invalid_field_number = 3
      no_action            = 4
      no_fields            = 5
      no_markfield         = 6
      process_user_action  = 7
      value_tab_empty      = 8
      value_tab_too_long   = 9
      OTHERS               = 10.

  IF sy-subrc = 0.
    WRITE: / 'Auswahl:', lv_ln.
  ENDIF.