FPM allows to display error page in an application if required where the error page information can be retrieved from different sources i.e the message content may be from BAPITER2 structure or from T100 structure or simple the error text from the exception object or the error text from the OTR text as well.
A clear demo is provided by the FPM application FPM_TEST_OVP_ERROR_PAGE (packgae- APB_FPM_TEST) about the error page. The below post tries to show the details
The interface IF_FPM provides the method DISPLAY_ERROR_PAGE which receives an reference of the IF_FPM_ERROR_DETAILS and displays the error page with error message details.
The CL_FPM_ERROR_FACTORY classes provides various methods from which an object of the IF_FPM_ERROR_DETAILS can be created and passed to the IF_FPM~DISPLAY_ERROR_PAGE method.
Create an OVP application and just added the toolbar elements.
Created 4 buttons with event id for each.
The application controller class is provided.
Test the application and we have 4 buttons.
We have the message class.
In the application controller class method IF_FPM_APP_CONTROLLER~AFTER_PROCESS_EVENT add the below code for error page arising form BAPIRET2 structure.
Test the application and click on the BAPIRET2 ERROR button.
So here we have the error page with message. Now click on the Display Help link.
A pop up appears with message text and the message class name with message number.
For the error page from T100 structure. Put the below code in method IF_FPM_APP_CONTROLLER~AFTER_PROCESS_EVENT of the application controller class.
Here we have the error page with message text from T100.
error page can be build to display message text from OTR text.
Put the below code in IF_FPM_APP_CONTROLLER~AFTER_PROCESS_EVENT method for the error page form OTR text.
And here we have the error page resulting from otr text.
Error page can be formed from the exception object. Put the code in the IF_FPM_APP_CONTROLLER~AFTER_PROCESS_EVENT method and test the application.
Error page from the exception object.