Prerequisites
- Products: Liquid UI WS, Liquid UI Server or Local DLL, Client Software
- Commands: call(), return()
Purpose
Learn how to display the exception that occurred during the function module call. You can capture the exception that occurred during the function module call using the variable.exception. To demonstrate the process, we will walk you through the following steps:
- Delete the image container on the SAP Easy Access screen
- Call the BAPI_USER_GET_DETAIL function
- Add a condition to check if an exception occurred during the function call
User Interface
//Create the file SAPLSMTR_NAVIGATION.E0100.sjs inside your scripts folder for customizing the SAP Easy Access screen
//Now, let's add the Liquid UI script to the above file and save it
Customization
- Delete the image container on the SAP Easy Access screen using the del command.
//Deletes the Image container on the screen del("X[IMAGE_CONTAINER]");
- Call the BAPI_USER_GET_DETAIL function using call().
//Calls a function module rfcresult = call("BAPI_USER_GET_DETAIL", {"in.USERNAME":"&V[_user]", "out.LOGONDATA":"z_logondata", "table.PARAMETER":"z_parameters"});
- Add a condition to check if an exception occurred during the function call. If the exception occurs it displays a notification.
// Checks if an exception occurred while calling the function if(rfcresult.exception){ message('E: Exception occurred'); }
SAP Process
- Refresh the SAP screen.
- If no exceptions occur, the existing RFC details will be displayed in the Cornelius window, as shown below.
- If an exception arises, a notification stating Exception occurred is displayed, as shown below.
Note: To know more about how to call a function module, click here.
Next Steps
Learn how to demonstrate the event performed on the screen.
5 min
This article is part of the Conditional scripts tutorial.