[ABAP] Dynamische WHERE-Clause für AMDP aus SELECT-OPTIONS generieren

* https://blogs.sap.com/2015/03/30/handling-of-select-options-parameters-within-amdp/
DATA: lv_matnr TYPE mara-matnr.
DATA: lv_mtart TYPE mara-mtart.

SELECT-OPTIONS: so_matnr FOR lv_matnr.
SELECT-OPTIONS: so_mtart FOR lv_mtart.

START-OF-SELECTION.

* SELECT-OPTIONS in deine dynamische WHERE-Clause überführen
  DATA(lv_where_string) = cl_shdb_seltab=>combine_seltabs( it_named_seltabs = VALUE #( ( name = 'MATNR' dref = REF #( so_matnr[] ) )
                                                                                       ( name = 'MTART' dref = REF #( so_mtart[] ) )
                                                                                     )
                                                         ).

  WRITE: / lv_where_string.

Kommentare sind geschlossen.