Monday 21 January 2019

Creating Custom Output Type for Sales Scheduling Agreement in BRF+

Introduction


Business Rules Framework Plus (BRF+) is a Business rules System which is developed in ABAP by SAP. It is a part of SAP NetWeaver 7.0 EHP2 and hence requires no additional SAP License. It provides seamless user experience with features like simulation, transport, XML export or import.

It also supports output determination for printing of forms in SAP at more granular level than it is in NACE. It uses rule sets and decision tables to provide clear cut, transparent business rules and business decisions. BRF+ thus helps organizations to run business smoother, improve efficieny and lower TCO.

The major benefits of BRF+ can be listed as below :

1. The creation of rules, function or decisions table does not require any ABAP or any other coding. So minor adjustments can be made by business user who need not be an expert.

2. The rules that we create or the decison tables or templates are transportable and also can be easily imported or exported as XML files.

3. It contains vast library of ready-made expressions which helps to create the business rules and business decisions faster and also to simplify them. This also ensures the consistency by reducing redundancy.

4. As mentioned earlier, it is pre-delivered and shipped with SAP NetWeaver 7.0 EhP2 (and above) and hence no separate cost for licensing.

Business Case


There are standard ‘Output Types’ provided by SAP for each ‘Application Object Type’ (Business Object). Presently, under the Application Object Type ‘Sales Order’, following output types are provided by standard SAP.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

The business requirement is to create custom ‘Output Type’ for ‘Sales Scheduling Agreement’ and configure an adobe form template in BRF+. So, every time a scheduling agreement is created, the adobe form should get automatically assigned to it. Let’s get started.

Pre-requisites


◈ BRF+ Application is fully configured with the XML files uploaded for output determination as per OSS Note-2248229
◈ Adobe Document Server (ADS) server is up and running


The SAP Logon version is 750 and theme is ‘Blue Crystal Theme’.

Steps


1. Go to Transaction code ‘SPRO’. Click on button ‘SAP Reference IMG’. Navigate to ‘Cross-Application Components->Output Control’.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

2. Choose ‘Define Output Types’. If you get pop up informing that ‘The table is cross client’, click on continue.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

Select any row for Application Object Type ‘SALES_DOCUMENT’ and click ‘Copy As’.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

Keep the ‘Appl. Object Type’ and ‘Callback Class’ unchanged. Provide the name for output type as ‘SCHEDULING_AGREEMENT’ and a description of your choice. Press Enter.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

A warning message will be displayed stating ‘Choose the key from the allowed namespace’. Press enter to move to the next screen.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

The entry is copied, click on ‘Save’ to commit. You will be prompted to choose a transport request.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

4. Now, we have to assign the output channels that is the ways we want the form output to be. e.g, print, email.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

Select any row under application object type ‘SALES_DOCUMENT’ and click ‘Copy As’.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

Keep the Application object type as ‘SALES_DOCUMENT’ and for the output type, we can directly enter or choose from the drop-down.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

Provide the channel as ‘PRINT’. Copy and save. We can also add another for ‘EMAIL’ as output channel, if required.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

5. Next step is to assign form template. In this step, we shall assign the z-form to the newly created output type. Select ‘Assign Form Templates’.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

Copy any existing entry for appl. object type ‘SALES_DOCUMENT’.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

Provide (or choose from the drop down) the output type ‘SCHEDULING_AGREEMENT’. Select the form type as ’2-PDF-Based Print form (Legacy)’. Enter the z-form name, print program name and form routine name as shown. Here, in our case, it is adobe form.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

6. Next we shall proceed to define business rules and population decision tables for output determination.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

Define Business Rules and Maintain Decision Table


In this step, choose ‘Define Business Rules for Output Determination’. A browser window will open. Select ‘Sales Document’ from the drop down. The drop-down entries are only after uploading the XML templates as per OSS Note# 2248229.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

We have to set the rules for the determination steps applicable to our business. Some of the steps are mandatory for the correct output determination. Let’s go one by one. Select ‘Output Type’ from the drop-down.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

Click on the ‘EDIT’ button.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

Select ‘Insert New Row’.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

Choose the ‘Document Category’ = ‘E’ for scheduling agreement. This can be found in VBAK table. Maintain output type as ‘SCHEDULING_AGREEMENT’. For ease, just copy the last row, paste and make the desired changes.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

7. Next step is maintaining the receiver. This step is optional. Choose ‘Receiver’ from the drop-down in the ‘Determination Steps’.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

In the ‘Maintain Business Rules’ table, repeat the steps for ‘EDIT’ and add new row. Then, maintain the appropriate ‘Role’ for our output type ‘SCHEDULING_AGREEMENT’.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

8. In the next step, we shall maintain the output channel i.e. the output can be printed using a printer or sent via email.

This is a mandatory step as the form name will not be determined automatically in the scheduling agreement.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

Click the ‘EDIT’ button->Insert new row and maintain the channel as ‘PRINT’ from the drop-down. Check and Activate.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

9. Then follows the most important step – To assign the ‘Form Template’. Choose ‘Form Template’ from the drop-down in determination step

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

Here, provide and assign the form name to our custom output type ‘scheduling agreement’. To do this, click the ‘EDIT’->’Insert New Row’. Output Type=SCHEDULING_AGREEMENT’, Form name – -Z-Form name. Additionaly, we can specify role, sender country, recipient, channel, language etc. Except output type and form template, other fields are optional.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

10. The last step is to set the output relevance indicator. Repeat the steps-EDIT->INSERT. Provide the name of our custom output type and set the ‘Relevance Indicator’ to ‘X’. Other columns are optional. Activate and we are all set to use the custom output.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

We are done with the steps to create a custom output type and define business rule for it using the decision table.

Output


The transaction to create sales Scheduling Agreement is ‘VA31’.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

1. Enter scheduling agreement type and continue. Provide required details such as Sold-To-Party’, cust reference etc.in the next screen. Then go to menu ‘Extras->Output->Header->Edit’

The form name will be automatically populated in the ‘Form Template’ column along with role, receiver and channel.

SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Learning, SAP ABAP Study Materials

Thus, our Configuration is working as desired.

No comments:

Post a Comment