Code: Alles auswählen.
DATA:
ls_topmat TYPE mc29s,
lt_wultb TYPE STANDARD TABLE OF stpov,
lt_equicat TYPE STANDARD TABLE OF cscequi,
lt_kndcat TYPE STANDARD TABLE OF cscknd,
lt_matcat TYPE STANDARD TABLE OF cscmat,
lt_stdcat TYPE STANDARD TABLE OF cscstd,
lt_tplcat TYPE STANDARD TABLE OF csctpl.
FIELD-SYMBOLS:
<ls> TYPE stpov.
*
CALL FUNCTION 'CS_WHERE_USED_MAT'
EXPORTING
datub = p_stida
datuv = p_stida
matnr = cs-matnr
* POSTP = ' '
* RETCODE_ONLY = ' '
stlan = p_stlan
werks = cs-werksmc
* MCLMT = ' '
* MNSTL = ' '
* MXSTL = ' '
* STLTP = ' '
* NEWSI = ' '
IMPORTING
topmat = ls_topmat
TABLES
wultb = lt_wultb[]
equicat = lt_equicat[]
kndcat = lt_kndcat[]
matcat = lt_matcat[]
stdcat = lt_stdcat[]
tplcat = lt_tplcat[]
* PRJCAT =
EXCEPTIONS
call_invalid = 1
material_not_found = 2
no_where_used_rec_found = 3
no_where_used_rec_selected = 4
no_where_used_rec_valid = 5
OTHERS = 6.
IF sy-subrc <> 0.
CLEAR: cs-co, cs-wu.
APPEND cs TO ct.
ELSE.
* Move 'Material Master Record Table: Bills of Material' to Changing Structure
MOVE-CORRESPONDING ls_topmat TO cs-co.
IF NOT lt_wultb[] IS INITIAL.
LOOP AT lt_wultb[] ASSIGNING <ls>.
MOVE-CORRESPONDING <ls> TO cs-wu.
APPEND cs TO ct.
ENDLOOP.
ELSE.
CLEAR cs-wu.
APPEND cs TO ct.
ENDIF.
ENDIF.
Code: Alles auswählen.
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
capid = space
datuv = sy-datum
mtnrv = mat_num
stlan = usage
svwvo = abap_true " oder einfach 'X'
werks = plant
TABLES
stb = lt_stpox.