06-25-2014 10:50 AM
Hi experts!!
We have some code placed in EXIT_SAPMM06E_017 within a project. This code reads documents associated to the material in the PO line and writtes ( associates) these documents to the PO line. We wanted this exit to trigger only once when a PO line is completed. It used to trigger just once but now it is being triggered for each change in the PO line. What could be happenning?
Is there another user exit more suitable to transfer material documents to PO line ?
Thanks in advance.
06-26-2014 1:18 PM
Hi Jaione,
Please try to implement BADI : ME_PROCESS_PO_CUST.
In method : PROCESS_ITEM you can set your code in inside method.
Regards,
Prasenjit
06-26-2014 1:27 PM
Customer-exit EXIT_SAPMM06E_017 (good old time) or method PROCESS_ITEM of BAdI ME_PROCESS_PO_CUST (more up-to-date) may and will both be executed multiple times, and always re-executed when some data is changed (SAP did even implement a check to stop recursive call to prohibit infinite loops once a number of call are executed (I forgot the note and the number of execution, but does not matter)
So If you want to process only one, two solutions (depends also on WHAT you intend to do)
NB: But actually, you should also execute your code (and some deletion) when user change the material reference ?
Regards,
Raymond
06-27-2014 11:17 AM
Hi Raymond!!
Thanks for your answer.Actually what I shoud do is:
- Read the material code and write in the PO line all documents linked to this material.
Also, if user decides to make any change, they should free to do it; thus I need to know if user has changed documents assigned to the PO line; in this case I should not transfer any document to the PO line. Is there any way to know that user has changed documents in a PO line?
When you suggest to control if PO line has been already proccessed you write:
How can I declare a variable for each line ?
In which method should I initialize the variable?
Thanks in advance.