Navigation from SAP S/4 HANA to SAP ECC 6.0 to view the replicated Purchase order and Purchase Requisition
Recently I had published an blog post of Navigation from S/4 HANA Sales order screen to display a sales order that got replicated in the legacy ECC system using a RFC – single sign on. This current article is a second in similar series with respect to Purchase order (ME23N) and Purchase requisition (ME53N).
Below are the step by step procedure I developed to incorporate the navigation from S/4 HANA Purchase order screen to SAP ECC 6.0 Purchase Order.
Adding the custom button in application toolbar of ME23N and ME53N we go to MEGUI Function group and in this we have ‘NORMAL_EXT’ and ‘NORMAL’ GUI statuses. here you can add a new button ZPOP – For the Purchase Order
In change mode you can use the modification overview and edit the standard User Status interface by adding the ZPOP button by clicking the highlighted icons above.
- For Purchase requisition we use ‘REQ’ GUI Status for the purchase requisition.
- Here the following logic will help us to take it to legacy ECC Purchase order display or Purchase requistion display.
- In include “LMEGUICJL” – created an explicit enhancement where the logic to select the sy-ucomm or the function code that is selected. This is common for both PO and PR.
- Purchase Order or Purchase Requisition numbers is fetched by the following lines and it can be used for further processing
L_TRANSACTION = L_APPL->MY_TRMGR->GET_CURRENT( ). READ TABLE
L_TRANSACTION->MY_DATA ASSIGNING <FS_DOCUMENT> INDEX 1.
- Get RFC destination based on output type determination from NAST for Purchase order only.
- Check if RFC exists in RFCDEST table
- Check if RFC ping is successful using Function Module ‘CAT_CHECK_RFC_DESTINATION’
- We added a new RFC desctination which has a generic user ID with only display access in destination box (RFC cient). This is done to avoid any risk of users making changes in RFC if not taken care.. This would be serious audit issue and high risk. This can also be accomplished by allowing current user in RFC trusted connections.
- To enable RFC trusted connection you need to establish the trusted connection at the target system using ‘SMT1’ transaction
- Check if PO exists using BAPI ” BAPI_PO_GETDETAIL” using RFC DESTINATION for Purchase Requisition we use ‘BAPI_REQUISITION_GETDETAIL’
- If exists then call the Custom FM using BDC of ME23N and pass that to the function module ‘RFC_CALL_TRANSACTION_USING’ STARTING NEW TASK ‘UPDATE’ DESTINATION RFCDEST.
- Now you can view the legacy PO or PR in the destination if exist or you will be a message saying the document does not exists
- Below is the PO in display mode in destination system ECC.
Conclusion: In this way by following the above steps and tequinues we can navigate from S/4 HANA to Legacy SAP ECC box for Purchase Order or Purchase requisition by using the same enhancement spot explicitly and we can write our own custom business logic as needed in the above module for further processing.
Thank you for taking time to read this blog post, pls let me know if there were any other better options of doing this. I would also like to thank my employer and customer in for providing this opportunity.
Screenshots courtesy: All images are the screen shot of the system from my customer system, I have notified my customer manager about it and all client sensitive items are greyed out.
Have a blessed day.