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

Problem with BAPI_MATERIAL_SAVEDATA

Former Member
0 Likes
1,503

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
Read only

Former Member
0 Likes
1,240

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
Read only

Former Member
0 Likes
1,241

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

Read only

Former Member
0 Likes
1,240

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!

Read only

0 Likes
1,240

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

Thanks

Sudharshan

Read only

Former Member
0 Likes
1,240

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.

Read only

0 Likes
1,240

Hello Rodolfo,

Why don't you use:

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.

Regards,

Daniel.

Read only

Former Member
0 Likes
1,240

Hi Daniel.

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

Thanks!

Read only

Former Member
0 Likes
1,240

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.