7

Enhance Text Determination with Custom Logic in Sales Area of S/4HANA Cloud

 1 year ago
source link: https://blogs.sap.com/2022/09/22/enhance-text-determination-with-custom-logic-in-sales-area-of-s-4hana-cloud/
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
September 22, 2022 2 minute read

Enhance Text Determination with Custom Logic in Sales Area of S/4HANA Cloud

In the blog, the function text determination is introduced and now I would like to guide you one step further, to have custom logic in text determination.

Please consider the following use case, instead of texts from customer master data or predecessor documents, you would like to define central standard texts and include them in document texts so they can be printed. And let’s have a concrete example: showing transport instructions for certain products in a sales order. One product is fragile and another which must be stored in a specific temperatures.

So let’s see how to achieve this:

Define the standard texts. This can be done with the app Create Standard. As can be seen from below, two standard texts are defined.

2022-09-21_17-10-41.png
2022-09-21_17-16-04.png

Then implement the custom logic to specify when will these standard texts be valid. In the context of text determination, there can be two types of BAdIs, one is Copying Requirement, which is usually used to specify the criteria with which a text determination is valid. The other is the Data Transfer, which can be used to define the critial, also specify a standard text to be determined.

2022-09-21_17-10-41-1.png

In below implementation Demo, the logic is quite starlight forward. For sales document with type TA (standard sales order), if the product maintained in the item is TG-D010_US, then the standard text ZITEM1_INSTRUCTION will be determined. And if the product is TG-D020_US, then ZITEM2_INSTRUCTION will be determined. There are much more parameters provided in the cloud BAdI to build your logic.

2022-09-21_17-10-41-3.png

Then this cloud BAdI implementation can be assigned to a routine (SSCUI 104306) and finally be maintained to the configuration of text determination. In below screenshots, the implementation Demo is assigned to a routine with number 3000000 and then the routine is assigned to the text determination configuration.

2022-09-21_17-10-41-4.png
2022-09-21_17-10-41-5.png

Now, let’s create a sales order with the products as items. As can be seen, the contents of the texts get copied from the standard texts.

2022-09-21_17-10-41-7.png

With this feature, the text determination can be even more flexible (and complex…). Thanks for reading.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK