Zum Hauptinhalt springen

ABAP-Fuba: Konvertiere MATID (EWM) zur MATNR (ERP)

DATA
: lv_matnr TYPE mara-matnr
, lt_huitm TYPE /scwm/tt_huitm_int
.

CALL FUNCTION '/SCWM/HU_READ'
EXPORTING
iv_appl = 'WME'
iv_huident = lv_huident
IMPORTING
et_huitm = lt_huitm
EXCEPTIONS
deleted = 1
not_found = 2
error = 3
OTHERS = 4
.
CHECK sy-subrc eQ 0.

READ TABLE lt_huitm INTO DATA(ls_item) INDEX 1.
CHECK sy-subrc eQ 0.

"Konvertiere MATID nach MATNR
CALL FUNCTION 'CONVERSION_EXIT_MDLPD_OUTPUT'
EXPORTING
input = ls_item-matid
IMPORTING
OUTPUT = lv_matnr
.

CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = lv_matnr
IMPORTING
OUTPUT = lv_matnr
.