quarta-feira, 9 de setembro de 2020

Extending Customer Master App: In-App Extensibility

 With S/4HANA, comes another hot topic that we have been hearing a lot about …yes, you guessed it right… Extensibility i.e. how we are going to enhance or customize the standard processes or applications according to our business needs.

In this blog, I am going share step by step process on how we can enhance the standard Customer Master app using In-App Extensibility.

Let’s say we have a requirement to add a custom field into the customer master. So, first thing that comes into mind is how we are going to achieve it in S/4HANA… In ECC , we would have enhanced the standard table by including the custom field or looked for the screen exit to add field to the screen and must have written the field update logic in user exit… but what should be the approach in case of S/4HANA…

And the answer is, if we are working in S/4HANA On-premise version, we still have all the above options available but the recommendation is to use In-App Extensibility ; which can fulfill your requirement and in case of S/4HANA Cloud, In-App extension is the only option…yes, the only option.

In my case, I am working in On-premise version. But, nothing to worry even if you are working in Cloud, as the In-app Extensibility works the same way in both cases.

Moving forward, let’s say we have to add custom field “Sales Zone” to the customer master general information section and we should be able to Add/change/display value in the field from our standard Customer Master App.

Below is the step by step approach.

  • GoTo the Fiori Launchpad and open the Customer Master App as shown below.

  • Initial screen will look like this. Next step is to check if we have the access to adapt/enhance the screen. To do so, click on the User Icon as shown below.

  • Check if you can see the Adapt UI option. In case you don’t see it, that means you are missing the required access.

  • To be able to extend the application you need to get the “SAP_UI_FLEX_KEY_USER” role to your user ID.

  • Once role is added, check the user details again to see if you are able to see the “Adapt UI” option.

  • Now, go back to the customer master app and click on Go. You should see the customer details.

  • Select any customer and click to display the details.

  • Customer details will be displayed as shown in screen shot below. So this is the screen where we want to add a custom field under Basic Data tab in General information. Click on User icon and select Adapt UI option.

  • Once we select the “Adapt UI” option we will see that we are in UI adaption mode. Right click on the screen we want to add custom field and click on Create group.

  • A group will be created with the name “New Group”. Right click on the group and click on rename to give any name as per your choice. I am giving the name “Customer Fields”.

  • Now let’s add the custom field to this group. Right click again and click on “Add field”

  • In the popup screen , you will see all the fields available as a part of the standard datasource. If we want to add any of this available fields we can just select and it will be added to the screen. But, yes…you are right … we have the need to add custom field. So, to do so, click on “+” (create custom field, association or logic) icon on the pop up screen “

  • The click on “+” icon will navigate you to the “Custom fields and Logic” app’s initial screen. The good part is that it will automatically select Business Context applicable for the screen where we want to add the custom field…Yes, you read it right… No, more confusion on which Business context to select.

  • Click on “+” (Create) icon to create a custom field

  • The pop up screen will have Business context pre-populated and we just need to fill rest of the details like Label which is “Sales Zone” in this case, data type, length. After filling the details, click on “create and publish” button.

  • The screen will show your custom field details with status as “Publishing”. It will take some time to change the status to published. Basically, it automatically adds the custom field to the standard table which customer master table in this case.

  • Ones Publish, we can go to back-end and see that the field is automatically created in the Business Partner General data table (BUT000) in this case as show blow.

  • To see which all tables this field has been automatically included, just do the where used list on the data element of the field.

  • Let’s get back to the task. So, now we have created the custom field “Sales Zone” and published it. Now, we need to add it to the screen where we started from. Right click on the custom group “customer fields” that we created and click on add field. This time you should see the custom field “Sales Zone” in the list of available fields. Select the field and click ok.

  • So, we have now successfully added the custom field “Sales Zone” under the “Custom fields” group that we created as shown in screen shot below.

  • Click on “Save & Exit” and get out of the UI adaption mode.

  • We are out of the UI adaption screen now and we can see our custom field on standard screen. Let’s say we now want to update data in this field now. Just click on the “Edit” button and the we will see the editable screen with option to put data in our custom field.

  • Enter the data in the field, “Test Zone” in this case and click on save. You will get a message “Master data record saved” on successful update in database.

  • We can see the updated data in the customer details screen.

  • We can check in the back-end table BUT000 also for customer “100000” which we just updated. And as shown below, we have the data in the standard table as well.

  • What about when we create the new customer? Let’s see that also. Go to the initial screen of the app and click on create and Select either of person or organization.

  • On the Input pop up screen, provide the customer name (mandatory field), in this case, “Extensibility test customer” and any other option inputs if you want and click ok.

  • In the next screen, we can see the custom field “Sales Zone”  is available even in create customer scenario. We can enter all the required data along with sales zone and can create the customer.

  • And we have successfully created the new customer “1000020”

So, does that mean we can enhance any app or any screen using this approach and the answer to this is NO .

Then how do we know which screen can be extended?? Very well, when we click on “Add Field” under the UI adaption screen, the “+”  to add custom field would be grayed out as is shown in below screen shot when we try to add custom field in the address details screen.

With this we have successfully extended the Standard Customer Master App using In-App Extensibility approach.

 

Thanks

Vijay

Source: https://blogs.sap.com/2019/03/20/extending-customer-master-app-in-app-extensibility/

Nenhum comentário:

Postar um comentário