Summary
PO form that is displaying at ECC ME23n transaction level with print preview option should be displayed in SRM system portal level.
Analysis
As it is classical scenario PO details and standard PO form will not be there in SRM. So we have to get the details from backend ECC system.
Displaying PO Form
One way is like fetching all the data that is needed for PO form display and create a custom Adobe form same like ECC PO from in SRM system. Other way is calling the same ECC PO Form from SRM and display.
First way is more complex and need more development objects creation. So second one is good but we should be able to call the PO from and display the same form in SRM.
We can call the PO from in ECC using the generated Function Module for adobe form and that FM will give us PDF raw data. Then you have to get that PDF raw data in SRM and display PDF form.
We are creating Webdynpro Application to display PO form, so using the PDF raw data we can directly display the Adobe form in Webdynpro.
PO Search Screen
We wanted a PO form search screen like the below
So user should be able to search PO’s with all these criteria’s. But we don’t have PO’s available in SRM for all Carts. Because PO will be created in the backend, for some carts PO will be the first follow on document and for some documents PR will be the first follow on document. It depends on Country, so PO will be available in SRM table BBP_PDBEI if PO is the first follow on document. Otherwise PR only will be available.
We have an API to search Shopping Carts with different criteria.
Class: /SAPSRM/CL_PDO_AOMS_SC-> /SAPSRM/IF_PDO_AOMS_SC~SEARCH with this method you can search shopping carts with different criteria’s. With this class you can only search with single range of values. I mean if you wanted to search based on the PO numbers but you can only search 1 PO at one time or you can specify range. But you cannot search based on the different range of PO and different PO numbers at one time.
FM: BBP_BW_SC_SELECT_1 using this FM we can search with same search criteria that class provided with multiple range of values. You can pass every value as range table and based on that you can search. You can even specify OPTIONS (EQ, NE, etc..) and SIGN(Include, Exclude).
Once we get the Shopping cart details you have to get the PO of those carts. So using the BBP_GET_DOC_HISTORY we can get the PO details.
If you don’t want use these APIs then you have to find the database tables to query. But this will be more complex and have to write lot of queries and conditions. Coz you have different search criteria’s and you should be able to write logic to achieve all those.
Search based Shopping cart, Date range, Created by
CRMD_ORDERADM_H - You can read Shopping cart with those criteria directly from this table.
Then read the PO using tables using FM BBP_GET_DOC_HISTORY
Or you can read the PO using the below relationship tables
SRRELROLES
BBP_PDBINREL
Requester Based search
First you have to read the Shopping carts created by this requester, so using the below tables you can read.
CRMD_ORDERADM_H
CRMD_ORDERADM_I
CRMD_LINK
CRMD_PARTNER
BUT000
Then read the PO using tables using FM BBP_GET_DOC_HISTORY
Or you can read the PO using the below relationship tables
SRRELROLES
BBP_PDBINREL
PO number based Search
SRRELROLES
BBP_PDBINREL
CRMD_ORDERADM_H
Development Steps
ECC level Development
Create an RFC function module that calls PO form and send PDF data of form based on the PO number.
Attached file has the logic
SRM Level Development
Webdynpro ABAP Application
Create a webdynpro component and all the sub object as like below screen shot.
Component usage
Create context as like below
Create a selection screen in WDDOINIT method
Attached file has the logic.
Search Button action
Link to Action Download PO
Download Selected PO Button action
same logic like above method
Webynpro Application
Search PO based on the entered Criteria
Central class for different generic and database relate operations methods. Selected methods are related to PO Search. The main method GET_PO_FORM_SEARCH_RESULT that is calling from the Webdynpro Search action and the other methods inside the main method.
Method Signature
Logic attached
Methods which are calling inside the main method to search. logic of these methods are attached
GET_PO_FOR_CARTS - this will search PO for the Carts
SEARCH_CARTS_REQUESTED_BY - This method will search carts based on the Requested by user
SEARCH_CARTS_PR_BASED - This method search carts PR based
SEPERATE_PO_PR - Separate PO based and PR based PO's
SEARCH_CARTS_PO_BASED - Search carts which are PO based
Testing
Integrated webdynpro application with IView.
Carts created by me and click on Purchase order number or select and click on button
PO form will be downloaded