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: 

Generic question on PO creation from PR ME_PROCESS_PO_CUST

former_member192429
Active Participant
0 Kudos
224

Hi Experts,

I am sure you can clarify my question in no time. I have been having a generic question on PO creation using ME21N transaction.

What is the best process to enhance PO with custom fields in Customer Tab. Regular process of using Screen enhancement PBO and PAI, ME_PROCESS_PO_CUST POST method works fine when we are in the same transaction. But often I had problems whenever I use Document overview, Switch to Purchase Requisition view and come back, Create a new document with reference, sometimes fields are fetched and sometimes not fetched. Is there a specific place always triggered when a view is switched like changing from PO view to PR, display to change, click on Document overview and select new document.

Question:

  We had a requirement to populate two Requisition Z fields (From separate Z table instead of adding to standard EKKO or EBAN) in Customer Tab of PR and PO. We extended the screens in Customer Tab and populated using user exits and BADIs. PBO has been modified to grey out fields in PR and PO before display. We have used ME_PROCESS_REQ_CUST and ME_PROCESS_PO_CUST OPEN Method to populate Z fields of requisition in Requisition and Purchase order from Header and Items available in this OPEN method. It works fine in ME22N and ME23N transactions.

When a Purchase Order is displayed, Header of Purchase order can be used to get Purchase requisition details in OPEN method. This works. But when we are creating a Purchase order ME21N using reference of Purchase requisition, my code picks PR details which I do not want to display  as it is still creating PO.

We do not want to display two new custom fields in ME21N or ME51N transaction. But the OPEN method still picks PR details when a PO is created with reference using the Drag drop option. If I put check on T-code code does not work if user goes to display PO in ME21N as tcode still shows ME21N.

scenario1: ME23N display PO. OPEN method picks PR from item details of PO and display custom fields in Customer Tab. Works fine.

Scenario2: ME21N create PO without reference. Custom fields not displayed as OPEN method do not find PR in the PO. Works fine.

Scenario3: ME21N create PO with Reference. Custom fields are displayed as OPEN method still picks PR details from Header and item details of PO class. Fails as ME21N should not display these fields.

Scenario4: ME21N Display of PO. Works fine as PR details picked from PO as there is no check on transaction code.

Hope my question is clear. Please share your expert thoughts.

-Kriss.

1 REPLY 1

former_member192429
Active Participant
0 Kudos
122

Hi,

Is the question confusing? Some pointers please guys!!! Thank you!