6

S/4HANA – OPD – Procedure creation and consumption

 2 years ago
source link: https://blogs.sap.com/2022/03/23/s-4hana-opd-procedure-creation-and-consumption/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
March 23, 2022 3 minute read

S/4HANA – OPD – Procedure creation and consumption

Hello fellow community members,

In this blog I would like to share my experience on the creation as well as consumption of a procedure call in BRF+ which is used by the OPD transaction.

A little background, OPD is the newer equivalent of NACE in S/4HANA used for configuring and issuing outputs. NACE is used in ECC to configure output controls and map forms with driver programs and trigger the output.

Back to the topic – Here, I will give an illustrative document on how to create procedures and use them. As an example I have done this on Central Purchase Contracts business object available in the Central Procurement solution –

The steps will be divided as below –
A. Creation of Element and Procedure
B. Creation of application logic
C. Embedding the created procedure in the OPD transaction

In Detail,

A. Creation of Element and Procedure

1. Open BRF+ transaction in SAP GUI.
URL will look like – https:///sap/bc/webdynpro/sap/fdt_wd_workbench?sap-language=EN&sap-client=<3 digit client id>#

2. Put application – OPD_MM_CENTRAL_CONTRACT and search

1-22.jpg

3. Creation of Element

2-22.jpg

3-15.jpg

-> This creates an element.

4. Creation of Procedure

4-13.jpg

5-15.jpg

-> This creates a procedure and also assigns the above created element as the result data object.

B. Creation of application logic

1. Creation of class and static method

6-9.jpg

7-4.jpg

-> This creates the placeholder for the application logic

2. Map the parameters which will be used in application logic

8-3.jpg

9-3.jpg

10-4.jpg

11-3.jpg

12-3.jpg

13-3.jpg

14-2.jpg

-> Newly added parameters are mapped.

15-2.jpg

-> Upon activation, message is displayed.

C. Embedding the created procedure in the OPD transaction

1. Launch the OPD transaction in SAP GUI

2. Choose the business object as ‘Central Purchase Contract’ and the determination step as ‘Output Type’

3. Go to Edit – Table Settings – Pull the custom expression which was created above and maintain values in same.

16-2.jpg

Finally, to conclude – the issued outputs will look like rows in below table in Manage Central Purchase Contracts app –

17-2.jpg

Tips for working with expressions –

1. A ‘blank’ is different from a ‘false’ in the decision tables.
2. If values are not maintained (left as ‘blank’) then the expression class is not called, and the static method is not invoked.

Other Tips –

1. The Function Module – CNTRL_CONTRACT_OM_TRIGGER gets triggered for Central Purchase contracts for issuing output. It can be debugged for any behaviour conceptualization.
2. Always put an external breakpoint on SAP_WFRT (Workflow User) and analyse.

To further ignite the passion, I would like to highlight few practical use cases – this approach can be used to dynamically control output issuance like issue output only if Distribution Lines in a Contract are active, send emails to different recipients based on priority, etc.

Please provide your valuable feedback.

Thanks.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK