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: 

Problem with BAPI_MATERIAL_SAVEDATA

Former Member
0 Kudos

Hi.

I'm having a problem when creating new materials with FM 'BAPI_MATERIAL_SAVEDATA'.

First, I'm taking a new material number with FM 'BAPI_MATERIAL_GETINTNUMBER', the number is generated without any problems. After, I try to create the new material, I have a message of 'SUCCESS' (Material have been created), but when I come to MM03 to see it, the material have not been created. I'm using COMMIT WORK after these BAPIs.

Please, help!

Thanks and Regards!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Why do you want to use 'BAPI_MATERIAL_GETINTNUMBER' for creating a new number?

The fm: BAPI_MATERIAL_SAVEDATA, has a call to 'MATNR_NUMBER_CREATE' to create a new number.

Did you pass all the requred fields in the proper tables? Check that.

And also use 'BAPI_TRANSACTION_COMMIT' after the BAPI_MATERIAL_SAVEDATA call.

Regards,

Subramanian

7 REPLIES 7

Former Member
0 Kudos

Hi,

Why do you want to use 'BAPI_MATERIAL_GETINTNUMBER' for creating a new number?

The fm: BAPI_MATERIAL_SAVEDATA, has a call to 'MATNR_NUMBER_CREATE' to create a new number.

Did you pass all the requred fields in the proper tables? Check that.

And also use 'BAPI_TRANSACTION_COMMIT' after the BAPI_MATERIAL_SAVEDATA call.

Regards,

Subramanian

Former Member
0 Kudos

Hi Subramanian.

I've checked all the process and it's OK. I"m just having problem after FM 'BAPI_MATERIAL_SAVEDATA' have been executed. I have a return from this bapi with a 'SUCCESS' message, that the material have been created without any problems, but when I come to transaction MM03, or table MARA, MARC... The new material isn't in there!

Thanks and regards!

0 Kudos

Some time Wait statement works just check by using Wait 30 sec statement after your commit.

Thanks

Sudharshan

Former Member
0 Kudos

Hi Sudharshan.

I've checked what you told me, but all the things that I saw was all right. It's very strange, because my BAPI has a SUCCES message, the number of the material created, but nothing happens! Material is not created...

Thanks.

0 Kudos

Hello Rodolfo,

Why don't you use:

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.

Regards,

Daniel.

Former Member
0 Kudos

Hi Daniel.

I'm already using this, but the problem is always the same... A success message without a material created.

Thanks!

Former Member
0 Kudos

The material number returned by the FM BAPI_MATERIAL_GETINTNUMBER was moved to a variable, and the zeros didn't appear when calling the FM BAPI_MATERIAL_SAVEDATA. So, the problem was with the zeros on material number.