Code: Alles auswählen.
CALL FUNCTION 'L_TO_CREATE_MULTIPLE'
EXPORTING
i_lgnum = lv_lgnum
i_bwlvs = '999'
i_nidru = 'X'
i_commit_work = ' '
IMPORTING
e_tanum = lv_tanum
TABLES
t_ltap_creat = lt_ltap
* t_ltak = lt_ltak
EXCEPTIONS
no_to_created = 1
bwlvs_wrong = 2
betyp_wrong = 3
benum_missing = 4
betyp_missing = 5
foreign_lock = 6
vltyp_wrong = 7
vlpla_wrong = 8
vltyp_missing = 9
nltyp_wrong = 10
nlpla_wrong = 11
nltyp_missing = 12
rltyp_wrong = 13
rlpla_wrong = 14
rltyp_missing = 15
squit_forbidden = 16
manual_to_forbidden = 17
letyp_wrong = 18
vlpla_missing = 19
nlpla_missing = 20
sobkz_wrong = 21
sobkz_missing = 22
sonum_missing = 23
bestq_wrong = 24
lgber_wrong = 25
xfeld_wrong = 26
date_wrong = 27
drukz_wrong = 28
ldest_wrong = 29
update_without_commit = 30
no_authority = 31
material_not_found = 32
lenum_wrong = 33
matnr_missing = 34
werks_missing = 35
anfme_missing = 36
altme_missing = 37
lgort_wrong_or_missing = 38
OTHERS = 39.
IF sy-subrc <> 0.
CLEAR ls_messg.
CALL FUNCTION 'WRITE_MESSAGE'
EXPORTING
msgid = sy-msgid
msgno = sy-msgno
msgty = sy-msgty
msgv1 = sy-msgv1
msgv2 = sy-msgv2
msgv3 = sy-msgv3
msgv4 = sy-msgv4
IMPORTING
messg = ls_messg.
MOVE 'Fehler:' TO zeile1.
MOVE ls_messg-msgtx+0(20) TO zeile2.
MOVE ls_messg-msgtx+20(20) TO zeile3.
MOVE ls_messg-msgtx+40(20) TO zeile4.
MOVE ls_messg-msgtx+60(20) TO zeile5.
MOVE ls_messg-msgtx+80(20) TO zeile6.
MOVE ls_messg-msgtx+100(20) TO zeile7.
MOVE ls_messg-msgtx+120(20) TO zeile8.
* ....
ELSE.
COMMIT WORK.
ENDIF.
Code: Alles auswählen.
CALL FUNCTION 'L_TO_CREATE_MULTIPLE'
EXPORTING
* [...]
IMPORTING
* [...]
TABLES
* [...]
EXCEPTIONS
no_to_created = 1
* [...]
lgort_wrong_or_missing = 38
error_message = 39 " <-- hier einfügen
OTHERS = 40.
Folgende Benutzer bedankten sich beim Autor Lukas Sanders für den Beitrag:
raisa