Code: Alles auswählen.
TABLES: mara, makt.
SELECT-OPTIONS:
so_matnr FOR mara-matnr,
so_mtart FOR mara-mtart,
so_maktx FOR makt-maktx.
START-OF-SELECTION.
TYPES:
BEGIN OF material.
INCLUDE TYPE mara AS base. TYPES:
text TYPE makt-maktx,
END OF material,
materials TYPE STANDARD TABLE OF material WITH EMPTY KEY.
DATA alv TYPE REF TO cl_salv_table.
DATA materialsWithTexts TYPE materials.
SELECT mara~*, coalesce( makt~maktx, 'No text maintained' )
FROM mara
LEFT OUTER JOIN makt
ON makt~matnr = mara~matnr
AND makt~spras = @sy-langu
WHERE mara~matnr IN @so_matnr AND mtart IN @so_mtart
INTO TABLE @materialsWithTexts
UP TO 10 ROWS.
cl_salv_table=>factory(
IMPORTING r_salv_table = alv
CHANGING t_table = materialsWithTexts
).
LOOP AT materialsWithTexts REFERENCE INTO DATA(materialWithText).
materialWithText->aenam = 'Test'.
ENDLOOP.
alv->display( ).