In continuation to my previous blog “
Embedded Analytics: Shades in S/4HANA Cloud and On-Premise version”; in this I will cover how we can configure custom field in Decision table(Output Parameter Determination) for triggering Output type.
Now with SAP S/4HANA Cloud 2005 being available , we will cover functionality wrt S/4HANA Cloud 2005 functionality. Wth Cloud 2005 some of the issues being faced by me in 2002 edition are solved now ?. Adding custom field and logic in Forms is very common requirement for any customer. Customizing forms in S/4HANA Cloud are very well covered by
Mahesh Sardesai in his blog series
here. That was my starting point as well for Output Management in Cloud. So, we know how to add custom field in Custom Form template using In-App extensibility and how to fill it. Is it enough? Well yes, in case your decision table is based on standard fields already available and you just wanted to customize the form template.
But now if you want to trigger different custom form templates
based on custom field; and that field is not there in Decision table then? Obviously, your next question would be
How do I add my custom field in the decision table?
Here I will list the logical steps that need to be followed for having custom field added in Decision table so that it can be used in Rules to trigger different Form templates.
Let’s take an example of Billing scenario; where project type is my custom field and in case its value is “A”; call Form 1. In case its value is “B” ; call Form 2.
Let’s have a look at the steps that need to be followed for this :
Enable Custom field for Output Parameter Determination
Firstly ,add custom field Project Type in Business Context “Sales: Billing Document” using app “Custom field and Logic” and enable the UIs as shown below
Enable the custom field in Decision table
While working in Cloud 2002; we were stuck at point when the custom field added was not getting reflected in the decision table. So, you end up raising an OSS message to SAP in Cloud 2002; for binding to be reflected.
But seems SAP has addressed this with 2005 edition where now you have the option for “Refresh Condition Parameters of Application”.
- Go to “Output Parameter Determination” Fiori app ; Select Billing Document in the drop down for "Show Rules for"
- Right click next to the drop-down list
- For Binding the custom field; click on “Refresh Condition Parameters of Application”
Below Pop up will show up; click on the “Yes” as shown below.
You will get the message that Data binding has been refreshed.
Let’s validate
if the custom field is now reflecting in Decision table?
- Select show rules for “Billing Document” and then in Determination Step select “Form Template”.
- Now click on the table settings for Decision table. Decision table consists of table definition and content (Business rules) .
- Then select the drop-down symbol right to Insert Column and select “From Context Data Objects”
- Below screen opens and you can see the custom field is reflected here; select the custom field and click on Ok
- Now when you will check the Table Settings again; our custom field is part of the Condition Columns and can be used in Decision table now.
Configure Forms for Billing Document:
Now we have 1 custom form “YY1_BILLING_CUSTOM” and other standard Form B; custom one has been maintained in “Maintain Form Template” app after changes.
Also ensure that your custom template is maintained in Fiori app “Manage your solution”.
- Select Configure Your Solution
- Then Select the below one and ensure that your Custom Form is maintained for BILLING_DOCUMENT
Use Custom field in Decision table
- Open Fiori app “Output Parameter Determination”
- Select Show Rules for “Billing Document” and select “Form Template” in Determination Step.
- Now scroll down to the Decision table – In table content change existing entry/create new entry based on your requirement
- Example I changed an existing entry since I want “Project Type” field to be considered as well for Output Determination and I added the condition as “Project Type” = A
- Assign the custom Form name for this scenario
- Similarly, for Project Type = ‘B’, assign standard Form in rule . Then click on “Activate”.
Now we have added the field in Decision table ; but how will the value flow to custom field while creating billing document ? We haven't populated field anywhere ; we will need data transfer routine for filling our custom field Project Type.
Data transfer Routine Configuration
- In Custom field and logic app; implement custom logic for Business Context = Sales Billing Document and BADI = Custom Data transfer for billing documents. Default filter condition gets created as well.
- Change the filter from initial to some number like I have given it as 901 since it will be used in configuration later.
- In logic; fill the value for custom field Project Type.bil_doc_res-yy1_projecttype_bdh = 'A'. So here custom field is assigned value as "A" for my condition.
- This looks slightly familiar right? You would be comparing with VOFM and thinking about on-Premise routines, right? Well, yes in Cloud you can put filter on Data transfer /Copying requirements .Yes ,you can then define your own additional routines for data transfer and copying requirements to enhance the copying control for sales documents: You register a routine number and assign the filter value of the BAdI implementation as the enhancement identifier (ID) to the routine number .Next obvious question that will come to your mind is; where I will assign it now?
- Open Fiori app “Manage Your Solution” and open “Configure Your solution” and select below item.
- And Select Configuration step and click on Configure
- Click on New entries and enter the Billing Routine number for data transfer as below and press save
- Click on “Assign Enhancement Id to a Routine number” and then click on New entries in right screen.In First column do F4 and you will get the Data transfer routine used in Billing and fill that.In Enhancement Identifier field; if you will do F4 you will find the Data transfer routine that we assigned in Custom field and logic , 901 . So assign the same here and save the data.
- In the Copying Control for Billing Documents configuration item, you must assign the routine numbers that you define here to the relevant combinations of target billing type, source document type, and item category for which you want the relevant BAdI implementation to be called. Under "Configure Solution" , select the below option now
Now click on Configure and assign the Routine .Example while creating Billing document of type ZA from reference sales document ZB ; we have assigned the Custom Data transfer routine for the item category PS03.
- Now when you will create the Billing document; for the configuration we have maintained. Custom form will get triggered if Project Type = ‘A’.
Summary: In this blog ; I have covered how you can enable custom field in Decision table to trigger Output Types .So, in addition to customizing Form templates ;you can also customize rules for Business Contexts where “Output Determination” is available under UIs to be enabled .
Now once have understood Output Management in Cloud ; refer my blog
SAP S/4HANA Cloud: My Journey with AIF (Interface Monitoring) in Cloud Implementation so far
for AIF usage in Cloud.