Code: Alles auswählen.
Report ZPSTUELIE.
Data: lv_matnr type mara-matnr.
DATA: istb LIKE stpol OCCURS 0 WITH HEADER LINE.
*PARAMETERS: p_mtnrv LIKE lv_matnr.
select-OPTIONS: p_mtnrv for lv_matnr.
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
* FTREL = ' '
* ALEKZ = ' '
* ALTVO = ' '
* AUFSW = ' '
* AUMGB = ' '
* AUMNG = 0
* AUSKZ = ' '
* AMIND = ' '
* BAGRP = ' '
* BEIKZ = ' '
* BESSL = ' '
* BGIXO = ' '
* BREMS = ' '
CAPID = 'PP01'
* CHLST = ' '
* COSPR = ' '
* CUOBJ = 000000000000000
* CUOVS = 0
* CUOLS = ' '
DATUV = sy-datum
* DELNL = ' '
* DRLDT = ' '
* EHNDL = ' '
EMENG = 1
* ERSKZ = ' '
* ERSSL = ' '
* FBSTP = ' '
* KNFBA = ' '
* KSBVO = ' '
* MBWLS = ' '
* MKTLS = 'X'
* MDMPS = ' '
MEHRS = 'X'
* MKMAT = ' '
* MMAPS = ' '
* SALWW = ' '
* SPLWW = ' '
* MMORY = ' '
MTNRV = p_mtnrv
* NLINK = ' '
* POSTP = ' '
* RNDKZ = ' '
* RVREL = ' '
* SANFR = ' '
* SANIN = ' '
* SANKA = ' '
* SANKO = ' '
* SANVS = ' '
* SCHGT = ' '
* STKKZ = ' '
* STLAL = ' '
* STLAN = ' '
* STPST = 0
* SVWVO = 'X'
WERKS = '0010'
* NORVL = ' '
* MDNOT = ' '
* PANOT = ' '
* QVERW = ' '
* VERID = ' '
* VRSVO = 'X'
* SGT_SCAT =
* SGT_REL =
* CALLER_APP =
* BOM_VERSN =
* IMPORTING
* TOPMAT =
* DSTST =
TABLES
STB = istb
* MATCAT =
* EXCEPTIONS
* ALT_NOT_FOUND = 1
* CALL_INVALID = 2
* MATERIAL_NOT_FOUND = 3
* MISSING_AUTHORIZATION = 4
* NO_BOM_FOUND = 5
* NO_PLANT_DATA = 6
* NO_SUITABLE_BOM_FOUND = 7
* CONVERSION_ERROR = 8
* OTHERS = 9
.
IF SY-SUBRC <> 0.
*Implement suitable error handling here
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_STRUCTURE_NAME = 'STPO'
TABLES
T_OUTTAB = ISTB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
ENDIF.
Code: Alles auswählen.
DATA: dummy_matnr TYPE mara-matnr,
gefundene_materialnummern TYPE STANDARD TABLE OF mara-matnr WITH EMPTY KEY.
SELECT-OPTIONS s_matnr for dummy_matnr.
START-OF-SELECTION.
SELECT matnr INTO TABLE gefundene_materialnummern FROM MARA
WHERE matnr IN s_matnr.
LOOP AT gefundene_materialnummern ASSIGNING FIELD-SYMBOL(<matnr>).
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING MTNRV = <matnr>
... (restliche Parameter)
ENDLOOP.
Code: Alles auswählen.
DATA: istb LIKE stpol OCCURS 0 WITH HEADER LINE.
Code: Alles auswählen.
DATA istb TYPE STANDARD TABLE OF stpol.