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: 

run a BDC in Transaction ME21N as soon as the PO is created

Former Member
0 Kudos

Hi All,  I have a requirement to run a BDC in Transaction ME21N as soon as the PO is created but Immediately. I mean whenever a PO is created that BDC should be executed. But the problem is where should i place my code. Options i have already Tried are:

1. User Exits: I placed a Break point in every user exit in the package ME found one user exit after pressing save but the problem is the PO is still being created and tables have not been updated with data relevant to that PO so it gives me an error 'PO does not exist'.

2. BADI: I found 7 BADI's in ME21N. Tried my code in ME_PURCHDOC_POSTED. Same Error. The PO does not exist.

3. Enhancement Points: I have been trying to create an enhancement implementation in includes: LMEGUICJI, LMEGUICJF, LMEGUICJK. The problem i am having when i create implementation it gives me a list of Standard implementations, if i create a new it goes nowhere but that implementation is created but not in the include just in the package. So i used standard available in that we can use only the one's starting with '/' but when i put a break point in it it says Enhancement is switched off. It does not execute that code.

Please tell me if there are any other options available to achieve this functionality.

Thanks & Regards,

Chandni Sharma.

1 ACCEPTED SOLUTION

kesavadas_thekkillath
Active Contributor
0 Kudos

You can also check it with BTE 01000730 ( function - SAMPLE_INTERFACE_01000730 )

5 REPLIES 5

raymond_giuseppi
Active Contributor
0 Kudos

Try to put your code in a RFC enabled FM, in the post-SAVE exit/BAdI call this FM IN BACKGROUND TASK, it will be executed after every updates.

Regards,

Raymond

kesavadas_thekkillath
Active Contributor
0 Kudos

You can also check it with BTE 01000730 ( function - SAMPLE_INTERFACE_01000730 )

0 Kudos

Yes but as this BTE can be executed during update task V1, don't use any commit or call transaction in it in this case, like following sample.

Regards,

Raymond

0 Kudos

But there is a problem with this method, I am not quite sure where this BTE is called, I need it to be called after the complete creation of Purchase Order, I tried with user exit and in that even if I use the DEQUEUE ALL function the PO is not yet created, that's why. So I am trying to trigger a workflow based on the event RELEASESTEPCREATED of business object BUS2012. 

0 Kudos

The suggestion by Raymond is call function with background task. If you call a RFC in this manner in the badi or BTE, then it will work. Read the F1 Help on this statement. It works.