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

BAPI_MATERIAL_SAVEDATA

Former Member
0 Kudos
618

Hello Everybody..

I am using BAPI "BAPI_MATERIAL_SAVEDATA" for Material master Upload and extension.

When ever I have material number in flat file, it will extend the material.

But when matnr is not provided the it will create material.

As that BAPI doesnot provide internal number , so i am creating a number using BAPI " BAPI_MATERIAL_GETINTNUMBER".

Everything is working fine.

Now my problem is..

in a flat fiel , if we have any error data, then material is not been created.

But as we are already generating a number externally. That sequence number is wasted.

My users want to avoid this.

So please suggest me, how to revert back the material number if BAPI_MATERIAL_SAVEDATA is not successfull.

So that in next run it can you same sequence number.

Thanks in Advance.

Regards

Ravi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Kudos
483

Hello,

This is a problem that a lot of customers have, not only when creating materials also with other objects.

Problem is that once the function module BAPI_MATERIAL_GETINTNUMBER is called to get a new number the number range is already updated and committed, this means there is no way back.

You can even test this in SE37 execute the function module and you will see that the number range is already updated.

Even when you perform a roll back in your program or don't save the material the number range will be updated.

I hope this is usefull.

Wim

2 REPLIES 2
Read only

Former Member
0 Kudos
484

Hello,

This is a problem that a lot of customers have, not only when creating materials also with other objects.

Problem is that once the function module BAPI_MATERIAL_GETINTNUMBER is called to get a new number the number range is already updated and committed, this means there is no way back.

You can even test this in SE37 execute the function module and you will see that the number range is already updated.

Even when you perform a roll back in your program or don't save the material the number range will be updated.

I hope this is usefull.

Wim

Read only

former_member156446
Active Contributor
0 Kudos
483

I am doubting if we have any option to rollback [Programming Methods with Parameters|http://help.sap.com/saphelp_NW70EHP1/helpdata/en/c5/e4ad64453d11d189430000e829fbbd/content.htm]