Changing header and ticket area at runtime

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).

How to do it...

For dynamically changing the IDR title and ticket area, proceed as follows:

  1. First, we define an attribute at the component controller level by the name MY_FPM_IDR based on the type IF_FPM_IDR.
    How to do it...
  2. Next, we define a 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.
    How to do it...
  3. We then call the 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.
    How to do it...
  4. We then call the SET_APPLICATION_TITLE method of the attribute MY_FPM_IDR. We pass the New Title and New Tooltip parameters for the IDR.
    How to do it...
  5. We then call the 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.
    How to do it...
  6. We then need to write the code for calling the method SET_IDR_TITLE_TICKET from the WDDOINIT method of the view that is used in the UIBB of the subview.
    How to do it...

    By following these steps, we are accessing the IDR at runtime and specifying its displayed IDR title and ticket area text.

How it works...

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:

How it works...
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.192.59