
In my first blog - http://scn.sap.com/community/srm/blog/2016/01/25/ecc-pr-to-srm-sc-flow-in-pdp-scenario-a-technical-perspective , have explained some basic technical details of ECC PR to SRM SC flow in general, so in this blog, am sharing a general implementation GAP in all ECC to SRM PDP Scenario during ECC PR to SRM SC conversion .
Scenario: In ECC user will create the Purchaser Requisition and transfer the requirement to SRM Shopping Cart as a part of Plant Driven Procurement.
Challenge / GAP : When the “Shopping Cart” get created in SRM from the ECC Purchase Requisition via SAP PI / EOSA, then the Shopping Cart requester name will be the “PI background user” instead of the ECC PR requester.
This behavior is the SAP standard in ECC to SRM flow. To correct this we have couple of methods as below.
If we use the 1st method, where calling the ECC PR details from SRM system via RFC/ BAPI post SC creation and updating the “Requester Name” using the custom field is a time consuming and performance hit, so in this blog, am going to share my knowledge on the 2nd method, where we will change the “Requester Name” during ECC PR to SRM SC transfer only, which we have implemented successfully.
Details in ECC side.
PI message used in ECC: PurchaseRequestERPSourcingRequest_Out.
SAP has provided a filed “REQUESTER_PERSON_NAME “which will be in the ITEM level of PI Message “PurchaseRequestERPSourcingRequest_Out”. By default this field will be empty, i.e. means SAP will not fill this field with any value in standard flow, but we can use this field to fill up the “Requester Name “as per our requirement (Ex: we can fill the EBAN-ERNUM) by leveraging the BADI PUR_SE_PRERPSOURCINGRQCO_ASYN in ECC.
Below are the details of the Enhancement Spot and BADI.
Enhancement Spot : PUR_SPOT_SE_PURCHASE_REQUEST
BADI Definition Name : PUR_SE_PRERPSOURCINGRQCO_ASYN
Method : OUTBOUND_PROCESSING
Mapping Parameter : “REQUESTER_PERSON_NAME” in the ITEM of “CH_PR_PROXY”, the Value will be EBAN-ERNUM (it will be different as per the
requirement).
Below is the snapshot of BADI details.
We have to change the value in the “Changing Parameter – CS_PR_PROXY’.
The “Requester name” will be passed to the “REQUESTER_PERSON_NAME” which is shown in the below screen.
This is the change required at ECC side and no changes at PI system as we are using SAP standard PI field for transfer.
Changes at SRM Side
PI message used in SRM: PurchaseRequestERPSourcingRequest_In.
Even though we are mapping the “Requester Name” to SAP standard field, SRM system will not consider this during Shopping Cart creation, this is because of SRM system is fetching the Requester Name , from “USER Context “, as a result of which the "SC Requester" will be “PI Background User” instead of “Requester Name” which we sent from ECC.
So to achieve our functionality, we have updated the “Requester Name” which we are passed from ECC to User Context by leveraging the BADI “/SAPSRM/BD_SOA_MAPPING “.
Below are the details of the Enhancement Spot and BADI.
Enhancement Spot : /SAPSRM/ES_SOA_MAPPING
BADI Definition Name : /SAPSRM/BD_SOA_MAPPING
Method : MAP_XI_TO_BACKEND
Filter Values : BO_TYPE = ‘BUS2121’ (Shopping Cart) & SET_TYPE = ‘06’ (Item).
Below is the snapshot of BADI details.
Below is the snapshot of parameter “IR_MSG_INTF_DATA “of the method “MAP_XI_TO_BACKEND” which holds the “ECC Requester Name”.
Below is the snapshot of structure “/SAPSRM/PUR_REQ_ERPSRCG_REQ_I1”, which is populated during runtime.
In the implementation of above BADI method - MAP_XI_TO_BACKEND, we have to perform below steps.
a) Extract the “Requester Name” which was passed from ECC he “IR_MSG_INTF_DATA” parameter.
b) Fetch the Partner GUID number of the Requester using the FM “BBP_CENTRALPERSON_GET” by passing “Requester ID “.
Note: Please note, that, method “/SAPSRM/IF_PDO_US_CONTEXT_PROV~SET_DEF_REQUESTER” to update the “Default Requester” to user context will take the “Business Partner” as the Importing parameter, instead of user id , because of which before updating, we have to convert the “ Requester User id” to corresponding BP Number ( Business Partner) .
c) Fetch the BP number using the FM BUP_BUT000_SELECT_WITH_GUID by passing the Partner GUID.
d) Now fetch the reference of “User Context” using the method "/SAPSRM/CL_PDO_FACTORY_USER=>GET_BUFFERED_USER_CONTEXT".
e) Update the “Requester” to the user context using the method /SAPSRM/IF_PDO_US_CONTEXT_PROV~SET_DEF_REQUESTER by passing the “Requester
BP number”.
By this time ,ECC PR "Requester Name" will be set in the “User Context”, which will be taken from SRM system as Shopping Cart " Requester" instead “PI Background "user.
Once all the development is completed, create the SC from ECC PR and check the “Requester name” in the SOCO, it will be the requester from ECC.
By this information , am ending this blog . Please note that above solution , which I have found during analysis myself , there may be better solution than this to achieve the same with more efficiently , if you have such a solution , kindly share the same .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.