‎2014 Jul 23 12:17 PM
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
‎2014 Jul 23 3:54 PM
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
‎2014 Jul 23 3:54 PM
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
‎2014 Jul 23 4:04 PM
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
‎2014 Jul 23 4:15 PM
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
‎2014 Jul 23 4:24 PM
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
‎2014 Jul 23 4:44 PM
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
‎2014 Jul 23 4:55 PM
‎2014 Jul 24 8:26 AM