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: 

Create a material with reference.

Former Member
0 Kudos

Hi ABAPers,

I have a requirement to create material master record fetching some attributes from the existing SAP materials i.e to replicate the Create with reference feature in MM02

I have tried passing the value of reference material number to PL_REF_MAT parameter in CLIENDATA table of 'BAPI_MATERIAL_SAVEDATA'. But still it is not creating with reference.

I have got a solution; that is use of BAPI_MATERIAL_GET_ALL first and then BAPI_MATERIAL_SAVEDATA, but it may be a performance issue for my program as i m expecting 60000 materials.

Please propose any other solution.

8 REPLIES 8

madhu_vadlamani
Active Contributor
0 Kudos

Hi Ankit,

Are you doing from non sap or in sap.The bapi is fine for your requirement.Keep some good coding and see.Check with BAPI_STANDARDMATERIAL_CREATE,MATERIAL_MAINTAIN_DARK.

Regards,

Madhu.

0 Kudos

Hi Madura,

So you mean to say is that, i can create a material with reference material number by passing reference material number value to PL_RET_MAT field of the CLIENTDATA table of BAPI_MATERIAL_SAVEDATA ?

0 Kudos

Hi Ankit,

You can try that.

Regards,

Madhu.

0 Kudos

Hi Madhurao,

Sorry for mispronouncing your name.

I have tried that, but the BAPI is throwing error. According to you it is technically feasible?

0 Kudos

Hi Ankit,

What is the error you are getting.

Regards,

Madhu.

0 Kudos

Hi Madurao,

I am putting all the values in the BAPI_MATERIAL_SAVEDATA as well as PL_REF_MAT value.

This i am doing for the function code 'UPD' for an already existing material but the attributes like material group etc are not getting changed for this material on the basis of reference material.

Thanks and regards,

ankit

0 Kudos

Hi Ankit,

Did you check how it is copying from mm01 when you copying material.

Regards,

Madhu.

0 Kudos

No , i haven't checked.

For that do i have to do debugging of MM01?