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

transaction se37 include any implicit commit work?

Former Member
0 Likes
3,299

Hi guys,

I'm testing bapi_material_savedata in se37. the modification to material will be save into database. The sametime this bapi can be rollback in my testing program.

So I'm wondering does bapi have any commit work inside itself. or se37 has an implicit commit work for this bapi ?

I can share my testing code

*************************************************

DATA: ls_headdata2 TYPE bapimathead.

DATA: ls_plantdata TYPE bapi_marc,

ls_plantdatax TYPE bapi_marcx,

ls_return TYPE bapiret2,

lt_return TYPE bapi_matreturn2 OCCURS 0.

ls_headdata2-material = 'WDAIREZHOU2010691'.

ls_headdata2-sales_view ='X'.

ls_plantdata-plant = 'DCX1'.

ls_plantdata-availcheck = 'KP'.

LS_plantdata-profit_ctr = 'DCX1-1000'.

ls_plantdataX-plant = 'DCX1'.

ls_plantdataX-availcheck = 'X'.

LS_plantdataX-profit_ctr = 'X'.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = ls_headdata2

PLANTDATA = ls_plantdata

PLANTDATAX = ls_plantdatax

IMPORTING

RETURN = ls_return

TABLES

RETURNMESSAGES = lt_return[] .

ROLLBACK WORK.

*************************************************

Any ideas, welcome

thanks,

irene

14 REPLIES 14
Read only

mvoros
Active Contributor
0 Likes
2,758

Hi,

You can call sequence of FMs from SE37. It's under Function module -> Test -> Test sequences. Just call BAPI BAPI_TRANSACTION_COMMIT after your BAPI.

Cheers

Read only

Former Member
0 Likes
2,758

hi matin,

thanks for reply.

Maybe I should give a clearer description of my problem. I think most Bapi doesnot inclue any commit work.

But here in SE37 this bapi_material_savedata will commit modifications to database. I don't know why.

Read only

mvoros
Active Contributor
0 Likes
2,758

Sorry, I haven't read you question carefully. I though that it's a standard question about how to commit data created by BAPI in SE37. You are right. Unfortunately, some BAPIs have COMMIT statement inside. As far as I remember your BAPI is this case. But if you want to be sure you can use new debugger to put break point on every COMMIT statement or use SE30 to get full stack trace.

Cheers

Read only

Former Member
0 Likes
2,758

Hi martin,

Thanks for info.

So if I can rollback this bapi in my test program, does that mean this bapi have no commit work?

Read only

0 Likes
2,758

were you in debug mode? I think being in debug makes implicit commits.

Read only

Former Member
0 Likes
2,758

hI Neil,

No, I'm not in debug mode, I test in se37 and just execute.

Read only

mvoros
Active Contributor
0 Likes
2,758

No, it has. This BAPI performs COMMIT work inside. Usually, you have to call COMMIT after BAPI call but not in this case.

Cheers

Read only

Former Member
0 Likes
2,758

hI Martin,

Here is my confusing point. If this bapi has commit work inside, how I my program rollback its work?

After bapi material creation is done (actually at this point, material cannot be found in MM03, I doubt when does this commit taks effect ?), rollback works and material does not exist.

Read only

mvoros
Active Contributor
0 Likes
2,758

Hi,

it looks like i was wrong. You need to call COMMIT after this BAPI. Have a look at OSS note 545626. It's mentioned to call COMMIT WORK in answer to second question.

Cheers

Read only

Former Member
0 Likes
2,758

Hi,

Try to use the import field 'NO_ROLLBACK_WORK' in this Bapi...

Read only

Former Member
0 Likes
2,758

hi martin,

thanks for this note. If this is true, why the bapi can be committed in SE37. I'm still confused. Looks like no documentation helpful.

Read only

mvoros
Active Contributor
0 Likes
2,758

Good question. I know that for other BAPIs such as BAPI_PO_CREATE1 you need to test sequence in SE37 to commit data to DB. It looks like this BAPI is different. Definitely, it does not allow you to run in test mode. I can't find any documentation or OSS note related to your issue. You could try to use SE30 to see if there is any COMMIT statement.

Cheers

Read only

0 Likes
2,758

Hi,

I think that since LUW ends when the transaction SE37 ends, the commit work is triggerred.

Hope this helps.

Read only

Manohar2u
Active Contributor
0 Likes
2,758

Right - this bapi has no option to run in test mode - it calls MATERIAL_MAINTAIN_DARK in real mode (KZ_TEST as space) - could be as this is for mass execution - Not sure !!.

May be you could use BAPI_MATERIAL_SAVEREPLICA instead which has the test run option.