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

Commit work is rolling back changes

Former Member
0 Likes
1,504

I am in enhancement MM06E005 function exit EXIT_SAPMM06E_013. Here I am trying to update the route in shipping data for PO. After looking into many options, we decided to update the database table EKPV. So I have some logic to populate work area wa_ptv and then

        MODIFY ekpv  FROM wa_ptv.            "Modify database table with route and shipping point
        commit work and wait.

When in debug, the MODIFY statement changes the route and shipping point in database table EKPV but when the COMMIT WORK is executed, the changes are reversed.

Now if I were to run the scenario for the same PO again, this time the MODIFY changes the route and shipping point and the COMMIT WORK does not roll back the changes. I cannot remove the commit work from there as after exiting the user exit, there is a commit work in the SAP std program and that commit work then rolls back the changes. Please advise. Thank you.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,125

There is no user exit which contains an xekpv structure. I have looked into all those exits. this is the only user exit that gives me access to the shipping data ekpv. I have to MODIFY EKPV in this user exit. I am looking for a solution that works consistently. This modify does not work when I save ME22N the first time. The second time it works. Could it be a config issue? Perhaps it has something in memory?

5 REPLIES 5
Read only

Former Member
0 Likes
1,125

Hi,

the below are the list of user exits avaliable for that standard program SAPMM06E,

go throught the each exit and find the appropriate exit which is triggering while pressing the SAVE buttion there you have to change these values in the structure *EKPV then the system will automatically take care of saving and all.

as per my knowledge don't update the standard table directly, which will create lot of inconsistencies in real time.

AMPL0001

LMEDR001

LMEKO001

LMEKO002

LMELA002

LMELA010

LMEQR001

LMEXF001

LWSUS001

M06B0001

M06B0002

M06B0003

M06B0004

M06B0005

M06E0004

M06E0005

ME590001

MEETA001

MEFLD004

MELAB001

MEQUERY1

MEVME001

MM06E001

MM06E003

MM06E004

MM06E005

MM06E007

MM06E008

MM06E009

MM06E010

MM06E011

MMAL0001

MMAL0002

MMAL0003

MMAL0004

MMDA0001

MMFAB001

MRFLB001

Reward if useful.

Thanks,

Sreeram.

Read only

Former Member
0 Likes
1,125

Megan Flores You are not supposed to use COMMIT WORK in enhancements.

remove that ASAP.

Read only

Former Member
0 Likes
1,126

There is no user exit which contains an xekpv structure. I have looked into all those exits. this is the only user exit that gives me access to the shipping data ekpv. I have to MODIFY EKPV in this user exit. I am looking for a solution that works consistently. This modify does not work when I save ME22N the first time. The second time it works. Could it be a config issue? Perhaps it has something in memory?

Read only

0 Likes
1,125

Try to check out if in the module pool there aren't PERFORMs ON-COMMIT, that will be triggered at every commit work (maybe this can "rollback" your changes).

Anyway, you really should not use the commit during a user-exit flow...

Check out this: MM06EF0B_BUCHEN

There are two FM, called in "IN UPDATE TASK". So, they're triggered at every commit work.

Remember that in the user-exit you are developing, you're working with copy of real data (the program pass to you a table lt_usr_ekpv, that is a copy of his ptv) and does not modify real data with your modifies.

So, when ME_CREATE_DOCUMENT and ME_UPDATE_DOCUMENT are called, the program sets-up his own ptv overwriting yours.

Hope this helps you,

Roby.

Message was edited by:

Roberto Pagni

Read only

Former Member
0 Likes
1,125

Roberto,

Your reply helped a lot. I am looking to change ROUTE on PTV structure in my user exit. It is part of FM ME_UPDATE_DOCUMENT and ME_CREATE_DOCUMENT which are been called IN UPDATE TASK.

The first time when I create the PO, ME_CREATE_DOCUMENT is triggered with PTV not containing the route. Then I go into change mode, make changes to shipping data, the PTV route comes in as blank for ME_UPDATE_DOCUMENT, then it hits my user exit where the route is computed and PTV changed using field symbols and EKPV updated. Then it hits a commit work, which executes FM and rollsback PTV changes.

Then second time I make changes to PO and save, it hits ME_UPDATE_DOCUMENT with PTV route filled with computed value and updates EKPV. Seems like may be I am changing PTV a little too late. Is there a user exit before ME_UPDATE_DOCUMENT that I can change PTV. Thank you for your assitance.