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: 

How to know activity mode in an implemented BAdI in PR creation

0 Kudos

Hi gurus,

In the implemented BAdI, I would like to know the activity mode.

BAdI: ME_PROCESS_REQ_CUST

Method: IF_EX_ME_PROCESS_REQ_CUST~PROCESS_ITEM

But I cannot find T180-TRTYP in the implementation point.

Is there any other way I can check the activity mode (creation/change/display)?

I need to check the activity mode to handle if I can proceed with the add-on logic or not.

Your feedback would be greatly appreciated.

Best Regards,

Mari

1 ACCEPTED SOLUTION

tomas_talpa
Active Contributor
0 Kudos

Hello Mari,

not direct answer, workaround rather: out of the "creation/change/display" activities:

-- "display" is easy, as method ~PROCESS_ITEM is not executed in display;

-- "creation/change" can be distinguished by comparison of item data with DB data; so either use method IF_PURCHASE_REQUISITION_ITEM~GET_PERSISTENT_DATA or simply check the db table EBAN; if the item is db persistent, than it must be "change", otherwise it must be "creation";

Kind Regards

TomT

3 REPLIES 3

tomas_talpa
Active Contributor
0 Kudos

Hello Mari,

not direct answer, workaround rather: out of the "creation/change/display" activities:

-- "display" is easy, as method ~PROCESS_ITEM is not executed in display;

-- "creation/change" can be distinguished by comparison of item data with DB data; so either use method IF_PURCHASE_REQUISITION_ITEM~GET_PERSISTENT_DATA or simply check the db table EBAN; if the item is db persistent, than it must be "change", otherwise it must be "creation";

Kind Regards

TomT

0 Kudos

Hi Tom,

Thanks a lot for your feedback.

We've tested your solution and it seemed OK, but actually we came up with another solution.

There is IM_TRTYP in method ~OPEN, and we can pass it to memory ID then read it in ~PROCESS.

Thanks anyway for your help.

Best Regards,

Mari

0 Kudos

Oh, true, that's more elegant & easier approach. Thank you, Mari.

TomT