Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Using BOm Function modules

Former Member
0 Likes
900

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.

6 REPLIES 6
Read only

kanishakgupta1
Contributor
0 Likes
771

Hi ,

u can use the following FM for creating the BOM plant wise

CSAP_MAT_BOM_CREATE.

Regards

kanishak

Read only

0 Likes
771

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.

Read only

Former Member
0 Likes
771

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.

Read only

Former Member
0 Likes
771

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

Read only

0 Likes
771

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.

Read only

0 Likes
771

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.