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: 

BADI ME_PURCHDOC_POSTED or ME_PROCESS_PO_CUST

Former Member
0 Kudos

Hello,

I want to do an insert in a Z-table after saving the PO.

I think the correct position of the implementation of the insert would be: BADI ME_PURCHDOC_POSTED, Method POSTED.

I have implemented the coding and it works (the insert in the z-table).

But I have one problem: I also want to show a message, when there are problems by Enqueue / Dequeue (if anybody uses Sm30 of this table):

      MESSAGE e250 WITH enqkey space sy-msgv3 space.

I get an error:missing message-ID.


I think it isn`t allowed to post an message in
BADI  ME_PURCHDOC_POSTED, isn`t it?

Should I use BADI  ME_PROCESS_PO_CUST, method PROCESS_ITEM?

There I have a problem: The PO isn`t created here yet. Do I have to Enqueue the table in ME_PROCESS_PO_CUST and Dequeue in ME_PURCHDOC_POSTED after insert here?

I hope anybody can help me.

Thank you very much.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I dont know if the logic suits your requirement, but u can try it.

Please create a custom FM which can run in update task. Please write your code for updating the z table in this FM.  Call this FM in ME_PURCHDOC_POSTED. In this FM, you can wait for the table enqueue/dequeue. For error handling, you can trigger some external mails/ workflow/ sap inbox messages.

3 REPLIES 3

Former Member
0 Kudos

I dont know if the logic suits your requirement, but u can try it.

Please create a custom FM which can run in update task. Please write your code for updating the z table in this FM.  Call this FM in ME_PURCHDOC_POSTED. In this FM, you can wait for the table enqueue/dequeue. For error handling, you can trigger some external mails/ workflow/ sap inbox messages.

0 Kudos

Ok thank you. But my my main problem is that I can`t post a message in ME_PURCHDOC_POSTED. Is it not possible?

0 Kudos

Hi Kevin,

As you said, you can Enqueue the table in ME_PROCESS_PO_CUST and Dequeue in ME_PURCHDOC_POSTED after insert here.

Still if you want to show some error(insert failed) here, u cant show it in ME_PURCHDOC_POSTED.

(SAP doesn't allow this bcoz it can lead to data inconsistency).

Even I am not sure of any better solutions other than these...Kindly share if you find any.

Br,

Maju