02-25-2015 9:26 AM
Hello All,
I had a requirement to copy header text from PR to PO..I used a customer exit (MM06E005-EXIT_SAPMM06E_012) and achieved it.
Now there is an additional requirement that while creating PO from PR if the user want a new header text and write a new header text in PO then it should not trigger that enhancement(exit) i.e it should not copy header text from PR in this case.
Currently it is copying text from PR to PO no matter there is new text in PO or not.
How to achieve this?
Please help me out.
Thanks in Advance..
02-25-2015 12:56 PM
PR to PO is generated using ME59 or ME59n.
Put a check in your code on these two TCodes to avoid getting hit by other transactions.. like ME22n (where the user is changing the text).
IF SY-TCODE = 'ME59'
OR SY-TCODE = 'ME59N'.
*your existing copy header code goes here
ENDIF.
Cheers
02-26-2015 4:20 PM
Hi Abdulaziz,
Thanks for your reply!!.
But they are creating PO from ME21N .Any other suggestion?
Thanks
02-26-2015 5:07 PM
Hi Vipul,
Is the text is being transferred using ME21n too ? Please let me know the details...
If you are writing your custom coding in ZXM06U43 then you have to more specifically control the CALL FUNCTION 'READ_TEXT' and CALL FUNCTION 'SAVE_TEXT' . Please let me know if you any confusion.
Regards
Saifur Rahaman
02-26-2015 9:51 PM
In case they are using only ME21n, then just put a check as below.
IF PO header text IS INITIAL.
*copy PR text to PO.
ELSE. "indicates user has entered text. (Need not put ELSE part actually; it's for your understanding)
*do nothing
ENDIF.
Cheers.
05-04-2022 6:53 AM
Hi Vipul,
Can you share how you copied the PR text and saved to database.
Regards,
Praveen
02-26-2015 4:52 PM
So, is this is what is happening now?
The user starts to create the PO and the PR text is copied over. When he or she changes the text and presses enter, the PR text is copied back again?
Rob