REPORT zdavid_submit_return.
DATA:gc_matnr TYPE ekpo-matnr,
it_list TYPE TABLE OF abaplist,
wa_list LIKE LINE OF it_list.
RANGES: r_matnr FOR ekpo-matnr.
SELECT-OPTIONS: s_matnr FOR gc_matnr.
SUBMIT rm06em00
EXPORTING LIST TO MEMORY
WITH em_matnr IN s_matnr
WITH listu = 'ALLES'
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = it_list
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
LOOP AT it_list INTO wa_list.
WRITE wa_list-rfcrecord.
ENDLOOP.
ENDIF.