cancel
Showing results for 
Search instead for 
Did you mean: 

How to Modify Travel Request Services

Former Member
0 Kudos

Hi guys,

In our system we have do not have enable Travel Planning. We're using Travel Services to enter Basic Information. The thing is that the Travel Coordinator wants to be able to modify the Travel Services entered by the employee during the Approval Process.

I just copied workflow 20000050, and I've added a Form Step:

I would like to know what's the best way to modify these services. Is there a BAPI, or a FM to accomplish it?

Thanks,

Raúl

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I ended up using a Form Step within the workflow.Travel services can be saved using FM PTRA_WEB_EXPENSE_REPORT_SAVE_2. SAP hasn't released a BAPI for this matter.

If it's useful for someone, here it is what I did:


   DATA: wa_general_data_ext TYPE ptrv_web_general_data_ext,

         wa_general_data TYPE ptrv_web_general_data_int,

         it_service TYPE STANDARD TABLE OF ftps_web_request_service,

         it_return TYPE  bapirettab,

         wa_return TYPE bapiret2,

         v_saved_success TYPE xfeld.

   FIELD-SYMBOLS: <fs_service> LIKE LINE OF it_service.

* Merge Travel Services

   APPEND LINES OF it_flight TO it_service.

   APPEND LINES OF it_hotel TO it_service.

   APPEND LINES OF it_car TO it_service.

   LOOP AT it_service ASSIGNING <fs_service> WHERE request IS INITIAL.

     PERFORM calculate_estimated_cost.

     <fs_service>-request = v_next_number.

     ADD 1 TO v_next_number.

   ENDLOOP.

* Move Estimated Cost

   CALL FUNCTION 'PTRA_WEB_GENERAL_DATA_GET'

     EXPORTING

       i_employeenumber = ftpt_req_head-pernr

       i_tripnumber    = ftpt_req_head-reinr

     IMPORTING

       e_general_data  = wa_general_data_ext

     TABLES

       et_return       = it_return.

   wa_general_data_ext-estimated_cost = v_tr_total.

   MOVE-CORRESPONDING wa_general_data_ext TO wa_general_data.

* Save Travel Request

   CALL FUNCTION 'PTRA_WEB_EXPENSE_REPORT_SAVE_2'

     EXPORTING

       i_employeenumber   = ftpt_req_head-pernr

       i_tripnumber       = ftpt_req_head-reinr

       i_trip_component   = 'R'

       i_general_data     = wa_general_data

       it_req_service     = it_service

     IMPORTING

       ev_saved_successful = v_saved_success

     TABLES

       et_return          = it_return.

Answers (1)

Answers (1)

Srikanth02
Active Contributor
0 Kudos

Hi Raul,

Correct me if I didnt understand your question correctly?

If employee has entered travel request details and this needs to be changed by travel coordinator ? Am I right.

Then you dont need BAPI. You have my team option and once you assign it to travel coordinator id, then can add the employee in my team and make the respective changes.

Please do let me know if you need further information.

Srikanth

Former Member
0 Kudos

Thanks for your reply Srikanth!

That's the situation. In addition, the company travel policies require 3 approvals. The second one is the revision by the Travel Coordinator, and right after that, it's supposed to go to the Division Manager. The Div. Manager is only interested in the total price, which is entered/modified by the Travel Coordinator.

That's why I decided to add a "Form Step" in the workflow.

Do you think "My Team" service is going to work in this case?

Regards,

Raúl

Srikanth02
Active Contributor
0 Kudos

Yes, it depends totally on the workflow, how you set it up.

Once the travel coordinator revises the travel form, only the total price along other details which is req. send it to the next level manager for approval.

Hope I am clear on this.

Srikanth

Former Member
0 Kudos

What do you mean by "my team" service is going to work?