cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Travel add receipt comments/remarks in the editor field

Former Member
0 Kudos

Hi, Experts,

I hope somebody can give me some advise on the following.

We have the comments/remarks field available on GUI in the Create Travel Request Screen.

I use the following FM to create a new trip with receipts.

CALL FUNCTION 'BAPI_TRIP_CREATE_FROM_DATA'

           EXPORTING

             employeenumber = lv_pnr

             framedata      = ls_framedata

*       STATUS                   =

*       BATCH_SESSION_NAME       = ''

*       CHANGE                   =  "von wem geändert

*        BATCH_INPUT_ONLY         = ''

          IMPORTING

            return                   = ls_bapi_return

*       EMPLOYEENUMBER           = lv_pnr

            tripnumber               = ls_new_tripnr

          TABLES

            receipts                 = lt_expense

*       ADDINFO                  = "Beleg Zusatzinfos

*       ADVANCE                  = "Vorschuss

            text                     = lt_text

            mileage                  = lt_mileage

            stopover                 = lt_next_travel

            deductions               = lt_deductions

*       COSTDIST_TRIP            = "Kontierungen

*       COSTDIST_STOP            =

*       COSTDIST_RECE            =

*       COSTDIST_MILE            =

      .

I am trying to store values in the field comments/remarks. 

I fill the table text with the TEXTID = R001 and the TEXTLINE = "TEST" (as example for receipt 001),

but the field in SAP still empty and the value is in the PRTE not stored.

Can somebody give me a way to do this?

Regards

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

TEXTID = TEXT is to store the description of the trip. Not the remarks.

If I store the a remark directly in SAP and I use the FM  BAPI_TRIP_GET_DETAILS, I get the TEXTID R001 for receipt 001, R002 for the receipt 002 ...

Thats why I use R001 as TEXTID. But in this way it is not working.

@Lukas for receipt 001 I use R001 and it is not working.

Thank you for your reply.

Regards,

Former Member
0 Kudos

ooooooooooooooooooooooooh ok

Then do you have this checked in V_T706S for your trip schema ?

Lukas_Weigelt
Active Contributor
0 Kudos

Looking at the source code, there are some really sloppy checks against sy-subrc. Apparently data for the remarks is discarded dependent on what's stored inside the "additional information". Debug LHRTRF04 around line 1878 at the statement "READ TABLE p_addinfo WITH KEY receiptno = p_receipts-receiptno." to find out why the data from the remarks is being ignored.

Cheers, Lukas

Former Member
0 Kudos

Hi Mathieu,

yes it is checked.

Former Member
0 Kudos

Two options left :

- OSS notes (check if some are applied in your system like "1798046 - The number is not filled from bapi_trip_create_from_data")

- debug as Lukas suggested

Lukas_Weigelt
Active Contributor
0 Kudos

- debug as Lukas suggested

It makes things so much easier because you can actually see what happens instead of blindly making assumptions.

@ Hervé, one more thing comes to mind before raising a message. You should trace your process with ANST, to rule out this is a standard error where there is already a standard correction available:

Cheers, Lukas

Lukas_Weigelt
Active Contributor
0 Kudos

Hi Hervé,

aside from the fact that your gasoline receipt in your screenshot has the number 002, i.e. it would be identifier "R002" and not "R001", I don't see any particular mistake.

Can you please check it's not just a typo?

Cheers, Lukas

Former Member
0 Kudos

Hello

Try with TEXTID = TEXT

Mathieu

Lukas_Weigelt
Active Contributor
0 Kudos

Mathieu, I was just about to post the exact same as you when I realized he doesn't want to write to ZWECK but to the receipt remakrs commentary field .

Hivemind.

Cheers, Lukas