Application Development 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: 

FD01 FD02 start process after update/commit

Former Member
0 Kudos

Dear All,

Is it possible to run method after complete customer data update/creation (FD02/FD01)

Before commit is simple to find the place where to make modification (e.g. EXIT_SAPMF02D_001),

but after commit is not so obvious, because validations are done in many places so it is difficult to find place where I can check all warnings/errors and after that call method (or not if errors occure).

to summarize: someone is updating/creating customer (FD02/FD01) than in abap we are checking if there is no errors and run method (initiating interface)

Thanks.

Tomasz

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Using PERFORM ON COMMIT or CALL FUNCTION IN BACKGROUND TASK you will "schedule" execution of code in the COMMIT WORK sequence or after, look at those statements' documentation.

Regards,

Raymond

7 REPLIES 7

raymond_giuseppi
Active Contributor
0 Kudos

Using PERFORM ON COMMIT or CALL FUNCTION IN BACKGROUND TASK you will "schedule" execution of code in the COMMIT WORK sequence or after, look at those statements' documentation.

Regards,

Raymond

0 Kudos

Hi Raymond,

Thanks for good hint,

Unfortunately there is few commits during FD01, FD02 processing (I want process after the last one or with the last one, anyway I'm closer to the solution)

Regards,

Tomasz

0 Kudos

Hi

it's not clear what you need to do, if you run your process in UPDATE TASK it will be scheduled in the queue of saving processes, probably it'll be the last fm called.

I don't know if it's you want

0 Kudos

Hi Max,

Thanks,

Yes, I want process my code with last commit or after it.

There are few commits during processing FD01 FD02, but I belive that they are processing during one update task,

I think it will solve my problem, I'll share later how it works

Regards,

Tomek

0 Kudos

Hi

You can try this trick (I think there's a post but I don't rember which is):

A) Create a global class (SE24) having a method (example AFTER_COMMIT) based on the event TRANSACTION_FINISHED of class CL_SYSTEM_TRANSACTION_STATE

B) In the exit of FD01/FD02 raise the method of your class

Your method should be called as soon as the first COMMIT occurs

For example:


set handler ztest_max=>after_commit.

commit work.

In my example I've create the class ZTEST_MAX, the method AFTER_COMMIT will be processed after COMMIT WORK

Max

0 Kudos

Wow,

it sounds really good,

Thank You very much,


Regards,

Tomasz

0 Kudos

The CALL FUNCTION IN BACKGROUND TASK are executed after the end of the update task as you can see in online documentaion of COMMIT WORK statement