Ansicht
Dokumentation

FITV_EXT_PLANNING_01 - BAdI: Define Exit for Third-party Travel Planning

FITV_EXT_PLANNING_01 - BAdI: Define Exit for Third-party Travel Planning

SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

This Business Add-In (BAdI) is used in the SAP Travel Management (FI-TV) component.

You can use this BAdI on the Web Dynpro ABAP-based user interface of SAP Travel Management to dynamically use a third-party travel planning system (online booking system) as an alternative to SAP Travel Planning. This enables you to send travel data from SAP travel requests to the third-party planning system, and receive settlement-related data back from the third-party planning system into SAP Expense Reports.

This BAdI lets you control the following features of SAP Travel Management:

  • Area page Trips and Expenses in Employee Self-Service (ESS) of SAP NetWeaver Portal
You can have the system display the travel planning service for a third-party travel planning (service link, service link text, and the service description) to enable users to call the area page of a third-party travel planning system.
  • Work center with the personal object worklist (POWL) of the Traveler role
  • In the POWL query for all trips and expenses of a user, you can redirect the calls to SAP Travel Planning over to a third-party travel planning system.

  • In the POWL query for all travel plans of a user, you can display the bookings in third-party travel planning and redirect the calls to SAP Travel Planning over to a third-party travel planning system.

  • In the POWL query for all travel requests of a user, you can redirect the calls to SAP Travel Planning over to a third-party travel planning system.

  • POWL queries for individual employees in the work center of the Travel Assistant role
When a travel assistant displays or edits the trips and expenses for an employee, the system uses the same POWL queries as those in the work center for travelers. Note that when transmitting the logon data to third-party travel planning, the system uses the logon data of the employee, not the logon data of the travel assistant.

You can connect different third-party travel planning systems and run them simultaneously. Each third-party travel planning system requires a separate BAdI implementation. The filter TRVOF is defined for the BAdI; the system uses this filter to determine which BAdI implementation needs to be executed for the user. Prior to calling the BAdI, the system reads from characteristic TRVOF (transaction PE03) to see which third-party travel planning is configured for the user, and then passes this value to the filter.

The BAdI contains the following methods:

  • CHANGE_SERVICE_KEY
The system always executes this method whenever a user in the work center for travelers or travel assistants chooses one of the functions that call travel planning - for example, the functions that follow:
  • Create Travel Plan in POWL query All My Trips and Expenses

  • Book Flight, Hotel, Rental Car in POWL query All My Trips and Expenses

  • Create in the Travel Plan column in POWL query My Trip Requests

You can use this method to change the service key, which by default points to SAP Travel Planning, to use third-party travel planning. The standard system includes service key EMPLOYEE_TRAVEL_PLANNING_EXTERNAL_12, which calls the iView for executing third-party travel planning.
Afterward, the system calls the method ADD_URL_PARAMETERS.
  • ADD_URL_PARAMETERS
The system executes this method after it executes one of the methods CHANGE_SERVICE_KEY or SET_AREAPAGE_SERVICE.
You can use this method to construct the URL for calling a third-party travel planning system and to add additional parameters. For more information, see Add URL Parameters.
  • SET_AREAPAGE_SERVICE
The system executes this method if a user calls the area page Trips and Expenses in Employee Self-Service of SAP NetWeaver Portal.
You can use this method to replace the travel planning service on the area page Trips and Expenses with the service for third-party travel planning. The standard system includes service key EMPLOYEE_TRAVEL_PLANNING_EXTERNAL_12, which calls the iView for executing third-party travel planning.
Afterward, the system executes the method ADD_URL_PARAMETERS.
  • ADD_POWL_SYNC
The system executes this method whenever a user calls the work center for travelers, calls the trips and expenses of an employee in the work center for travel assistants, or refreshes one of the POWL queries in the work center.
You can use this method to read booking data from third-party travel planning (for example, Passenger Name Records from GetThere) into SAP Travel Planning. The system includes this data during a refresh; meaning that the POWL query for travel plans also displays the bookings the user previously made in third-party travel planning.
  • CONTROL_PLAN_CANCEL_DELETE
The system executes this method when a user chooses the deletion function for a travel plan in the POWL query for travel plans.
You can use this method to control system behavior during the deletion of travel plans. Users are allowed to delete a travel plan only if that travel plan does not have any bookings. This method checks if a travel plan contains bookings in a third-party travel planning system. Depending on the result, you can, for example, issue a message that prompts the user to first cancel the bookings in the third-party travel planning system.
  • CHANGE_POWL_ACTIONS
The system executes this method whenever a user calls the work center for travelers, calls the trips and expenses of an employee in the work center for travel assistants, or chooses a different POWL query.
You can use this method to tailor or enhance the actions (POWL feeder actions) for a query - for example, the texts on pushbuttons.
  • CHANGE_POWL_OBJECT
The system executes this method whenever a user calls the work center for travelers, calls the trips and expenses of an employee in the work center for travel assistants, or chooses a different POWL query.
You can use this method to tailor or enhance the individual rows (POWL feeder objects) of a POWL query. For example, you can implement this method in the POWL query for travel requests to activate or deactivate the link to the subsequent action (book travel service), depending on trip status.
  • CHANGE_POWL_DETAIL_BUTTON
The system executes this method whenever a user is in the work center for travelers or the work center for travel assistants, and displays the details of a travel plan (view V_DETAIL of Web Dynpro ABAP component FITV_POWL_TRIP_DETAIL in package PTRM_WEB_POWL).
You can use this method to adapt the labels of the following pushbuttons for the details of a travel plan:
  • The pushbutton Change

  • The pushbutton Cancel/Delete

