SAP Function Modules

TP_1G_FARE_QUOTE SAP Function module







TP_1G_FARE_QUOTE 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 TP_1G_FARE_QUOTE into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM TP_1G_FARE_QUOTE - TP 1G FARE QUOTE





CALL FUNCTION 'TP_1G_FARE_QUOTE' "
  EXPORTING
    context_number =            " variant_nr
    corp_pricing_id =           " corp_nego_id
    sw_restricted_fare =        " xfeld
    fixed_booking_class =       " char2
    sw_corporate_price =        " xfeld
    currency =                  " waers
    plating_carrier =           " ta21p-provider
*   fare_basis =                " char16
*   sw_best_buy_option =        " xfeld
  IMPORTING
    required_ticketing_date =   " sy-datum
    sw_refundable =             " xfeld
    endorsable =                " char1
    cancellation_fee =          " cancellation_fee
    full_fare =                 " full_fare
  TABLES
    t_rebates =                 " ta20rebf
    t_flight =                  " ftpt_flight
    t_fare_comp =               " ftpt_fare_comp
    t_flight_fcmp =             " ftpt_flight_fcmp
    t_flight_tstk =             " ftpt_flight_tstk
    t_advisories =              " ftpt_var_info
  EXCEPTIONS
    PRICING_FAILED = 1          "
    NO_DESTINATION = 2          "
    INVALID_CONTEXT = 3         "
    CONNECTION_ERROR = 4        "
    RFC_ERROR = 5               "
    GENERAL_API_ERROR = 6       "
    .  "  TP_1G_FARE_QUOTE

ABAP code example for Function Module TP_1G_FARE_QUOTE





The ABAP code below is a full code listing to execute function module TP_1G_FARE_QUOTE 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_required_ticketing_date  TYPE SY-DATUM ,
ld_sw_refundable  TYPE XFELD ,
ld_endorsable  TYPE CHAR1 ,
ld_cancellation_fee  TYPE CANCELLATION_FEE ,
ld_full_fare  TYPE FULL_FARE ,
it_t_rebates  TYPE STANDARD TABLE OF TA20REBF,"TABLES PARAM
wa_t_rebates  LIKE LINE OF it_t_rebates ,
it_t_flight  TYPE STANDARD TABLE OF FTPT_FLIGHT,"TABLES PARAM
wa_t_flight  LIKE LINE OF it_t_flight ,
it_t_fare_comp  TYPE STANDARD TABLE OF FTPT_FARE_COMP,"TABLES PARAM
wa_t_fare_comp  LIKE LINE OF it_t_fare_comp ,
it_t_flight_fcmp  TYPE STANDARD TABLE OF FTPT_FLIGHT_FCMP,"TABLES PARAM
wa_t_flight_fcmp  LIKE LINE OF it_t_flight_fcmp ,
it_t_flight_tstk  TYPE STANDARD TABLE OF FTPT_FLIGHT_TSTK,"TABLES PARAM
wa_t_flight_tstk  LIKE LINE OF it_t_flight_tstk ,
it_t_advisories  TYPE STANDARD TABLE OF FTPT_VAR_INFO,"TABLES PARAM
wa_t_advisories  LIKE LINE OF it_t_advisories .

DATA(ld_context_number) = 'Check type of data required'.
DATA(ld_corp_pricing_id) = 'Check type of data required'.
DATA(ld_sw_restricted_fare) = 'Check type of data required'.
DATA(ld_fixed_booking_class) = 'Check type of data required'.
DATA(ld_sw_corporate_price) = 'Check type of data required'.
DATA(ld_currency) = 'Check type of data required'.

SELECT single PROVIDER
FROM TA21P
INTO @DATA(ld_plating_carrier).

DATA(ld_fare_basis) = 'Check type of data required'.
DATA(ld_sw_best_buy_option) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_rebates to it_t_rebates.

"populate fields of struture and append to itab
append wa_t_flight to it_t_flight.

"populate fields of struture and append to itab
append wa_t_fare_comp to it_t_fare_comp.

