Application Development 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: 

Error in Creating a BOM / CSAP_MAT_BOM_MAINTAIN

karthik_rajaspic
Participant
0 Kudos

hi,

i need to create multiple bom alternatives in my development. i try using CSAP_MAT_BOM_MAINTAIN for this purpose.

even after i give all the inputs and flags necessary for creating a new bom, i am getting an error stating that bom already exist for....when i go and check MAST table, for the same material, plant and bom usage... no such alternative exist.

i am unable to proceed further. can anyone help me in this regard? thanks in advance.

3 REPLIES 3

Former Member
0 Kudos

Hi,

I have the same problem. I think FM "CSAP_MAT_BOM_MAINTAIN" is only able to create one alternative per BOM.

So I use FM "CSAI_BOM_CREAT"E to create the BOM/Variant without any positions, only the header. And then I use FM "CSAP_MAT_BOM_MAINTAIN" to create the posiitons and - what is very important for me - to assign the object dependencis to the positions.

I hope this helps a little bit!

0 Kudos

friend... you are right.

CSAP_MAT_BOM_MAINTAIN is used to create only one alternative bom. but this can be any number from 01 to 99. if any alternative bom exist for the same combination of material, plant and bom usage... then you cannot create any more alternative bom for the above mentioned combination. this is because... this function module checks MAST table before proceeding with creation. while checking MAST, it considers only material, plant and bom usage. alternative bom is left out here. but the real fact is... alternative bom should be also considered for uniqueness of bom while checking MAST. all these issues are only during bom creation, but the same function module works perfect during bom maintenance.

CSAP_MAT_BOM_CREATE is also used to create only one alternative bom. but this can be only one number - 01 (default). but, you cannot maintain a bom using this function module. you need to use CSAP_MAT_BOM_MAINTAIN for bom maintenance.

to create any number of alternative bom for a material, plant and bom usage combination... you need to use the function module BAPI_MATERIAL_BOM_GROUP_CREATE. but... you cannot maintain any bom or create object dependencies for line items using this function module.

summary:

to create a bom.. use BAPI_MATERIAL_BOM_GROUP_CREATE

to read a bom.. use CSAP_MAT_BOM_READ

to maintain a bom.. use CSAP_MAT_BOM_MAINTAIN.

to create object dependency.. use CSAP_MAT_BOM_OPEN , CSAP_BOM_ITEM_MAINTAIN , CSAP_MAT_BOM_CLOSE.

karthik_rajaspic
Participant
0 Kudos

the above post is the answer..!

hence closed.