on 2007 Dec 24 11:34 AM
Hi All,
I would like to know, if anyone has used the function module 'CS_BOM_EXPL_MAT_V2' to prepare a report to read multi-level BOM just like CS12. If anyone has, can you please let me know how we can read the individual materials in the BOM from this FM.
Hope my question is clear, await inputs.
Vivek
Hi Vivek,
We use CS_BOM_EXPL_KND_V1 this function module.
Do u want code for that function ??
Regards,
Vishal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi vivek,
We use this code to restrict the BOM line item for particular movements. C if that can help u out.
CALL FUNCTION 'CS_BOM_EXPL_KND_V1'
EXPORTING
capid = ''
datuv = sy-datum
emeng = 1
mehrs = 'X'
mtnrv = i_mseg-matnr
stlal = '1'
stlan = '1'
stpst = 0
svwvo = 'X'
werks = i_mseg-werks
vbeln = aufk-kdauf
vbpos = aufk-kdpos
VERID = ' '
vrsvo = 'X'
IMPORTING
TOPMAT =
DSTST =
TABLES
stb = ZStb
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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SORT zstb BY mtart.
LOOP AT zstb.
IF zstb-mtart = 'Material type ' OR zstb-mtart = 'Material type ' .
ELSE.
DELETE zstb .
ENDIF.
ENDLOOP.
CLEAR: v_menge, v_matnr, v_bwart, vv_menge, vvv_menge, zstb.
LOOP AT zstb.
SELECT menge matnr bwart
INTO (v_menge,v_matnr,v_bwart)
FROM aufm
WHERE aufnr = i_mseg-aufnr
AND werks = i_mseg-werks
AND matnr = zstb-idnrk
AND ( bwart = '261' OR bwart = '262' ).
and meins = 'FT2'.
LOOP AT zstb.
SELECT SINGLE matnr INTO vv_matnr FROM mara WHERE matnr = v_matnr
AND mtart = zstb-mtart.
IF sy-subrc = 0.
CASE v_bwart.
WHEN '261' .
vv_menge = vv_menge + v_menge.
WHEN '262' .
vvv_menge = vvv_menge + v_menge.
ENDCASE.
ENDIF.
ENDLOOP.
ENDSELECT.
CLEAR vf_menge.
vf_menge = vv_menge - vvv_menge.
CLEAR vv_menge.
CLEAR vvv_menge.
Regards,
Vishal
Mr. Vishal,
I tested the Function module mentioned by you in SE37, to see what output i get. But the system prompts 'CALL INVALID'.
I tested the function with below parameters:
CAPID = PP01
DATUV = 24.12.2007
MEHRS = X
MTNRV = (The assembly number)
STLAL = 01
WERKS = 3000
May i know what could be the reason?
Vivek
Hi Vishal,
Thanks for the clarification. I am able to read the BOM in my program, but facing a bug in the program, as the program execution does not stop after reading the BOM once, it is going into an infinite loop, where it is re-reading the BOM. I am trying to figure out how i can ensure that the program reads the BOM once & displays it & not go into a infinite loop.
Any inputs from your end for this?
Vivek
Hi Vivek ,
capid = 'PI01'
datuv = sy-datum
emeng = 1
mehrs = 'X'
mktls = 'X'
mtnrv = Materials number
stlal = '1'
stlan = '1'
stpst = 0
svwvo = 'X'
werks = Plant
Through this input i m able to get output.
Tell me what inputs r u giving.
Vishal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mr. Pradeep,
Thanks for the inputs, but the BOM i am checking for is not recurssive. Actually just for test purpose, i am using a BOM with 2 materials. My infoset, reads the BOM correctly, but after reading both the material, it loops back to this section & the program continues to loop.
Note: Was able to trace the reason for this error & managed to execute the program, will post my problem in ABAP forum as the program instead of showing all the materials is only showing one material, i.e. the material field is over written each time with the new material in the multi-level BOM.
Thanks to Mr. Vishal & Mr. Pradeep for your inputs.
Regards,
Vivek
Edited by: Vivek on Dec 25, 2007 4:29 PM
User | Count |
---|---|
102 | |
8 | |
5 | |
4 | |
4 | |
3 | |
3 | |
2 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.