"populate fields of struture and append to itab
append wa_t_flight_fcmp to it_t_flight_fcmp.

"populate fields of struture and append to itab
append wa_t_flight_tstk to it_t_flight_tstk.

"populate fields of struture and append to itab
append wa_t_advisories to it_t_advisories. . CALL FUNCTION 'TP_1G_FARE_QUOTE' EXPORTING context_number = ld_context_number corp_pricing_id = ld_corp_pricing_id sw_restricted_fare = ld_sw_restricted_fare fixed_booking_class = ld_fixed_booking_class sw_corporate_price = ld_sw_corporate_price currency = ld_currency plating_carrier = ld_plating_carrier * fare_basis = ld_fare_basis * sw_best_buy_option = ld_sw_best_buy_option IMPORTING required_ticketing_date = ld_required_ticketing_date sw_refundable = ld_sw_refundable endorsable = ld_endorsable cancellation_fee = ld_cancellation_fee full_fare = ld_full_fare TABLES t_rebates = it_t_rebates t_flight = it_t_flight t_fare_comp = it_t_fare_comp t_flight_fcmp = it_t_flight_fcmp t_flight_tstk = it_t_flight_tstk t_advisories = it_t_advisories EXCEPTIONS PRICING_FAILED = 1 NO_DESTINATION = 2 INVALID_CONTEXT = 3 CONNECTION_ERROR = 4 RFC_ERROR = 5 GENERAL_API_ERROR = 6 . " TP_1G_FARE_QUOTE
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here 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_required_ticketing_date  TYPE SY-DATUM ,
ld_context_number  TYPE VARIANT_NR ,
it_t_rebates  TYPE STANDARD TABLE OF TA20REBF ,
wa_t_rebates  LIKE LINE OF it_t_rebates,
ld_sw_refundable  TYPE XFELD ,
ld_corp_pricing_id  TYPE CORP_NEGO_ID ,
it_t_flight  TYPE STANDARD TABLE OF FTPT_FLIGHT ,
wa_t_flight  LIKE LINE OF it_t_flight,
ld_endorsable  TYPE CHAR1 ,
ld_sw_restricted_fare  TYPE XFELD ,
it_t_fare_comp  TYPE STANDARD TABLE OF FTPT_FARE_COMP ,
wa_t_fare_comp  LIKE LINE OF it_t_fare_comp,
it_t_flight_fcmp  TYPE STANDARD TABLE OF FTPT_FLIGHT_FCMP ,
wa_t_flight_fcmp  LIKE LINE OF it_t_flight_fcmp,
ld_fixed_booking_class  TYPE CHAR2 ,
ld_cancellation_fee  TYPE CANCELLATION_FEE ,
ld_sw_corporate_price  TYPE XFELD ,
it_t_flight_tstk  TYPE STANDARD TABLE OF FTPT_FLIGHT_TSTK ,
wa_t_flight_tstk  LIKE LINE OF it_t_flight_tstk,
ld_full_fare  TYPE FULL_FARE ,
ld_currency  TYPE WAERS ,
it_t_advisories  TYPE STANDARD TABLE OF FTPT_VAR_INFO ,
wa_t_advisories  LIKE LINE OF it_t_advisories,
ld_plating_carrier  TYPE TA21P-PROVIDER ,
ld_fare_basis  TYPE CHAR16 ,
ld_sw_best_buy_option  TYPE XFELD .

ld_context_number = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_rebates to it_t_rebates.
ld_corp_pricing_id = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_flight to it_t_flight.
ld_sw_restricted_fare = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_fare_comp to it_t_fare_comp.

"populate fields of struture and append to itab
append wa_t_flight_fcmp to it_t_flight_fcmp.
ld_fixed_booking_class = 'Check type of data required'.
ld_sw_corporate_price = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_flight_tstk to it_t_flight_tstk.
ld_currency = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_advisories to it_t_advisories.

SELECT single PROVIDER
FROM TA21P
INTO ld_plating_carrier.

ld_fare_basis = 'Check type of data required'.
ld_sw_best_buy_option = '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 TP_1G_FARE_QUOTE or its description.