Code: Alles auswählen.
ls_component-name = 'BISMT'.
ls_component-type ?= cl_abap_datadescr=>describe_by_data( <fs_article>-bismt ).
APPEND ls_component TO gt_component.
CLEAR : ls_component-name, ls_component-type.
LOOP AT it_article ASSIGNING <fs_article>.
READ TABLE gt_component INTO ls_component WITH KEY name = <fs_article>-werks.
IF sy-subrc NE 0.
ls_component-name = <fs_article>-werks.
ls_component-type ?= cl_abap_datadescr=>describe_by_data( <fs_article>-mmsta ).
APPEND ls_component TO gt_component.
CLEAR : ls_component, str_mmstd, str_werks .
IF so_date1 IS NOT INITIAL.
str_werks = <fs_article>-werks.
CONCATENATE 'MMSTD' '_' str_werks INTO str_mmstd.
ls_component-name = str_mmstd.
ls_component-type ?= cl_abap_datadescr=>describe_by_data( <fs_article>-mmstd ).
APPEND ls_component TO gt_component.
ENDIF.
ENDIF.
CLEAR : ls_component, str_mmstd, str_werks .
ENDLOOP.
Folgende Benutzer bedankten sich beim Autor a-dead-trousers für den Beitrag:
Icke0801