SAP MDG_FLIGHT_CREATE Function Module for MDG: Create Single FLIGHT
MDG_FLIGHT_CREATE is a standard mdg flight create SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for MDG: Create Single FLIGHT processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for mdg flight create FM, simply by entering the name MDG_FLIGHT_CREATE into the relevant SAP transaction such as SE37 or SE38.
Function Group: MDG_SAMPLE_IMPLEMENTATION
Program Name: SAPLMDG_SAMPLE_IMPLEMENTATION
Main Program: SAPLMDG_SAMPLE_IMPLEMENTATION
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function MDG_FLIGHT_CREATE pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'MDG_FLIGHT_CREATE'"MDG: Create Single FLIGHT.
EXPORTING
IV_CARR = "Airline Code
IV_SEATSMAX_B = "Maximum capacity in business class
IV_SEATSOCC_B = "Occupied seats in business class
IV_SEATSMAX_F = "Maximum capacity in first class
IV_SEATSOCC_F = "Occupied seats in first class
* IV_TESTRUN = ' ' "Switch to Simulation Session for Write BAPIs
IV_PFLI = "Flight Connection Number
IV_FLDATE = "Flight date
IV_PRICE = "Airfare
IV_CURRENCY = "Local currency of airline
IV_PLANETYPE = "Aircraft Type
IV_SEATSMAX = "Maximum capacity in economy class
IV_SEATSOCC = "Occupied seats in economy class
IV_PAYMENTSUM = "Total of current bookings
IMPORTING
RETURN = "Table with BAPI Return Information
IMPORTING Parameters details for MDG_FLIGHT_CREATE
IV_CARR - Airline Code
Data type: S_CARR_IDOptional: No
Call by Reference: Yes
IV_SEATSMAX_B - Maximum capacity in business class
Data type: S_SMAX_BOptional: No
Call by Reference: Yes
IV_SEATSOCC_B - Occupied seats in business class
Data type: S_SOCC_BOptional: No
Call by Reference: Yes
IV_SEATSMAX_F - Maximum capacity in first class
Data type: S_SMAX_FOptional: No
Call by Reference: Yes
IV_SEATSOCC_F - Occupied seats in first class
Data type: S_SOCC_FOptional: No
Call by Reference: Yes
IV_TESTRUN - Switch to Simulation Session for Write BAPIs
Data type: SFL_AUX-TESTRUNDefault: SPACE
Optional: No
Call by Reference: Yes
IV_PFLI - Flight Connection Number
Data type: S_CONN_IDOptional: No
Call by Reference: Yes
IV_FLDATE - Flight date
Data type: S_DATEOptional: No
Call by Reference: Yes
IV_PRICE - Airfare
Data type: S_PRICEOptional: No
Call by Reference: Yes
IV_CURRENCY - Local currency of airline
Data type: S_CURRCODEOptional: No
Call by Reference: Yes
IV_PLANETYPE - Aircraft Type
Data type: S_PLANETYEOptional: No
Call by Reference: Yes
IV_SEATSMAX - Maximum capacity in economy class
Data type: S_SEATSMAXOptional: No
Call by Reference: Yes
IV_SEATSOCC - Occupied seats in economy class
Data type: S_SEATSOCCOptional: No
Call by Reference: Yes
IV_PAYMENTSUM - Total of current bookings
Data type: S_SUMOptional: No
Call by Reference: Yes
EXPORTING Parameters details for MDG_FLIGHT_CREATE
RETURN - Table with BAPI Return Information
Data type: BAPIRETTABOptional: No
Call by Reference: Yes
Copy and paste ABAP code example for MDG_FLIGHT_CREATE Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_return | TYPE BAPIRETTAB, " | |||
| lv_iv_carr | TYPE S_CARR_ID, " | |||
| lv_iv_seatsmax_b | TYPE S_SMAX_B, " | |||
| lv_iv_seatsocc_b | TYPE S_SOCC_B, " | |||
| lv_iv_seatsmax_f | TYPE S_SMAX_F, " | |||
| lv_iv_seatsocc_f | TYPE S_SOCC_F, " | |||
| lv_iv_testrun | TYPE SFL_AUX-TESTRUN, " SPACE | |||
| lv_iv_pfli | TYPE S_CONN_ID, " | |||
| lv_iv_fldate | TYPE S_DATE, " | |||
| lv_iv_price | TYPE S_PRICE, " | |||
| lv_iv_currency | TYPE S_CURRCODE, " | |||
| lv_iv_planetype | TYPE S_PLANETYE, " | |||
| lv_iv_seatsmax | TYPE S_SEATSMAX, " | |||
| lv_iv_seatsocc | TYPE S_SEATSOCC, " | |||
| lv_iv_paymentsum | TYPE S_SUM. " |
|   CALL FUNCTION 'MDG_FLIGHT_CREATE' "MDG: Create Single FLIGHT |
| EXPORTING | ||
| IV_CARR | = lv_iv_carr | |
| IV_SEATSMAX_B | = lv_iv_seatsmax_b | |
| IV_SEATSOCC_B | = lv_iv_seatsocc_b | |
| IV_SEATSMAX_F | = lv_iv_seatsmax_f | |
| IV_SEATSOCC_F | = lv_iv_seatsocc_f | |
| IV_TESTRUN | = lv_iv_testrun | |
| IV_PFLI | = lv_iv_pfli | |
| IV_FLDATE | = lv_iv_fldate | |
| IV_PRICE | = lv_iv_price | |
| IV_CURRENCY | = lv_iv_currency | |
| IV_PLANETYPE | = lv_iv_planetype | |
| IV_SEATSMAX | = lv_iv_seatsmax | |
| IV_SEATSOCC | = lv_iv_seatsocc | |
| IV_PAYMENTSUM | = lv_iv_paymentsum | |
| IMPORTING | ||
| RETURN | = lv_return | |
| . " MDG_FLIGHT_CREATE | ||
ABAP code using 7.40 inline data declarations to call FM MDG_FLIGHT_CREATE
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single TESTRUN FROM SFL_AUX INTO @DATA(ld_iv_testrun). | ||||
| DATA(ld_iv_testrun) | = ' '. | |||
Search for further information about these or an SAP related objects