In the Asset Management Fiori Application Create Maintenance Request, you have the ability to enter in long text in order to provide some additional context when raising a Notification.
In the standard system, a default template is provided which prompts the users with some questions.
"Please describe the problem:"
"When did the problem start?"
"What did you do after identifying the problem?"
It is a common requirement to change this default template to provide some company specific requirements and optionally provide some logic to change the template based on fields in the Notification or Technical Object (such as a Notification Type).
As of release S/4 HANA Cloud 2111, you can now create new Templates and include logic to dictate when the templates should be shown. An example will be discussed in this blog post.
Standard application with default Template:
Create Maintenance Request Application - With Default Long Text Template
How to extend the Application:
1.Go to Custom Logic app
Choose the + icon in the right hand corner of the app
Select Maintenance Notification as the business context.
Select the BAdI for extensibility of templates in a maintenance request. "EAM_LTXT_TML_MAINT_NOTIF"
Enter a description for the implementation.
Custom Logic App - New Enhancement details
2. Enter the logic, test it, and verify the results.
In my example logic, I want to have a different template depending on the 'Notification Type' that a user chooses.
Also note that additional sample code and detailed instructions can be accessed here: Link
Custom Logic App - New code in the Get Templates method
3. Publish the implementation.
After the implementation is published, you can see the template in the Create Maintenance Request app.
The Final Result:
The extended application is shown below. Depending on the Notification Type that a user selects, the drop down list of available Templates is updated in the Maintenance Request.
Create Maintenance Request Application - Extended with more Long Text templates
Whilst extending this application, the following limitations have been noted. If you have found a way around these limitations in your own implementation, please let us know in the comments below so I can update the blog post:
The 'Default Template' provided by SAP is always available to be selected from the list of available templates regardless of the extension logic provided.
The 'Default Template' provided by SAP is always the default option and requires a user to manually select the new template. i.e. Our extension logic to derive a new Long Text Template just appends the entry to the list of available template options but isn't defaulted.
Once a template is chosen, it is not dynamically changed if the Notification Type is changed to a different value. The user needs to reselect the new template. Eg: Notification Type 'Y1' is selected which enables us to choose the the 'Y1 - Reactive Template'. If we change the Notification type to 'Y2', it will not automatically change template to 'Y2 - Proactive Template', it needs to be manually selected again.
What have we learned?
You've learnt how you can define different Long Text templates in the Maintenance Request and use custom logic to update the available template options to the user.
This logic can include fields on the Maintenance Notification itself (such as the Notification Type used in this scenario), or even fields on the Technical Object in which the Notification is being raised against (such as Technical Object Type).