Demystifying FPM for Travel & Expense (FITV_FPM)
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 🙂 .
nice informative blog....
Nice blog! I was pointed to it by Custodio de Oliveira in a comment of my document over here http://scn.sap.com/docs/DOC-41887. I especially like that you also chose to show the approach of using enhancements and manipulate the FPM environment (like the roadmap or buttons) dynamically!
Good stuff to know! Thanks for sharing...
Nice and informative! Plz keep posting
Nice blog !!
I have a question - We have done some enhancments in our T&E project. We changed the look of the layouts and more. A thing that bothers us, is that the transports including the enhancmment implementation take a long time to import. over 30 minutes in some cases. It seems that the whole implementation is being imported instead of just the method\object itself.
Do you have any idea ?
thank you !
Unfortunately I have been doing my changes only in Sandbox till now and we have not tried to move the changes to other environments.
I will let you know how the import works in our case. In my view only the delta object changes should move and not the whole package.
Thanks for sharing the info on FPM. I am new to FPM and need some info on the Travel Profile(FITV_VC_MY_PROFILE). Currenlty there is a requirement to add an extra tab strip with fields to maintain some travel details. Can this be done through configuration or only possible through enhancement of the layout ?( adding context elements and new methods for processing).If enhancement,would it be advisble to do it. Any tips would be great .
If the new tab you want to add is not part of the standard component you will have to go for custom development. I would suggest to check and ensure if the new fields you are looking to add are part of the standard functionality.
If not you can do enhancement to the standard component and implement your requirement.
Hi Sundeep Sethi,
But i have one doubt.I have a requirement to check the condition before creating Travel Plan.If condition is true den only it allow to create travel plan...
if condition is false it shouldn't allow to create travel plan...
Pls help me.........
You have to find the event id of the Create Travel Plan and put custom code in the PROCESS_EVENT method of the component implementing the FPM interface to validate and allow creation based on your condition.
Hope this helps..
Hi Sundeep Sethi.
I like your blog. I am new to FPM and I have to place the estimated cost window on the create request web dynpro. I suppose it can be done by enhancement, but is it the right way to do it?
Hi Sundeep Sethi,
I want to know that how can I add custom input field in Travel request web dynpro application FITE_VC_GENERAL_DATA.
Do you have any idea?
Thanks for the nice write up.
How can a custom field added in travel expense be saved. Both 'Save as draft' and 'save & send for approval' must work for new custom field. Which all methods must be considered and what needs to be done.