EDUCAÇÃO E TECNOLOGIA

Displaying custom messages in the SAP Fiori Launchpad with App Support – Example hanging SMQ2 entries

There are various reasons, why it could be useful to display customer specific messages in an application in the SAP Fiori Launchpad. There are also various ways to achieve this in the different applications. For the approach described in this article, the messages are added and displayed in a central place – no web development skills required.

The example focuses on adding information on hanging RFC queues (SMQ2) to a WebGUI transaction (VL03n). The overall steps of this example can also be applied to any other application in the SAP Fiori Launchpad, for example UI5, WebDynpro or WCF.

Example Setup

Our example business case is a shipping clerk trying to figure out, why the goods movement has not been posted for a certain outbound delivery coming from EWM. This might happen, when data has been changed in the sales order, the material, or in the delivery itself.

Goods%20issue%20stuck%20in%20transaction%20VL03n

Goods issue stuck in transaction VL03n

The queue errors will be displayed in App Support, so basically in a popup window available in the user menu:

App%20Support%20in%20the%20user%20menu

App Support in the user menu

App Support usually only displays general messages, related to the setup of an app, or in regards of authorization issues. If it is not visible in your menu, please check this blog article on how to set it up, or if it is overall available in your system. In this example we’ll use it to display some more specific information regarding the business process.

Available logs in App Support with custom log menu option

In this example we’ll use a distributed system setup, with a Front-End Server and a Back-End Server. In an Embedded Server setup, the steps will be pretty much the same. The only difference is that the data retrieval would be simpler, than in the distributed setup.

Setup

To add our own custom implementation, we only have to implement a single BAdI in the front-end system. The enhancement Spot is /UI2/ADE_DATASOURCE and the definition is /UI2/ADE_DATA_PROVIDER.

Enhancement%20Spot%20/UI2/ADE_DATASOURCE%20in%20transactionSE18

Enhancement Spot /UI2/ADE_DATASOURCE in transaction SE18

The BAdI can have multiple implementations and we’ll add another one for our purpose:

Adding%20another%20implementation%20for%20BAdI%20definition%20/UI2/ADE_DATA_PROVIDER

Adding another implementation for BAdI definition /UI2/ADE_DATA_PROVIDER

The BAdI implementation ID and the implementing class can freely defined. The class name used for this example is ZCL_BADI_IMP_SMQ_INFO.

BAdI%20Implementation%20and%20implementing%20class

BAdI Implementation and implementing class

In this implementation we’ll require a Filter Value for the BAdI. The filter is mainly used for the data retrieval and registration of the data source. The filter value also functions as the ID of the BAdI and will be used to identify the message source uniquely. For our example we’ll name the ID ZSmqInformationDisplay:

Filter%20value%20for%20BAdI%20implementation

Filter value for BAdI implementation

Implementation

The complete example class implementation can be retrieved from here:
https://github.com/tobiasmoessle/App-Support-SMQ2-Example/blob/main/zcl_badi_impl_smq_info.txt

Simply create the class in your local namespace, then copy and paste the contents of the file to the class body. If you’re interested in how the actual implementation works, the implementation procedure is described here step-by-step.

After activating the class, the resulting view should look like this:

App%20Support%20setup%20for%20a%20business%20user%2C%20with%20only%20the%20new%20SMQ2%20errors%20displayed

App Support setup for a business user, with only the new SMQ2 errors displayed

All queue entries in status SYSFAIL are displayed, the error message for our delivery is also displayed and we can directly identify from the App what’s wrong. When clicking Read More, we can also navigate to SMQ2 directly for this queue entry:

The selected entry after clicking Read More

With only a few method implementations we have created a useful data source for showing hanging queue entries. For troubleshooting, a support person now would not have to switch to SAP GUI anymore, to identify an issue in SMQ2. With some minor authorization adjustments to authorization object S_FLP_AS, this new view can be provided exclusively to business users, who are otherwise not interested in the other information provided by App Support. The hanging queue entries can be downloaded and shared with support personnel or forwarded to a sales or material responsible.

It would be nice to be pointed directly to the exact hanging queue entry in SMQ2, but as the delivery number or any other application parameters are not available in the data source, we must always use a more general approach. Nonetheless, even this more general message log could be utilized by business users.

For Questions and Answers on SAP Fiori – please see the SAP Community Q&A area and feel free to post your own questions.
I
hope you find this blog post helpful – feel free to leave comments and feedback, you can follow the SAP Fiori Launchpad tag to receive updates on blog posts here.