SAP Function Modules

TRV_COMPARE_TR_AV SAP Function module







TRV_COMPARE_TR_AV is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name TRV_COMPARE_TR_AV into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: FITVPS_TG
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM TRV_COMPARE_TR_AV - TRV COMPARE TR AV





CALL FUNCTION 'TRV_COMPARE_TR_AV' "
  EXPORTING
    p_head =                    " ptp02
    p_perio =                   " ptp42
    h_ptrv_comp =               " ptrv_comp
    h_weg_kappung =             " ptk03-betrg
    h_eig_kappung =             " ptk03-betrg
    waers =                     " ptp42-waers   Currency
    h_trg_tagegeld =            " ptk03-betrg
    h_trg_uegeld =              " ptk03-betrg
    h_ttg_tagegeld =            " ptk03-betrg
    h_ttg_uegeld =              " ptk03-betrg
    h_verpfl_sum =              " ptk03-betrg
    h_wegstrecken =             " ptk03-betrg
    h_fahrtkosten =             " ptk03-betrg
    h_dienstantritt_tg =        " ptk03-betrg
    h_dienstantritt_uegeld =    " ptk03-betrg
    h_dienstrueckreise_tg =     " ptk03-betrg
    comp_g_receipt_nr =         " c
    h_massnahme =               " c
    dat_antritt =               " dats          Date in CHAR format
    dat_trg_beg =               " dats          Date in CHAR format
    dat_trg_end =               " dats          Date in CHAR format
    dat_ttg_beg =               " dats          Date in CHAR format
    dat_ttg_end =               " dats          Date in CHAR format
    dat_rueck =                 " dats          Date in CHAR format
    display_modus =             " c
  IMPORTING
    out_ptrv_comp =             " ptrv_comp     Comparison Calculation Results PS
    kap_betrag =                " ptk25-gbtfz
    create_receipt =            " c
    delete_receipt =            " c
    save_comp_data =            " c
    uhr_antritt =               " tims
    uhr_rueck =                 " tims
    kapp_loeschen =             " c             Delete Capping Document
    perio_aendern =             " c
    h_summe_fiktiv =            " ptk03-betrg
    h_summe_real =              " ptk03-betrg
  TABLES
    editor =                    " ptp71         Travel Management General Purpose Text Editor
    .  "  TRV_COMPARE_TR_AV

ABAP code example for Function Module TRV_COMPARE_TR_AV





The ABAP code below is a full code listing to execute function module TRV_COMPARE_TR_AV including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
ld_out_ptrv_comp  TYPE PTRV_COMP ,
ld_kap_betrag  TYPE PTK25-GBTFZ ,
ld_create_receipt  TYPE C ,
ld_delete_receipt  TYPE C ,
ld_save_comp_data  TYPE C ,
ld_uhr_antritt  TYPE TIMS ,
ld_uhr_rueck  TYPE TIMS ,
ld_kapp_loeschen  TYPE C ,
ld_perio_aendern  TYPE C ,
ld_h_summe_fiktiv  TYPE PTK03-BETRG ,
ld_h_summe_real  TYPE PTK03-BETRG ,
it_editor  TYPE STANDARD TABLE OF PTP71,"TABLES PARAM
wa_editor  LIKE LINE OF it_editor .

DATA(ld_p_head) = 'Check type of data required'.
DATA(ld_p_perio) = 'Check type of data required'.
DATA(ld_h_ptrv_comp) = 'Check type of data required'.

DATA(ld_h_weg_kappung) = 20.50

DATA(ld_h_eig_kappung) = 20.50

DATA(ld_waers) = Check type of data required

DATA(ld_h_trg_tagegeld) = 20.50

DATA(ld_h_trg_uegeld) = 20.50

DATA(ld_h_ttg_tagegeld) = 20.50

DATA(ld_h_ttg_uegeld) = 20.50

DATA(ld_h_verpfl_sum) = 20.50

DATA(ld_h_wegstrecken) = 20.50

DATA(ld_h_fahrtkosten) = 20.50

DATA(ld_h_dienstantritt_tg) = 20.50

DATA(ld_h_dienstantritt_uegeld) = 20.50

