Code: Alles auswählen.
REPORT.
DATA: lt_amara_ueb TYPE STANDARD TABLE OF mara_ueb WITH NON-UNIQUE DEFAULT KEY,
lt_amvke_ueb TYPE STANDARD TABLE OF mvke_ueb WITH NON-UNIQUE DEFAULT KEY,
lt_amfieldres TYPE STANDARD TABLE OF mfieldres WITH NON-UNIQUE DEFAULT KEY,
lt_amerrdat TYPE STANDARD TABLE OF merrdat WITH NON-UNIQUE DEFAULT KEY.
PARAMETERS: p_matnr TYPE matnr OBLIGATORY,
p_vkorg TYPE vkorg OBLIGATORY,
p_vtweg TYPE vtweg OBLIGATORY.
*--------------------------------------------------------------------*
*Clear MVKE-PRAT1
*--------------------------------------------------------------------*
lt_amara_ueb = VALUE #( ( mandt = sy-mandt
matnr = p_matnr
pstat = 'V'
tcode = 'MM02'
tranc = 1
d_ind = 1 ) ).
lt_amvke_ueb = VALUE #( ( mandt = sy-mandt
matnr = p_matnr
vkorg = p_vkorg
vtweg = p_vtweg
tranc = 1
d_ind = 1 ) ).
*--------------------------------------------------------------------*
*Field to reset
*--------------------------------------------------------------------*
lt_amfieldres = VALUE #( ( fname = 'MVKE-PRAT1'
tranc = 1
d_ind = 1 ) ).
CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'
EXPORTING
p_kz_no_warn = 'X'
kz_prf = 'W'
TABLES
amara_ueb = lt_amara_ueb
amvke_ueb = lt_amvke_ueb
amfieldres = lt_amfieldres
amerrdat = lt_amerrdat
EXCEPTIONS
kstatus_empty = 1
tkstatus_empty = 2
t130m_error = 3
internal_error = 4
too_many_errors = 5
update_error = 6
error_propagate_header = 7
OTHERS = 8.
IF sy-subrc <> 0.
DATA(ls_syst) = syst.
MESSAGE ID ls_syst-msgid TYPE 'I' NUMBER ls_syst-msgno
WITH ls_syst-msgv1 ls_syst-msgv2 ls_syst-msgv3 ls_syst-msgv4 DISPLAY LIKE 'E'.
ELSE.
break-point. " See errormessage in lt_amerrdat or use utilitfunction to display errortable
ENDIF.