In this recipe, we will see how we can change the IDR header (title and ticket area) programmatically. In this case, the previously statically defined (through IDR configuration) ticket area and title are overridden. This concept applies to both the OIF and OVP Floorplans.
In this recipe, we will write the code for changing within the view (window) shown within a subview. When the particular subview is selected, the header title and ticket area will change. We will write the code in the component whose view is used as an UIBB in a subview. We will write the code in the respective view (WDDOINIT
method).
For dynamically changing the IDR title and ticket area, proceed as follows:
MY_FPM_IDR
based on the type IF_FPM_IDR
.SET_IDR_TITLE_TICKET
method in the component controller. Then, we will write the coding in the method. We first define a reference variable MY_FPM
that point to the interface IF_FPM
. We call the static method GET_INSTANCE
of the CL_FPM_FACTORY
class in order to create a reference to the FPM service object.GET_SERVICE
method with the constant attribute GC_KEY_IDR
of the class CL_FPM_SERVICE_MANAGER
. The result of the method is then assigned to MY_FPM_IDR
attribute we defined in the first step.SET_APPLICATION_TITLE
method of the attribute MY_FPM_IDR
. We pass the New Title
and New Tooltip
parameters for the IDR.SET_TICKET
method for the reference MY_FPM_IDR
. The necessary Ticket top
and Ticket bottom
texts are passed as values corresponding to necessary parameters.SET_IDR_TITLE_TICKET
from the WDDOINIT
method of the view that is used in the UIBB of the subview.By following these steps, we are accessing the IDR at runtime and specifying its displayed IDR title and ticket area text.
We created a method SET_IDR_TITLE_TICKET
at the component controller level that access the service object for accessing the IDR. Appropriate methods are called in order to set the application title, ticket top, and bottom. Next, this method is called from the WDDOINIT
method of the view used in the UIBB of our OIF application.
When the application is run and the relevant subview is selected, the WDDOINIT
method is called that calls the SET_IDR_TITLE_TICKET
method of the component controller. The New Title, Ticket top, and Ticket bottom parameters are changed as shown in following screenshot:
18.118.20.156