TYPES: BEGIN OF ts_mara,
matnr TYPE mara-matnr,
ernam TYPE mara-ernam,
mtart TYPE mara-mtart,
matkl TYPE mara-matkl,
END OF ts_mara.
PARAMETERS: p_matnr TYPE matnr.
DATA dref TYPE REF TO data.
CREATE DATA dref TYPE ts_mara.
ASSIGN dref->* TO FIELD-SYMBOL(<wa_mara>).
SELECT SINGLE matnr ernam mtart matkl
FROM mara INTO <wa_mara>
WHERE matnr = p_matnr.
IF sy-subrc = 0.
ASSIGN COMPONENT 'MATNR' OF STRUCTURE <wa_mara> TO FIELD-SYMBOL(<matnr>).
ASSIGN COMPONENT 'ERNAM' OF STRUCTURE <wa_mara> TO FIELD-SYMBOL(<ernam>).
ASSIGN COMPONENT 'MTART' OF STRUCTURE <wa_mara> TO FIELD-SYMBOL(<mtart>).
ASSIGN COMPONENT 'MATKL' OF STRUCTURE <wa_mara> TO FIELD-SYMBOL(<matkl>).
WRITE: / <matnr>,
<ernam>,
<mtart>,
<matkl>.
ENDIF.
No comments:
Post a Comment