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: 

Re: BAPI for Copying the Material

Former Member
0 Kudos

I need to create a new material from an existing material. My Issue is

1. In basic view , If material group is '20', INSIDE CLASSIFICATION VIEW, it is mandatory to have BATCH CLASS OBJECT.

2. If material group is '25' it is not mandatory of having BATCH CLASS OBJECT.

I am using BAPI_MATERIAL_SAVE_DATA for creation of BAPI and for creation of CLASSIFICATION VIEW, I am using other func. modules like 'BAPI_OBJCL_GETCLASSES', BAPI_OBJCL_GETDETAIL', 'BAPI_OBJCL_CHANGE' etc.

My code calls BAPI_MATERIAL_SAVE_DATA, then Func. Modules for CLASSIFICATION VIEW. In this way, I Can create material for group 25 successfully, but not for grp 20.

Because, for mat. grp 20, system throw error " MISSING BATCH CLASS in CLASSIFICATION VIEW to save data", which cannot be created until I use BAPI_MATERIAL_SAVE_DATA . At the same time, I cannot using CLASSIFICATION VIEW first and then call BAPI_MATERIAL_SAVE_DATA.

Any Suggestions.

Thanks in Advance

1 REPLY 1

Former Member
0 Kudos

Hi Cthota,

You would need the material to be created first, to create the classification object for that material in OBJEK tabke. Please try the following approach.

Suggestion is to create the material with a material group(other than 20) which does not require classification data. Call BAPI_TRANSACTION_COMMIT. Call BAPI_OBJCL_CHANGE / CREATE to create the classification view for the material..now change the material group in CLIENTDATA by calling the BAPI_MATERIAL_SAVE_DATA..I admit this is a round-about way..

hope this helps.

Sajan Joseph.