‎2009 Apr 28 8:07 AM
Hi,
I have to create/change BOM for multiple plants and i am using below code, but it is not working. I think i am not passing the parameter values properly. Can anyone help me in how to use the below function modules in loop(i mean for multiple plants)?
* CHANGE Bom
CALL FUNCTION 'CS_BC_BOM_CHANGE_BATCH_INPUT'
EXPORTING
* BDC_FLAG = ' '
bom_header = ls_bom_header
close_group = 'X'
commit_work = 'X'
group_data = ls_group
new_group = 'X'
tcode_mode = ld_mode
tcode_update = 'S'
IMPORTING
msgid = ld_msgid
msgno = ld_msgno
msgty = ld_msgty
msgv1 = ld_msgv1
msgv2 = ld_msgv2
msgv3 = ld_msgv3
msgv4 = ld_msgv4
TABLES
bom_item = lt_bom_item
bom_sub_item = lt_sub_item.
* CREATE Bom
CALL FUNCTION 'CS_BI_BOM_CREATE_BATCH_INPUT1'
EXPORTING
* BDC_FLAG = ' '
bom_header = ls_bom_header
close_group = 'X'
commit_work = 'X'
group_data = ls_group
new_group = 'X'
tcode_mode = ld_mode
tcode_update = 'S'
IMPORTING
msgid = ld_msgid
msgno = ld_msgno
msgty = ld_msgty
msgv1 = ld_msgv1
msgv2 = ld_msgv2
msgv3 = ld_msgv3
msgv4 = ld_msgv4
TABLES
bom_item = lt_bom_item
bom_sub_item = lt_sub_item.
‎2009 Apr 28 9:11 AM
Hi ,
u can use the following FM for creating the BOM plant wise
CSAP_MAT_BOM_CREATE.
Regards
kanishak
‎2009 Apr 28 9:20 AM
Hi Kanishak,
Thanks for your reply. I am able to create/change bom using the FMs CS_BC_BOM_CHANGE_BATCH_INPUT & CS_BI_BOM_CREATE_BATCH_INPUT1 when i process the IDoc manually in SAP system.
But in my current situation Idoc will be proceed from third party system automatically. During that time it is not updating and getting the IDoc status as 51. and when i process the same Idoc which is having 51 manually in SAP, it was processed and updated the BOM and the status went to 53.
This is the problem i am facing. Kindly provide me an alternative solution.
‎2009 Apr 28 10:15 AM
yes possibly there is some issue with the data that you pass.
May be you are not passing the mandatory fields for your function module.
Try to execute the function module directly and see how and which values are to be passed and then check in your code if you are populating it that way.
Regards,
Lalit Mohan Gupta.
‎2009 Apr 28 10:19 AM
hi,
make sure that all the data which is required for FMs is comming from third party are not do some debug hope it will work.
~linganna
‎2009 Apr 28 10:26 AM
Hi All,
When i execute maually it is working fine. I think there is some problem is passing new_group or close_group parameters. I am not able to understand when to pass 'X' and when not.
If i process the IDoc manually no error message and Idoc status is 53 and updated the BOM for multiple plants.
When the IDoc is processed from 3rd party system, IDoc status getting 51 and not updating the BOM and the error message is 'BDC_INSERT', Session not opened'. This is the problem.
‎2009 Apr 28 11:55 AM
Hi All,
With connection to the same issue, i have another doubt on this.
Can we use the call transaction method on same transaction with different input data in a loop? I mean multiple calls of call transaction method for the same transaction.
Please clarify.