10-18-2007 8:26 PM
please help me in this issue. function module is not working.
Here i am passing a material to this function module , then it will return its subcomponents ie sub materials and their bom usage.
The fun module is working fine for all the materials except some materials for example say material 1000000001. But i went to se37 and executed the fun module with the same parameters as given here and passed the material 1000000001. Here the output is comming ie sub materials are comming. But in the program for this material it is not comming. the sy-subrc value after this function module is 1. please tell me why it is not comming in the program but working fine in se37.
my coding and parameters are like this.
LOOP AT itab_final .
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
capid = 'PP01'
datuv = sy-datum
EMENG = 1
mktls = 'X'
mehrs = 'X'
mtnrv = itab_final-matnr
stlal = '1'
stlan = '1'
stpst = 0
svwvo = 'X'
werks = plant_werks
VERID = ' '
vrsvo = 'X'
IMPORTING
TOPMAT =
DSTST =
TABLES
stb = itab_return
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 EQ 0. //// here subrc value is 1 for the above material.
LOOP AT itab_return.
///// here i have some coding
ENDLOOP.
ENDIF.
ENDLOOP.
10-19-2007 3:36 PM
Hi,
Please give 01 instead of just 1 in the STLAL field.I think the error is because of this.Just chek once.
Hope it works.
Thanks,
Sandeep.
10-18-2007 8:30 PM
Hi,
Please use FM CONVERSION_EXIT_MATN1_INPUT to convert material from internal table ITAB_FINAL prior to call FM CS_BOM_EXPL_MAT_V2.
DATA: wa_matnr LIKE mara-matnr.
LOOP AT itab_final.
wa_matnr = itab_final -matnr.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = wa_matnr
IMPORTING
output = wa_matnr.
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
capid = 'PP01'
datuv = sy-datum
EMENG = 1
mktls = 'X'
mehrs = 'X'
mtnrv = wa_matnr "Change here
stlal = '1'
stlan = '1'
stpst = 0
svwvo = 'X'
werks = plant_werks
* VERID = ' '
vrsvo = 'X'
* IMPORTING
* TOPMAT =
* DSTST =
TABLES
stb = itab_return
* 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.
...
Regards,
Ferry Lianto
10-19-2007 3:26 PM
Thanks Ferry for the reply. But I am still getting the same problem , sy-subrc is 1. only for that material .But it is executing in se37, there I am getting the results.
Thank you very much for ur reply.
10-19-2007 3:31 PM
Hi,
Please check and ensure that you pass the same parameters for FM CS_BOM_EXPL_MAT_V2 as you did in SE37.
Is it only for a material or all material?
Regards,
Ferry Lianto
10-19-2007 3:36 PM
Hi,
Please give 01 instead of just 1 in the STLAL field.I think the error is because of this.Just chek once.
Hope it works.
Thanks,
Sandeep.
10-20-2007 8:03 PM
Hi Sandeep , I am very much grateful to you . My Problem has been solved by your answer.
Thank you very much Sandeep