2022 Dec 01 11:01 AM
Hi all.
In transaction code CJ20N, I enter a project and some wbs elements then click SAVE button. In background process of SAVE event, after COMMIT data was stored in table PROJ, PRPS... At this time, I want enhance SAVE event to call add-on program that store log data in add-on table and return CJ20N finally. I've already used badi WORKBREAKDOWN_UPDATE and PROJECTDEF_UPDATE to enhance CJ20N but when add-on program called, registered data wasn't store in table PROJ... so I cann't get data in table PROJ, PRPS.
Is there another badi or exit support resolve it?
Best regards,
Leo Vu
2022 Dec 01 11:24 AM
Hello quy_vungoc87
Wrap up your custom functionality in an RFC-enabled function module. Then call the function from the BAdI implementation with
CALL FUNCTION func IN BACKGROUND TASK AS SEPARATE UNIT
This way the function will be called in a separate LUW (logical unit of work) and the project changes will be already committed to the database.
See SAP Help on CALL FUNCTION AS SEPARATE UNIT
Best regards
Dominik Tylczynski
2022 Dec 01 11:24 AM
Hello quy_vungoc87
Wrap up your custom functionality in an RFC-enabled function module. Then call the function from the BAdI implementation with
CALL FUNCTION func IN BACKGROUND TASK AS SEPARATE UNIT
This way the function will be called in a separate LUW (logical unit of work) and the project changes will be already committed to the database.
See SAP Help on CALL FUNCTION AS SEPARATE UNIT
Best regards
Dominik Tylczynski
2022 Dec 02 3:34 AM
Hi Dominik,
Thanks for your advice. But my customer is want to call IF program instead of using function module. Badi/exit doesn't support doing that, does it?
Best regards,
2022 Dec 02 7:32 AM
Hello quy_vungoc87
I'm sure if I understand what you mean by "IF program". A BAdI enhancement is implemented with a custom ABAP class. You can easily call a custom function module using "AS SEPARATE UNIT" addition from the BAdI implementation i.e. the custom ABAP class. Please share the details if you are still in doubt.
2022 Dec 03 3:49 AM
Hi Dominik,
I sincerely apologize for misunderstanding your suggestion. It's working now.2022 Dec 03 9:56 AM
Hello Dominik,
Because, my customer only want to call executed program directly instead of creating a new RFC then call program in this. Is there any another solution instead of using RFC to take it? Could you give me some advice?
Best regards,
Leo Vu
2022 Dec 05 7:40 AM
quy_vungoc87 I understand what the customer wants. But you can either call the program directly from the BAdI implementation but at that time the updates are not committed yet or use a simple RFC function wrapper to call the program in separate LUW after the updates are committed. There is no way to call the report directly with the BAdIs only after the changes are committed.
2022 Dec 05 9:15 AM
2022 Dec 01 4:27 PM
Hi, one way is searching regarding SAP transaction SMOD/CMOD.
2022 Dec 02 3:36 AM
Hi Roberto,
I cann't find any exist to do that so can you give me some advice?
Best regards
2022 Dec 02 1:57 PM
Hi, another way is searching by ABAP Workbench regarding transaction CJ20N package.