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: 

Copy Header Text From PR to PO Issue

Former Member
0 Kudos

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..

6 REPLIES 6

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Abdulaziz,

Thanks for your reply!!.

But they are creating PO from ME21N .Any other suggestion?

Thanks

0 Kudos

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

0 Kudos

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.

0 Kudos

Hi Vipul,

Can you share how you copied the PR text and saved to database.

Regards,

Praveen

Former Member
0 Kudos

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