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: 

What is badi/exit enhance CJ20N after commit data in background processing of save event?

QuyVu
Participant

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

1 ACCEPTED SOLUTION

DominikTylczyn
Active Contributor
0 Kudos

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

10 REPLIES 10

DominikTylczyn
Active Contributor
0 Kudos

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

0 Kudos

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,

Leo Vu

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.

Hi Dominik,

I sincerely apologize for misunderstanding your suggestion. It's working now.
Thank you so much!

0 Kudos

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

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.

0 Kudos

Thanks for your continued support.

Best regards,
Leo Vu

roberto_forti
Contributor
0 Kudos

Hi, one way is searching regarding SAP transaction SMOD/CMOD.

0 Kudos

Hi Roberto,
I cann't find any exist to do that so can you give me some advice?
Best regards

Leo Vu

Hi, another way is searching by ABAP Workbench regarding transaction CJ20N package.