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

Multi-level BOM explosion using CS_BOM_EXPL_MAT_V2

Former Member
0 Likes
1,963

Hi,

Could some one help me with sample code for Multi level BOM explosion using FM CS_BOM_EXPL_MAT_V2..?

Please provide the sample having more than 1 material to be exploded.

Thanks in adv,

Shiv

1 ACCEPTED SOLUTION
Read only

ramesh_mahankali
Active Participant
0 Likes
1,469

Hi,

Please find the attached sample code.


  CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
       EXPORTING
            capid                 = 'PC01'      " Application ID
            datuv                 = l_datuv     " Validity date
*              emeng                 = p_emeng     " Required quantity
*            MDMPS                 = ' '         " explode phantoms
            mtnrv                 = lt_mast-matnr     " Material
            stlal                 = lt_mast-stlal  " Alternative BOM
            stlan                 = lt_mast-stlan     " BOM usage
            werks                 = lt_mast-werks     " Plant
       IMPORTING
            topmat                = top_mat     " Data for top material
       TABLES
            stb                   = bom_tab     " BOM item data table
       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
            OTHERS                = 8.

Hope this helps.

Thanks,

Ramesh

6 REPLIES 6
Read only

ramesh_mahankali
Active Participant
0 Likes
1,470

Hi,

Please find the attached sample code.


  CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
       EXPORTING
            capid                 = 'PC01'      " Application ID
            datuv                 = l_datuv     " Validity date
*              emeng                 = p_emeng     " Required quantity
*            MDMPS                 = ' '         " explode phantoms
            mtnrv                 = lt_mast-matnr     " Material
            stlal                 = lt_mast-stlal  " Alternative BOM
            stlan                 = lt_mast-stlan     " BOM usage
            werks                 = lt_mast-werks     " Plant
       IMPORTING
            topmat                = top_mat     " Data for top material
       TABLES
            stb                   = bom_tab     " BOM item data table
       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
            OTHERS                = 8.

Hope this helps.

Thanks,

Ramesh

Read only

0 Likes
1,469

Thanks for your input Ramesh.Any idea whether it can be used for more than 1 material(Multi level explosion)..?

Regards,

Shiv

Read only

0 Likes
1,469

Hi,

Go trough the [LINK|http://wiki.sdn.sap.com/wiki/display/Snippets/ProgramonExplodingBillOf+Materials] which has a detial code for multi level bom explosion program.

Regards,

Shanmugavel chandrasekaran

Read only

0 Likes
1,469

Yes.

You need to call this FM in loop to use it for multiple materials.

-Ramesh

Read only

Former Member
0 Likes
1,469

Thanks for the info!

Read only

Former Member
0 Likes
1,469

Thanks