Technology Blog Posts by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
sivapalani10
Explorer
0 Likes
4,693

SAP S/4HANA Cloud key user extensibility allows adapting standard functionalities to user requirements without the need for any external tools. Whether you want to apply small changes, such as hiding standard fields for specific user groups or including some business logic, SAP S/4HANA Cloud offers a variety of tools covering diverse extensibility needs. Here's an overview of the things you can do using key user extensibility tools:

  • Change and adapt the UIs for SAP Fiori Apps through Key User Flexibility or classic applications using Screen Personas
  • Create a new custom user interface
  • Create and extend forms and email templates
  • Create custom-specific CDS Views
  • Enhance the current business process by creating custom business logic
  • Create custom fields
  • Create custom business objects

 

Business requirement:

The requirement is to have custom fields like Cost center and Profit center in the Free Form payment and it is expected that the system should be good enough to handle below scenario.

Scenario 1.

We are posting to an account that has a cost center AND profit center

  1. We will ONLY provide the cost center in the free form
  2. The system will derive the profit center
  3. The accounting document has cost center and profit center populated

 

 

Scenario 2.

We are posting to an account that has only profit center

  1. We will ONLY provide the profit center in the free form.
  2. The accounting document has profit center populated

 

Note: This blog is focused on S/4 HANA Cloud version, but this could be same for S/4 HANA premise

 

I will be covering below topics in details

1.Custom field (Code list based on CDS view).

2.Custom logic  

3.Adapt the custom fields in the Free form payment app

4.Transport the changes in Software collection and migrate the changes to production.

 

1.Custom Field (Code list based on CDS view).

In actual ECC, we usually create custom field in transaction SE11 and then it would be leveraged in tables, program, reports. Whereas in cloud version of S4 HANA, it comes handy just with the help of app called “Custom Fields”.

Login to Fiori Launchpad and search for Custom fields app

Click on ‘+’ icon on top right corner of the application

2.png

 

 

Select the relevant business context, in this case it would be “Payment Request”

Give a meaningful Label which would be title of your object and mention unique identifier

Now the important selection for the field type would be “Code list based on CDS View “

3.png

If it is just a text field, then choosing type Text will be enough whereas the type “Code list based on CDS view” is search help (F4) assigned to the custom field and so the end user has the option to choose the value out of list by clicking the search help.

Now click “Create” to generate the new custom field YY1_F4_COSTCENTER

To get relevant cost center value, it is necessary to select equivalent CDS available in the value help view. In this case, the cost center value is available in I_CostCenterStdVH

4.png

 

At last, it is required to update key fields at the bottom section with meaningful field names and then publish the custom field.

 

2.Custom Logic:

 

Once after custom field is published, the logic to be updated and for that search for custom logic in search bar.

Click on ‘+’ and give the same business context “Payment Request “that was given for Custom logic here as well.

Give Badi Description “Payment Request Accounting Document” choosing the drop dox box and you notice the implementation id is being picked up automatically as YY1_COSTCENTER.

Give a description for the implementation

Now it is time to open the code editor and implement the logic. As discussed above, the requirement is to pass the value from the custom field into FI document once the free form payment request is saved and released.

5.png

 

Click on open code editor and implement the logic as like below for the following parameters.

 

     

     

 

 

Data item_field type fins_payt_req_posting_field.

      if not i_payment_request-YY1_F4_COSTCENTERCC00_PRQ is initial.

       item_field-field_name  = 'COBL-KOSTL'.

       item_field-field_value = i_payment_request-YY1_F4_COSTCENTERCC00_PRQ.

       append item_field to c_payee_items.

      endif.

     if not i_payment_request-YY1_PROFITCENTERPP00_PRQ is initial.

     item_field-field_name  = 'COBL-PRCTR'.

     item_field-field_value = i_payment_request-YY1_PROFITCENTERPP00_PRQ.

     append item_field to c_payee_items.

     endif.

 

 

Click save and publish the custom logic YY1_COSTCENTER.

Now we are entering the final phase of implementation to adapt the custom fields YY1_COSTCENTER and YY1_PROFITCENTER in the free form payment app.

 

  1. Search for process free form payment in the search bar .a.png
  2. Create a payment request by choosing the option Free Form payment.b.png
  3. Go to posting data tab and click on your user profile to select Adapt UI.Note if you are not seeing this option then it means the required privilege are missing and it is required to be added for the user id.c.png
  4. Now hover over the posting data segment to add the custom fields by right clicking and then press Add field option. Search for custom field by typing the description Cost Center and then you see the option Cost Center getting populated for you to choose. Similarly, add the profit center custom field in the Posting data segment.d.png
  5. After adding the custom fields in the Posting data segment, activate the version.e.png
  6. After activation of the changes, we would be able to see the custom fields available in the Free form payment. Now if you notice the custom fields are with search help option to select the value from it.f.pngff.png
  7. Select the cost center that need to be populated in the form from list of option and give other required details in the form to save and release the payment request.
  8. Once after the free form payment is released, you would be noticing the FI document populated with value what being entered in the custom field.h.pnghh.png