SAP MDG_BOOK_CREATE Function Module for MDG: Create Single FLIGHT 1
MDG_BOOK_CREATE is a standard mdg book 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 1 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 book create FM, simply by entering the name MDG_BOOK_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_BOOK_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_BOOK_CREATE'"MDG: Create Single FLIGHT 1.
EXPORTING
IV_CARRID = "Airline Code
* IV_INVOICE = "Invoice flag
* IV_CLASS = "Flight Class
* IV_FORCURAM = "Booking price in foreign currency (dependent on location)
* IV_FORCURKEY = "Payment currency
* IV_LOCCURAM = "Price of booking in local currency of airline
* IV_LOCCURKEY = "Local currency of airline
* IV_ORDER_DATE = "Booking Date
* IV_COUNTER = "Number of sales office
* IV_AGENCYNUM = "Travel Agency Number
* IV_CANCELLED = "Cancelation flag
IV_CONNID = "Flight Connection Number
* IV_RESERVED = "Reservation flag
* IV_PASSNAME = "Name of the Passenger
* IV_PASSFORM = "Form of address
* IV_PASSBIRTH = "Date of Birth of a Passenger
* IV_TESTRUN = ' ' "Switch to Simulation Session for Write BAPIs
IV_FLDATE = "Flight date
IV_BOOKID = "Booking number
* IV_CUSTOMID = "Customer Number
* IV_CUSTTYPE = "Customer type
* IV_SMOKER = "Smoker
* IV_LUGGWEIGHT = "Weight of Luggage
* IV_WUNIT = "Weight Unit
IMPORTING
RETURN = "Table with BAPI Return Information
IMPORTING Parameters details for MDG_BOOK_CREATE
IV_CARRID - Airline Code
Data type: S_CARR_IDOptional: No
Call by Reference: Yes
IV_INVOICE - Invoice flag
Data type: S_INVFLAGOptional: Yes
Call by Reference: Yes
IV_CLASS - Flight Class
Data type: S_CLASSOptional: Yes
Call by Reference: Yes
IV_FORCURAM - Booking price in foreign currency (dependent on location)
Data type: S_F_CUR_PROptional: Yes
Call by Reference: Yes
IV_FORCURKEY - Payment currency
Data type: S_CURROptional: Yes
Call by Reference: Yes
IV_LOCCURAM - Price of booking in local currency of airline
Data type: S_L_CUR_PROptional: Yes
Call by Reference: Yes
IV_LOCCURKEY - Local currency of airline
Data type: S_CURRCODEOptional: Yes
Call by Reference: Yes
IV_ORDER_DATE - Booking Date
Data type: S_BDATEOptional: Yes
Call by Reference: Yes
IV_COUNTER - Number of sales office
Data type: S_COUNTNUMOptional: Yes
Call by Reference: Yes
IV_AGENCYNUM - Travel Agency Number
Data type: S_AGNCYNUMOptional: Yes
Call by Reference: Yes
IV_CANCELLED - Cancelation flag
Data type: S_CANCELOptional: Yes
Call by Reference: Yes
IV_CONNID - Flight Connection Number
Data type: S_CONN_IDOptional: No
Call by Reference: Yes
IV_RESERVED - Reservation flag
Data type: S_RESERVOptional: Yes
Call by Reference: Yes
IV_PASSNAME - Name of the Passenger
Data type: S_PASSNAMEOptional: Yes
Call by Reference: Yes
IV_PASSFORM - Form of address
Data type: S_FORMOptional: Yes
Call by Reference: Yes
IV_PASSBIRTH - Date of Birth of a Passenger
Data type: S_BIRTHDATOptional: Yes
Call by Reference: Yes
IV_TESTRUN - Switch to Simulation Session for Write BAPIs
Data type: SFL_AUX-TESTRUNDefault: SPACE
Optional: Yes
Call by Reference: Yes
IV_FLDATE - Flight date
Data type: S_DATEOptional: No
Call by Reference: Yes
IV_BOOKID - Booking number
Data type: S_BOOK_IDOptional: No
Call by Reference: Yes
IV_CUSTOMID - Customer Number
Data type: S_CUSTOMEROptional: Yes
Call by Reference: Yes
IV_CUSTTYPE - Customer type
Data type: S_CUSTTYPEOptional: Yes
Call by Reference: Yes
IV_SMOKER - Smoker
Data type: S_SMOKEROptional: Yes
Call by Reference: Yes
IV_LUGGWEIGHT - Weight of Luggage
Data type: S_LUGWEIGHOptional: Yes
Call by Reference: Yes
IV_WUNIT - Weight Unit
Data type: S_WEIUNITOptional: Yes
Call by Reference: Yes
EXPORTING Parameters details for MDG_BOOK_CREATE
RETURN - Table with BAPI Return Information
Data type: BAPIRETTABOptional: No
Call by Reference: Yes
Copy and paste ABAP code example for MDG_BOOK_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_carrid | TYPE S_CARR_ID, " | |||
| lv_iv_invoice | TYPE S_INVFLAG, " | |||
| lv_iv_class | TYPE S_CLASS, " | |||
| lv_iv_forcuram | TYPE S_F_CUR_PR, " | |||
| lv_iv_forcurkey | TYPE S_CURR, " | |||
| lv_iv_loccuram | TYPE S_L_CUR_PR, " | |||
| lv_iv_loccurkey | TYPE S_CURRCODE, " | |||
| lv_iv_order_date | TYPE S_BDATE, " | |||
| lv_iv_counter | TYPE S_COUNTNUM, " | |||
| lv_iv_agencynum | TYPE S_AGNCYNUM, " | |||
| lv_iv_cancelled | TYPE S_CANCEL, " | |||
| lv_iv_connid | TYPE S_CONN_ID, " | |||
| lv_iv_reserved | TYPE S_RESERV, " | |||
| lv_iv_passname | TYPE S_PASSNAME, " | |||
| lv_iv_passform | TYPE S_FORM, " | |||
| lv_iv_passbirth | TYPE S_BIRTHDAT, " | |||
| lv_iv_testrun | TYPE SFL_AUX-TESTRUN, " SPACE | |||
| lv_iv_fldate | TYPE S_DATE, " | |||
| lv_iv_bookid | TYPE S_BOOK_ID, " | |||
| lv_iv_customid | TYPE S_CUSTOMER, " | |||
| lv_iv_custtype | TYPE S_CUSTTYPE, " | |||
| lv_iv_smoker | TYPE S_SMOKER, " | |||
| lv_iv_luggweight | TYPE S_LUGWEIGH, " | |||
| lv_iv_wunit | TYPE S_WEIUNIT. " |
|   CALL FUNCTION 'MDG_BOOK_CREATE' "MDG: Create Single FLIGHT 1 |
| EXPORTING | ||
| IV_CARRID | = lv_iv_carrid | |
| IV_INVOICE | = lv_iv_invoice | |
| IV_CLASS | = lv_iv_class | |
| IV_FORCURAM | = lv_iv_forcuram | |
| IV_FORCURKEY | = lv_iv_forcurkey | |
| IV_LOCCURAM | = lv_iv_loccuram | |
| IV_LOCCURKEY | = lv_iv_loccurkey | |
| IV_ORDER_DATE | = lv_iv_order_date | |
| IV_COUNTER | = lv_iv_counter | |
| IV_AGENCYNUM | = lv_iv_agencynum | |
| IV_CANCELLED | = lv_iv_cancelled | |
| IV_CONNID | = lv_iv_connid | |
| IV_RESERVED | = lv_iv_reserved | |
| IV_PASSNAME | = lv_iv_passname | |
| IV_PASSFORM | = lv_iv_passform | |
| IV_PASSBIRTH | = lv_iv_passbirth | |
| IV_TESTRUN | = lv_iv_testrun | |
| IV_FLDATE | = lv_iv_fldate | |
| IV_BOOKID | = lv_iv_bookid | |
| IV_CUSTOMID | = lv_iv_customid | |
| IV_CUSTTYPE | = lv_iv_custtype | |
| IV_SMOKER | = lv_iv_smoker | |
| IV_LUGGWEIGHT | = lv_iv_luggweight | |
| IV_WUNIT | = lv_iv_wunit | |
| IMPORTING | ||
| RETURN | = lv_return | |
| . " MDG_BOOK_CREATE | ||
ABAP code using 7.40 inline data declarations to call FM MDG_BOOK_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