This blog is to share my experience and learning’s on migrating to WD ABAP based Travel and Expense. We had quite a lot of custom developments done in WD Java version of Travel and Expense and the challenge was to incorporate the changes in the migrated version. I assume most of the ESS projects have the strategy to maintain proper documentation of the custom changes made in WD Java which serve as the guide on custom changes to be made during upgrade or migration.
You can choose one of the following ways of applying changes to a FPM based application depending on complexity of the requirement
– Personalization: Can be done by end users. Used for simple changes like controlling visibility, label texts etc. The changes are applicable only for the user doing the personalization
– Customization: Can be done by administrator. The changes made are applicable for all the users.
– Configuration: Using the Application Configuration and Component Configuration we can modify the UI Building Blocks of the floor plan. The FLUID tool can be used to assemble the FPM application. However this tool is not applicable for Floorplan Manager of new Travel and Expense application.
– Enhancement: If we need to introduce custom code and layout changes it can be done through Enhancements.
Now coming to the learning’s on implementing some custom changes to FPM for T&E:
- First things first, all the UI content (Web Dynpro, Dictionary Objects, Programs etc.) related to Travel management can be found in the package PTRM_WEB_UI. The Travel Management Components start with FIT*. The POWL objects related to Travel management are in the package PTRM_WEB_POWL.
- The FPM component for Travel Management is FITV_FPM. It is important to note that the floorplan framework for Travel Management is not based on the standard floorplans that we are aware of. Even though the applications (Expenses, Requests etc.) have a Guided Activity (Roadmap UI) structure they are not based on FPM_GAF_COMPONENT. Interestingly Travel Management has its own FPM framework defined in the component FITV_FPM.
- When the application configuration is launched in a browser window for any of the Travel Management applications (e.g. FITE_EXPENSES), the Component Configuration (e.g. FITV_FPM_EXPENSES) launched do not have the standard structure of GAF or OIF floorplans that we are aware of.
4. One common requirement which many clients can have is to disable the navigation using the Roadmap UI steps. In the standard component it is possible to directly jump to Step 3 from Step 1 by clicking the roadmap step. Clients may require that the user should go to each step before finally confirming and saving.
Option 1: Through Configuration i.e. by creating a copy of Application and Component Configuration and changing the property “Activated ” of the UI element Roadmap. Doing this greys out the road map but does not indicate on which Road Map Step the user might be on
Figure showing how to change Activated property of Roadmap UI for application FITE_EXPENSES
Figure showing the end result after doing the above change, even though the user is in step Enter Receipts it is not highlighted
Option2: Though Enhancement– The Roadmap UI is part of the view “LAYOUT_VIEW” of the component “FITV_FPM”. In order to disable the navigation through roadmap steps the “onSelect” property of the Roadmap UI element on the view should be reset.
This can be done in the Post Exit method of the “WDDOMODIFYVIEW” method dynamically resetting the value of “onSelect” property of the UI element.
DATA: lo_ui_elem TYPE REF TO CL_WD_ROAD_MAP.
*ROADMAP is the id of the Roadmap UI element in the LAYOUT_VIEW
lo_ui_elem ?= view->get_element( ‘ROADMAP’ ).
CALL METHOD LO_UI_ELEM->SET_ON_SELECT
VALUE = ”.
Figure showing the end result after doing the above code change, when the user is in step Enter Receipts, it is highlighted.
5. Understanding FPM for Travel Management: It took me some time to realize that the FPM for Travel Management is different from the standard FPM (e.g. GAF, OIF etc.). Travel management applications use their own FPM framework. There are three FPM components in the package PTRM_WEB_UI which contain the logic to build the floorplan. The component FITV_FPM is the main FPM component here. The Web Dynpro applications are contained in the component FITV_FPM_START.
In standard FPM (GAF, OIF etc.) we have the interface IF_FPM_UI_BUILDING_BLOCK which contains methods for the FPM navigation loop. In Travel management applications FITV_FPM_VC is the interface of Visual Component for floorplan manager. This interface is implemented by the components which contains the visual components (e.g. FITE_VC_GENERAL_DATA).
When working with FPM it is important to understand the concept of Eventing. For each action raised on the screen there is a corresponding event id associated and the behavior of the application depends on the way that event is handled.
Just like the interface IF_FPM_UI_BUILDING_BLOCK contains the method PROCESS_EVENTS the interface FITV_FPM_VC contains a corresponding method ON_NAVIGATE.
I will try to explain a scenario which would be helpful while working with FPM in Travel management applications.
Scenario: Imagine that you have to put a custom validation in place when the button Enter Receipts is clicked on the General Data view of the Create Expense Report application.
Step 1- Identify the web dynpro component to which the view belongs by right clicking on any field on the screen and choosing “More Field Help” and switching to the technical help of the field. You will find the WD Component as shown in this case to be FITE_VC_GENERAL_DATA.
Step 2- Go to the Component Controller of the web dynpro component and you will find the ON_NAVIGATE method. This method comes as a result of implementing the interface FITV_FPM_VC by this component.
Step 3- You can find the corresponding event id raised by any button on the screen by placing a break point in the ON_NAVIGATE method and checking the value of importing parameter IV_TYPE of this method.
Step 4- Once you have the event id you can put custom logic in the post-exit of this method by checking the parameter IV_TYPE.
e.g. if you have to put custom validation on click of “Enter Receipts” button following code will help
IF IV_TYPE EQ WD_THIS->FPM_API->GC_NAVIGATE_FORWARD.
***put your custom validation here****
Similarly you can apply custom logic for any button on the screen by finding their component and the event id raised.
I hope this blog helps beginners working on Travel management applications in WD ABAP.
I will continue to update this blog with more learning’s as and when I acquire them 🙂 .