‎2008 May 21 9:02 AM
Hello all,
I never worked with such a kind of assignment.I have to
explode CS_BOM_EXPLOSION.I got syntax but could not retrieve the data.In this case
assume li_datuv is what user enters ie budat
li_werks is plantcode
li_mtnrv is material no.
i have declared STARTMAT as internal table of type CSTMAT. and further declared i_XXX tables based on corresponding structures.
Wil be definitely rewarded.
loop at i_mseg.
li_datuv = i_mseg-budat.
li_mktls = 'X'.
li_mehrs = 'X'.
li_mtnrv = i_mseg-matnr.
li_mmory = '1'.
li_stlal = '001'.
li_werks = s_werks.
li_svwvo = 'X'.
li_vrsvo = 'X'.
CALL FUNCTION 'CS_BOM_EXPLOSION'
EXPORTING
DATUV = li_datuv
MKTLS = 'X'
MEHRS = 'X'
MMORY = '1'
MTNRV = li_mtnrv
STLAL = '01'
SVWVO = 'X'
VRSVO = 'X'
WERKS = li_WERKS
IMPORTING
TOPMAT = STARTMAT "includes structure CSTMAT
TABLES
STBD = i_tbd "includes structure CSXDOC
STBE = i_tbe "includes structure CSXEQUI
STBK = i_tbk "includes structure CSXKLA
STBM = i_tbm "includes structure CSXMAT
STBP = i_tbp "includes structure CSXGEN
STBT = i_tbt "includes structure CSXTDL
EXCEPTIONS
ALT_NOT_FOUND = 1
CALL_INVALID = 2
MISSING_AUTHORIZATION = 3
NO_BOM_FOUND = 4
NO_PLANT_DATA = 5
NO_SUITABLE_BOM_FOUND = 6
OBJECT_NOT_FOUND = 7
CONVERSION_ERROR = 8
OTHERS = 9.
endloop.
‎2008 May 21 9:05 AM
‎2008 May 21 9:06 AM
‎2008 May 21 9:11 AM
‎2008 May 21 10:19 AM
How to give parameters in this module in nse37.
I noticed some finished/smei finished goods.
But which date should i give in datuv ie to pick from where ?
‎2008 May 21 10:26 AM
its only for testing ...for ex:give a line item of ur itab and check
‎2008 May 21 10:29 AM
Yes for the time neing ,i am looking for such case but dont know what material no and date particularly to give
‎2008 May 21 10:39 AM
goto tcode cs13 and check for some entries...
check it with se37.
u want to get the child materials when passing FERT ( Upper to lower hierarchy )...
the below code part gets all its child hierarchically for a FERT part in a plant..check whethre its usefull..
DATA:wk_bom TYPE stpo-menge.
DATA:it_stpo LIKE STANDARD TABLE OF st_stpo.
DATA:it_stpo1 LIKE STANDARD TABLE OF st_stpo.
PERFORM get_stpo_data USING so_matnr so_werks '1'.
LOOP AT t_stpo[] INTO s_stpo.
MOVE s_stpo-component TO st_stpo-matnr.
MOVE s_stpo-comp_qty TO st_stpo-menge.
APPEND st_stpo TO it_stpo[].
CLEAR st_stpo.
ENDLOOP.
ENDDO.
LOOP AT it_stpo[] INTO st_stpo.
REFRESH t_stpo[].
PERFORM get_stpo_data USING st_stpo-matnr so_werks '1'.
LOOP AT t_stpo[] INTO s_stpo.
AT FIRST .
MOVE st_stpo-menge TO wk_bom.
ENDAT.
MOVE s_stpo-component TO st_stpo-matnr.
st_stpo-menge = s_stpo-comp_qty * wk_bom.
APPEND st_stpo TO it_stpo[].
AT LAST.
CLEAR wk_bom.
ENDAT.
ENDLOOP.
ENDLOOP.
SORT it_stpo[] ASCENDING.
*Sum up all menge for a part
LOOP AT it_stpo[] INTO st_stpo.
COLLECT st_stpo INTO it_stpo1[].
CLEAR st_stpo.
ENDLOOP.
REFRESH it_stpo[].
it_stpo[] = it_stpo1[].
FREE it_stpo1[].
*&---------------------------------------------------------------------*
*& Form get_stpo_data
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_SO_MATNR text
* -->P_SO_WERKS text
* -->P_0469 text
*----------------------------------------------------------------------*
FORM get_stpo_data USING p_so_matnr TYPE marc-matnr
p_so_werks TYPE marc-werks
value(p_0469) TYPE any.
CALL FUNCTION 'CSAP_MAT_BOM_READ'
EXPORTING
material = p_so_matnr
plant = p_so_werks
bom_usage = p_0469
TABLES
t_stpo = t_stpo
EXCEPTIONS
error = 1
OTHERS = 2.
ENDFORM. " get_stpo_data