DATA(ld_h_dienstrueckreise_tg) = 20.50
DATA(ld_comp_g_receipt_nr) = 'Check type of data required'.
DATA(ld_h_massnahme) = 'Check type of data required'.
DATA(ld_dat_antritt) = 'Check type of data required'.
DATA(ld_dat_trg_beg) = 'Check type of data required'.
DATA(ld_dat_trg_end) = 'Check type of data required'.
DATA(ld_dat_ttg_beg) = 'Check type of data required'.
DATA(ld_dat_ttg_end) = 'Check type of data required'.
DATA(ld_dat_rueck) = 'Check type of data required'.
DATA(ld_display_modus) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_editor to it_editor. . CALL FUNCTION 'TRV_COMPARE_TR_AV' EXPORTING p_head = ld_p_head p_perio = ld_p_perio h_ptrv_comp = ld_h_ptrv_comp h_weg_kappung = ld_h_weg_kappung h_eig_kappung = ld_h_eig_kappung waers = ld_waers h_trg_tagegeld = ld_h_trg_tagegeld h_trg_uegeld = ld_h_trg_uegeld h_ttg_tagegeld = ld_h_ttg_tagegeld h_ttg_uegeld = ld_h_ttg_uegeld h_verpfl_sum = ld_h_verpfl_sum h_wegstrecken = ld_h_wegstrecken h_fahrtkosten = ld_h_fahrtkosten h_dienstantritt_tg = ld_h_dienstantritt_tg h_dienstantritt_uegeld = ld_h_dienstantritt_uegeld h_dienstrueckreise_tg = ld_h_dienstrueckreise_tg comp_g_receipt_nr = ld_comp_g_receipt_nr h_massnahme = ld_h_massnahme dat_antritt = ld_dat_antritt dat_trg_beg = ld_dat_trg_beg dat_trg_end = ld_dat_trg_end dat_ttg_beg = ld_dat_ttg_beg dat_ttg_end = ld_dat_ttg_end dat_rueck = ld_dat_rueck display_modus = ld_display_modus IMPORTING out_ptrv_comp = ld_out_ptrv_comp kap_betrag = ld_kap_betrag create_receipt = ld_create_receipt delete_receipt = ld_delete_receipt save_comp_data = ld_save_comp_data uhr_antritt = ld_uhr_antritt uhr_rueck = ld_uhr_rueck kapp_loeschen = ld_kapp_loeschen perio_aendern = ld_perio_aendern h_summe_fiktiv = ld_h_summe_fiktiv h_summe_real = ld_h_summe_real TABLES editor = it_editor . " TRV_COMPARE_TR_AV
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_out_ptrv_comp  TYPE PTRV_COMP ,
it_editor  TYPE STANDARD TABLE OF PTP71 ,
wa_editor  LIKE LINE OF it_editor,
ld_p_head  TYPE PTP02 ,
ld_kap_betrag  TYPE PTK25-GBTFZ ,
ld_p_perio  TYPE PTP42 ,
ld_create_receipt  TYPE C ,
ld_h_ptrv_comp  TYPE PTRV_COMP ,
ld_delete_receipt  TYPE C ,
ld_h_weg_kappung  TYPE PTK03-BETRG ,
ld_save_comp_data  TYPE C ,
ld_h_eig_kappung  TYPE PTK03-BETRG ,
ld_uhr_antritt  TYPE TIMS ,
ld_waers  TYPE PTP42-WAERS ,
ld_uhr_rueck  TYPE TIMS ,
ld_h_trg_tagegeld  TYPE PTK03-BETRG ,
ld_h_trg_uegeld  TYPE PTK03-BETRG ,
ld_kapp_loeschen  TYPE C ,
ld_perio_aendern  TYPE C ,
ld_h_ttg_tagegeld  TYPE PTK03-BETRG ,
ld_h_summe_fiktiv  TYPE PTK03-BETRG ,
ld_h_ttg_uegeld  TYPE PTK03-BETRG ,
ld_h_summe_real  TYPE PTK03-BETRG ,
ld_h_verpfl_sum  TYPE PTK03-BETRG ,
ld_h_wegstrecken  TYPE PTK03-BETRG ,
ld_h_fahrtkosten  TYPE PTK03-BETRG ,
ld_h_dienstantritt_tg  TYPE PTK03-BETRG ,
ld_h_dienstantritt_uegeld  TYPE PTK03-BETRG ,
ld_h_dienstrueckreise_tg  TYPE PTK03-BETRG ,
ld_comp_g_receipt_nr  TYPE C ,
ld_h_massnahme  TYPE C ,
ld_dat_antritt  TYPE DATS ,
ld_dat_trg_beg  TYPE DATS ,
ld_dat_trg_end  TYPE DATS ,
ld_dat_ttg_beg  TYPE DATS ,
ld_dat_ttg_end  TYPE DATS ,
ld_dat_rueck  TYPE DATS ,
ld_display_modus  TYPE C .


"populate fields of struture and append to itab
append wa_editor to it_editor.
ld_p_head = 'Check type of data required'.
ld_p_perio = 'Check type of data required'.
ld_h_ptrv_comp = 'Check type of data required'.

ld_h_weg_kappung = 20.50

ld_h_eig_kappung = 20.50

ld_waers = Check type of data required

ld_h_trg_tagegeld = 20.50

ld_h_trg_uegeld = 20.50

ld_h_ttg_tagegeld = 20.50

ld_h_ttg_uegeld = 20.50

ld_h_verpfl_sum = 20.50

ld_h_wegstrecken = 20.50

ld_h_fahrtkosten = 20.50

ld_h_dienstantritt_tg = 20.50

ld_h_dienstantritt_uegeld = 20.50

ld_h_dienstrueckreise_tg = 20.50
ld_comp_g_receipt_nr = 'Check type of data required'.
ld_h_massnahme = 'Check type of data required'.
ld_dat_antritt = 'Check type of data required'.
ld_dat_trg_beg = 'Check type of data required'.
ld_dat_trg_end = 'Check type of data required'.
ld_dat_ttg_beg = 'Check type of data required'.
ld_dat_ttg_end = 'Check type of data required'.
ld_dat_rueck = 'Check type of data required'.
ld_display_modus = 'Check type of data required'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name TRV_COMPARE_TR_AV or its description.