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

Run BAPI_MATERIAL_SAVEDATA in Test Mode

Former Member
0 Likes
5,530

Hi ABAPers,

I am trying to run BAPI_MATERIAL_SAVEDATA. When I run, the details are being changed without using 'COMMIT WORK'.

However, if I use ROLLBACK WORK before the end of the program, the database table does not get updated.

Is there any other way I can run BAPI_MATERIAL_SAVEDATA in test mode without updating the Database table?

Help is highly appreciated.

Thanks!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,970

hi,

There is no option for test mode present in the BAPI unfortunately.

Thanks

Nayan

Hi ABAPers,

I am trying to run BAPI_MATERIAL_SAVEDATA. When I run, the details are being changed without using 'COMMIT WORK'.

However, if I use ROLLBACK WORK before the end of the program, the database table does not get updated.

Is there any other way I can run BAPI_MATERIAL_SAVEDATA in test mode without updating the Database table?

Help is highly appreciated.

Thanks!

7 REPLIES 7
Read only

Former Member
0 Likes
2,970

dont use BAPI_COMMIT_WORK or COMMIT Statement.

then it will not update the database.

Edited by: swarup basagare on Jun 24, 2008 1:55 PM

Read only

Former Member
0 Likes
2,970

Use BAPI_MATERIAL_SAVEREPLICA with TESTRUN = 'X'

Reward point if helpful

Read only

Former Member
0 Likes
2,971

hi,

There is no option for test mode present in the BAPI unfortunately.

Thanks

Nayan

Read only

Former Member
0 Likes
2,970

Hello,

Only some FI transactions can be run in Test mode.Most of the BAPIs are not having this test mode

Edited by: BVS on Jun 24, 2008 2:04 PM

Read only

Former Member
0 Likes
2,970

Do not call bapi commit function module in test moode, instead call bapi rollback FM, after u call the material save data bapi

*(or) *

I understand that you are using the BAPI, but if you were to use LSMW direct input program instead, you would be able to run in TST mode, and make sure that all of the errors are taken care of before you actually update the system.

*******************Reward points,if found useful

Read only

vinod_vemuru2
Active Contributor
0 Likes
2,970

Hi,

As far as my knowledge none of the BAPI will do commit work on its own. With out calling FM BAPI_TRANSACTION_COMMIT/COMMIT WORK statement database will not be updated. Please check it once again.

For your case u may call FM BAPI_MATERIAL_DELETE for flaging the material for deletion so that u can't use it any more. U can set the deletion flag even in MM01.

MM01->Menu->Material->Flag for deletion->Immediately.

Thanks,

Vinod.

Read only

2,970

Hi,

Try in a dev environment, after your bapi_material_savedata, to do something like this :


if p_text eq 'X'.
BAPI_TRANSACTION_ROLLBACK
endif.

Hope this helps,

Erwan