This method has the following parameters:
  • P_TP_CHANGE Changing

New text for the pushbutton Change
  • P_TP_DELETE Changing

New text for the pushbutton Cancel/Delete Constraints:

Only the Web Dynpro ABAP-based user interface of SAP Travel Management supports the integration of third-party travel planning systems.

The resource object key for third-party travel planning is defined in the ESS Homepage Framework under Define Resources. The standard system contains the resource object key EMPLOYEE_TRAVEL_PLANNING_EXTERNAL_SRV_12. This key defines the URL of the PCD page (iView) in SAP NetWeaver Portal for the integration with third-party travel planning systems. It does not contain information about third-party travel planning. You can statically add this information in the resource object key or dynamically map this information with the method ADD_URL_PARAMETERS.

The service key for third-party travel planning is defined in the ESS Homepage Framework under Define Services. The standard system contains the service key EMPLOYEE_TRAVEL_PLANNING_EXTERNAL_12. The proxy class CL_TRAVEL_AREAPAGE needs to be allocated in the service definition.

If you want to display third-party travel planning on the area page in SAP NetWeaver Portal, the service key for third-party travel planning must be assigned to a subarea in the ESS Homepage Framework; see Assign Services to Subareas.

In the standard system, there is no activated BAdI implementation.

For information about the implementation of BAdIs in the context of the Enhancement Concept, see SAP Library for SAP NetWeaver under BAdIs - Embedding in the Enhancement Framework.

This BAdI uses the interface PTRM_EXTERNAL_TP_INTERFACE. For more information, display the interface in the Class Builder.

The BAdI implementation PTRM_EXT_TP_GETTHERE in the enhancement implementation PTRM_EXT_TP_ENHSPOT_GETTHERE shows the connection to a third-party travel planning system, using the online booking system GetThere as an example. The example implementation uses the methods as follows:

  • CHANGE_SERVICE_KEY
Allocates the service key EMPLOYEE_TRAVEL_PLANNING_EXTERNAL_12 (service key for the iView in which the third-party travel planning system is called).
This does not apply to the Travel Assistant role. This role is currently not supported by GetThere.
  • ADD_URL_PARAMETERS
Depending on the optional parameters available, the method constructs a local context for assembling the dynamic URL parameters. When static URLs are added for the GetThere online booking system for the address of the PCD page , the method checks whether these are already defined in Customizing for the resource. The static URL of the booking system consists of the base URL and organizational parameters, such as the GetThere site ID and the personnel number of the user.
When called from the work center, the following data is available:
  • When a new travel plan is created, no additional dynamic parameters are possible.

  • When a travel plan is created on the basis of a travel request, the method reads the data of the request (by means of the trip number) and appends the data as parameters to the URL (at least the data that is supported by GetThere).

  • When a travel plan is changed, the method determines the Record Locator of the bookings and sends it as a URL parameter to the GetThere system to enable the direct display of the bookings.

GetThere labels the trip number as the Trip Authentification Number (TAN).
Note:
The following URL parameters for GetThere are customer-specific: you need to ask the provider for their values.
  • URL

  • SITE

  • SUBSITE

In the example implementation, these URL parameters are rendered as attributes of the implementing class. If you copy the example implementation, make sure you replace the initialized values for these URL parameters with the customer-specific data.
  • SET_AREAPAGE_SERVICE
Activates the service EMPLOYEE_TRAVEL_PLANNING_EXTERNAL_12 on the Trips and Expenses area page in the ESS of SAP NetWeaver Portal, and hides other services of SAP Travel Planning.
  • ADD_POWL_SYNC
In the POWL query for travel plans, this method imports the Passenger Name Records (PNR) that have been created or changed within the last three days, from GetThere into SAP Travel Planning. When data is refreshed, the system displays the PNRs that belong to the personnel number of the user in the POWL query for travel plans (FITV_POWL_TRIPS_TP).
  • CONTROL_PLAN_CANCEL_DELETE
When a user wants to delete a travel plan that contains bookings in a third-party travel planning system, this method issues the error message First cancel all travel services in third-party travel planning (FITP 496). Prior to this, the method imports the current PNRs using the Record Locator from GetThere to make sure that the current state of the bookings in GetThere is being analyzed.
  • CHANGE_POWL_ACTIONS
Changes the labels of the following pushbuttons in the POWL query for travel plans:
  • Pushbutton Change -> Change/Cancel

  • Pushbutton Cancel/Delete -> Delete

The background for this change is as follows: A user can delete a travel plan with bookings from third-party travel planning only if those bookings were canceled beforehand. But this is only possible if the user calls the third-party travel planning system in change mode and cancels the bookings.
  • CHANGE_POWL_OBJECT
Determines (using the trip status) whether the travel requests have been approved, and (regardless of that status) activates the link to the subsequent action (booking of travel services).
  • CHANGE_POWL_DETAIL_BUTTON
Changes the labels of the pushbuttons in the details of a travel plan as follows:
  • Pushbutton Change -> Change/Cancel

  • Pushbutton Cancel/Delete -> Delete

The background for this change is as follows: A user can delete a travel plan with bookings from third-party travel planning only if those bookings were canceled beforehand. But this is only possible if the user calls the third-party travel planning system in change mode and cancels the bookings.





Fill RESBD Structure from EBP Component Structure   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 17801 Date: 20240523 Time: 220057     sap01-206 ( 345 ms )