09-04-2013 7:22 AM
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.
09-04-2013 8:00 AM
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.
09-04-2013 8:00 AM
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.
09-04-2013 9:06 AM
Ok thank you. But my my main problem is that I can`t post a message in ME_PURCHDOC_POSTED. Is it not possible?
09-04-2013 9:22 AM
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