Dynamically add characteristics to internal table by customizing
I created 2 tables, header and item
MANDT
PROGRAMNAME
MANDT
PROGRAMNAME
ATINN
MANDT
PROGRAMNAME
ATINN
ATFOR
ANZST
ANZDZ
ATBEZ
"Get Any data
DATA(lt_stock) = cl_businessLayer=>if_stock~get_data( parameters = parameters ).
"Add Characteristics dynamicall
DATA(Result) = zcl_sd_characteristics=>add_characteristics( EXPORTING table = REF #( lt_stock )
programname = 'ZSD_R_STOCK'
IMPORTING fieldcatalog = Fieldcatalog
).
"All characteristics in the customization table dynamically added
ASSIGN Result->* TO FIELD-SYMBOL(<Table>).