用CSAI_BOM_READ讀取WBS元素BOM
阿新 • • 發佈:2019-01-06
REPORT ZTES3.
data wa_csin type CSIN.
data tab_stpob type table of STPOB.
data tab_STKOB type table of STKOB.
data tab_DEP_DATA type table of CSDEP_DAT.
data tab_DEP_DESCR type table of CSDEP_DESC.
data tab_DEP_ORDER type table of CSDEP_ORD.
data tab_DEP_SOURCE type table of CSDEP_SORC.
data tab_DEP_DOC type table of CSDEP_DOC.
data g_warn_stlnr type STZUB-STLNR.
data g_flwarning type CAPIFLAG-FLWARNING.
cLEAR wa_csin.
* wa_csin-aennr = '009900159470'.
wa_csin-MATNR = '00000000000001040'.
wa_csin-EMENG = 2.
wa_csin-datuv = sy-datum.
wa_csin-PSPNR = '00045256'.
wa_csin-werks = '2000' .
wa_csin-stlan = '1'. " 4
wa_csin-stlty = 'P'.
data : l_text type string.
CALL FUNCTION 'CSAI_BOM_READ'
EXPORTING
ECSIN = wa_csin
IMPORTING
fl_warning = g_flwarning
TABLES
t_stpob = tab_stpob
T_STKOB = tab_stkob
T_DEP_DATA = tab_dep_data
T_DEP_DESCR = tab_dep_descr
T_DEP_ORDER = tab_dep_order
T_DEP_SOURCE = tab_dep_source
T_DEP_DOC = tab_dep_doc
EXCEPTIONS
ERROR = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO into l_text
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
write l_text.
ENDIF.
data wa_csin type CSIN.
data tab_stpob type table of STPOB.
data tab_STKOB type table of STKOB.
data tab_DEP_DATA type table of CSDEP_DAT.
data tab_DEP_DESCR type table of CSDEP_DESC.
data tab_DEP_ORDER type table of CSDEP_ORD.
data tab_DEP_SOURCE type table of CSDEP_SORC.
data tab_DEP_DOC type
data g_warn_stlnr type STZUB-STLNR.
data g_flwarning type CAPIFLAG-FLWARNING.
cLEAR wa_csin.
* wa_csin-aennr = '009900159470'.
wa_csin-MATNR = '00000000000001040'.
wa_csin-EMENG = 2.
wa_csin-datuv = sy-datum.
wa_csin-PSPNR = '00045256'.
wa_csin-werks = '2000' .
wa_csin-stlan = '1'. " 4
wa_csin-stlty = 'P'.
data
CALL FUNCTION 'CSAI_BOM_READ'
EXPORTING
ECSIN = wa_csin
IMPORTING
fl_warning = g_flwarning
TABLES
t_stpob = tab_stpob
T_STKOB = tab_stkob
T_DEP_DATA = tab_dep_data
T_DEP_DESCR = tab_dep_descr
T_DEP_ORDER =
T_DEP_SOURCE = tab_dep_source
T_DEP_DOC = tab_dep_doc
EXCEPTIONS
ERROR = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO into l_text
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
write l_text.
ENDIF.