The purpose of this enhancement is to allow the buyer to select multiple Vendor contacts in Purchase Order so that the PO output is sent automatically to the selected contact(s) e-mail addresses.
When the Buyer creates or updates a Purchase Order (PO) in SRM from portal, we can send email to a single contact person only. So, this enhancement provides the ability to select multiple Vendor Contacts for the Vendor so that the Purchase Order will be sent to the vendor and processed in a timely manner.
PO screen before enhancement:
Here we can only give one email address for which the PO output will be sent.
1. The screen enhancement is done in the standard Web dynpro Component ‘/SAPSRM/WDC_UI_DO_OUTPUT’ in the view ‘V_DO_OUTPUT_PARAM’. Here we need to insert a table to display all the vendor contacts details required and a ‘SAVE’ button. The table is visible only when Email radio button is checked and is otherwise hidden.
PO screen after enhancement:
When the output medium selected is ‘Printer’:
When the output medium selected is ‘Email’:
2. In ‘WDDOMODIFYVIEW~Post-Exit’ method of the view ‘V_DO_OUTPUT_PARAM’:
Get the vendor number from GUID using FM ‘BBP_PD_PO_GETDETAIL’. Use the Function module ‘BUPA_RELATIONSHIPS_READ’ to get list of vendor contacts. Then use FM ‘BUPR_CONTP_ADDR_READ_DETAIL’ and tables ‘BUT000’ to get the vendor contacts details. Bind values to the appropriate context tables.
The data is displayed in the table as below:
We can select multiple contacts, to send PO output by checking the check boxes for required vendor contacts.
3. For the ‘SAVE’ button in the screen, create an action and in that event handler method, use the below logic to save data in custom table:
Get the value of vendor number from GUID using FM ‘BBP_PD_PO_GETDETAIL’. Move the contents of records into two internal tables based on whether the checkbox is checked or not. Update the custom database table with values of records whose checkbox has been checked. Delete the other records from database table.
4. Now we need to create an implicit enhancement in the class ‘CL_PD_PO_PROCESSING_BBP’ => method ‘PROCESS_BBP_PO_MAI’ to send email notifications to the selected vendor contacts.
- Get the records of selected vendor contacts from custom database table into an internal table.
- Use the same code as given in the standard method for creating message and sending email by changing the email addresses to the values in the internal table.
The output can be checked in SOST (T. Code) as below:
So, emails will be sent to the respective vendor contacts selected during PO creation, by the Buyer. Also, the redundancy of sending emails to multiple persons, one at a time, is reduced.