SAP BDL_GENERATE_INCLUDES Function Module for RFC download: Creates Includes to declare and fill Global Variables
BDL_GENERATE_INCLUDES is a standard bdl generate includes SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for RFC download: Creates Includes to declare and fill Global Variables 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 bdl generate includes FM, simply by entering the name BDL_GENERATE_INCLUDES into the relevant SAP transaction such as SE37 or SE38.
Function Group: BDL5
Program Name: SAPLBDL5
Main Program: SAPLBDL5
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function BDL_GENERATE_INCLUDES 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 'BDL_GENERATE_INCLUDES'"RFC download: Creates Includes to declare and fill Global Variables.
EXPORTING
* OPTION = ' ' "To create different parts of declaration include
* REPORT_NAME = 'BDLMTEST' "Name of test report
* POOL_NAME = 'BDLSAIF' "Include pool with data declaration of Global Var
* FILL_VAR_NAME = 'BDLSAIMP' "Include which fills Global Variables
* FILL_FORM_NAME = 'BDLSAIFO' "Include with forms to fill Global Variables
* COPY_VAR_NAME = 'BDLSACPY' "Include which copies Global Variables
* COPY_FORM_NAME = 'BDLSACFO' "Include with forms to copy Global Variables
* IF_REL3_NAME = 'IF' "Name of interface includes in 3.* releases
* IF_REL4_NAME = '/1CAGTF/IF' "Name of interface includes in releases >= 4.*
* COMMON_PART = ' ' "Data declaration as common part
* COMMON_NAME = ' ' "Name of common part
* CLUST_ID = ' ' "Clust_id to create include with interface data
* EXCEPT = '%EXCEPTION' "Variable name for exceptions
* RUNTIME = '%RUNTIME' "Variable name for runtime
* SYNTAX_CHECK = ' ' "Status of object
* WHENS_PER_CASE = '4' "Internal table, current line index
* SESSION = "Session description
* RELID = 'DL' "RELID in BDLDATCOL
* DEVCLASS = 'BDL3' "Development Class of generated includes
* DATCOL_TAB = 'BDLDATCOL' "Name of DB table for download data
* DTOC_TAB = 'BDLDTOC' "Name of DB table which contains download data
* DTOC_FIELD = 'FUNCMOD' "Field for selection
* KEY_TAB = 'BDL_DATKEY' "Key table for import from database
EXCEPTIONS
SYNTAX_ERROR = 1 GENERATION_ERROR = 2 LOCK_FAILED = 3 NO_AUTHORITY = 4 WRONG_OPTION = 5 WRONG_CLUST_ID = 6 WRONG_RELEASE = 7 WRONG_ABAP_TYPE = 8 IF_DATA_MISSING = 9
IMPORTING Parameters details for BDL_GENERATE_INCLUDES
OPTION - To create different parts of declaration include
Data type: BDLFUVERS-FUNCNAMEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
REPORT_NAME - Name of test report
Data type: RS38M-PROGRAMMDefault: 'BDLMTEST'
Optional: Yes
Call by Reference: No ( called with pass by value option)
POOL_NAME - Include pool with data declaration of Global Var
Data type: RS38M-PROGRAMMDefault: 'BDLSAIF'
Optional: Yes
Call by Reference: No ( called with pass by value option)
FILL_VAR_NAME - Include which fills Global Variables
Data type: RS38M-PROGRAMMDefault: 'BDLSAIMP'
Optional: Yes
Call by Reference: No ( called with pass by value option)
FILL_FORM_NAME - Include with forms to fill Global Variables
Data type: RS38M-PROGRAMMDefault: 'BDLSAIFO'
Optional: Yes
Call by Reference: No ( called with pass by value option)
COPY_VAR_NAME - Include which copies Global Variables
Data type: RS38M-PROGRAMMDefault: 'BDLSACPY'
Optional: Yes
Call by Reference: No ( called with pass by value option)
COPY_FORM_NAME - Include with forms to copy Global Variables
Data type: RS38M-PROGRAMMDefault: 'BDLSACFO'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IF_REL3_NAME - Name of interface includes in 3.* releases
Data type: BDLFUVERS-FUNCNAMEDefault: 'IF'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IF_REL4_NAME - Name of interface includes in releases >= 4.*
Data type: BDLFUVERS-FUNCNAMEDefault: '/1CAGTF/IF'
Optional: Yes
Call by Reference: No ( called with pass by value option)
COMMON_PART - Data declaration as common part
Data type: BDLFUVERS-STATUSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
COMMON_NAME - Name of common part
Data type: RS38M-PROGRAMMDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CLUST_ID - Clust_id to create include with interface data
Data type: BDLFUVERS-CLUST_IDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPT - Variable name for exceptions
Data type: DD02D-TABNAMEDefault: '%EXCEPTION'
Optional: Yes
Call by Reference: No ( called with pass by value option)
RUNTIME - Variable name for runtime
Data type: DD02D-TABNAMEDefault: '%RUNTIME'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SYNTAX_CHECK - Status of object
Data type: BDLFUVERS-STATUSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
WHENS_PER_CASE - Internal table, current line index
Data type: SY-TABIXDefault: '4'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SESSION - Session description
Data type: BDLDATKEYOptional: Yes
Call by Reference: No ( called with pass by value option)
RELID - RELID in BDLDATCOL
Data type: BDLDATCOL-RELIDDefault: 'DL'
Optional: Yes
Call by Reference: No ( called with pass by value option)
DEVCLASS - Development Class of generated includes
Data type: TADIR-DEVCLASSDefault: 'BDL3'
Optional: Yes
Call by Reference: No ( called with pass by value option)
DATCOL_TAB - Name of DB table for download data
Data type: DD02D-TABNAMEDefault: 'BDLDATCOL'
Optional: Yes
Call by Reference: No ( called with pass by value option)
DTOC_TAB - Name of DB table which contains download data
Data type: DD02D-TABNAMEDefault: 'BDLDTOC'
Optional: Yes
Call by Reference: No ( called with pass by value option)
DTOC_FIELD - Field for selection
Data type: DD03D-FIELDNAMEDefault: 'FUNCMOD'
Optional: Yes
Call by Reference: No ( called with pass by value option)
KEY_TAB - Key table for import from database
Data type: DD02D-TABNAMEDefault: 'BDL_DATKEY'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
SYNTAX_ERROR - Syntax error detected.
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
GENERATION_ERROR - Error occured during generation.
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
LOCK_FAILED - Lock failed for service maintenance tables.
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_AUTHORITY - No authorisation to run function.
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_OPTION - Unkown or wrong option.
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_CLUST_ID - Clust_id unknown.
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_RELEASE - Wrong R/3 release.
Data type:Optional: No
Call by Reference: Yes
WRONG_ABAP_TYPE - Wrong ABAP type found in table BDLSADATA.
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
IF_DATA_MISSING - No interface data found.
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for BDL_GENERATE_INCLUDES 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_option | TYPE BDLFUVERS-FUNCNAME, " SPACE | |||
| lv_syntax_error | TYPE BDLFUVERS, " | |||
| lv_report_name | TYPE RS38M-PROGRAMM, " 'BDLMTEST' | |||
| lv_pool_name | TYPE RS38M-PROGRAMM, " 'BDLSAIF' | |||
| lv_fill_var_name | TYPE RS38M-PROGRAMM, " 'BDLSAIMP' | |||
| lv_fill_form_name | TYPE RS38M-PROGRAMM, " 'BDLSAIFO' | |||
| lv_copy_var_name | TYPE RS38M-PROGRAMM, " 'BDLSACPY' | |||
| lv_copy_form_name | TYPE RS38M-PROGRAMM, " 'BDLSACFO' | |||
| lv_if_rel3_name | TYPE BDLFUVERS-FUNCNAME, " 'IF' | |||
| lv_if_rel4_name | TYPE BDLFUVERS-FUNCNAME, " '/1CAGTF/IF' | |||
| lv_common_part | TYPE BDLFUVERS-STATUS, " SPACE | |||
| lv_common_name | TYPE RS38M-PROGRAMM, " SPACE | |||
| lv_clust_id | TYPE BDLFUVERS-CLUST_ID, " SPACE | |||
| lv_generation_error | TYPE BDLFUVERS, " | |||
| lv_except | TYPE DD02D-TABNAME, " '%EXCEPTION' | |||
| lv_runtime | TYPE DD02D-TABNAME, " '%RUNTIME' | |||
| lv_syntax_check | TYPE BDLFUVERS-STATUS, " SPACE | |||
| lv_whens_per_case | TYPE SY-TABIX, " '4' | |||
| lv_session | TYPE BDLDATKEY, " | |||
| lv_lock_failed | TYPE BDLDATKEY, " | |||
| lv_relid | TYPE BDLDATCOL-RELID, " 'DL' | |||
| lv_no_authority | TYPE BDLDATCOL, " | |||
| lv_devclass | TYPE TADIR-DEVCLASS, " 'BDL3' | |||
| lv_wrong_option | TYPE TADIR, " | |||
| lv_datcol_tab | TYPE DD02D-TABNAME, " 'BDLDATCOL' | |||
| lv_wrong_clust_id | TYPE DD02D, " | |||
| lv_dtoc_tab | TYPE DD02D-TABNAME, " 'BDLDTOC' | |||
| lv_wrong_release | TYPE DD02D, " | |||
| lv_dtoc_field | TYPE DD03D-FIELDNAME, " 'FUNCMOD' | |||
| lv_wrong_abap_type | TYPE DD03D, " | |||
| lv_key_tab | TYPE DD02D-TABNAME, " 'BDL_DATKEY' | |||
| lv_if_data_missing | TYPE DD02D. " |
|   CALL FUNCTION 'BDL_GENERATE_INCLUDES' "RFC download: Creates Includes to declare and fill Global Variables |
| EXPORTING | ||
| OPTION | = lv_option | |
| REPORT_NAME | = lv_report_name | |
| POOL_NAME | = lv_pool_name | |
| FILL_VAR_NAME | = lv_fill_var_name | |
| FILL_FORM_NAME | = lv_fill_form_name | |
| COPY_VAR_NAME | = lv_copy_var_name | |
| COPY_FORM_NAME | = lv_copy_form_name | |
| IF_REL3_NAME | = lv_if_rel3_name | |
| IF_REL4_NAME | = lv_if_rel4_name | |
| COMMON_PART | = lv_common_part | |
| COMMON_NAME | = lv_common_name | |
| CLUST_ID | = lv_clust_id | |
| EXCEPT | = lv_except | |
| RUNTIME | = lv_runtime | |
| SYNTAX_CHECK | = lv_syntax_check | |
| WHENS_PER_CASE | = lv_whens_per_case | |
| SESSION | = lv_session | |
| RELID | = lv_relid | |
| DEVCLASS | = lv_devclass | |
| DATCOL_TAB | = lv_datcol_tab | |
| DTOC_TAB | = lv_dtoc_tab | |
| DTOC_FIELD | = lv_dtoc_field | |
| KEY_TAB | = lv_key_tab | |
| EXCEPTIONS | ||
| SYNTAX_ERROR = 1 | ||
| GENERATION_ERROR = 2 | ||
| LOCK_FAILED = 3 | ||
| NO_AUTHORITY = 4 | ||
| WRONG_OPTION = 5 | ||
| WRONG_CLUST_ID = 6 | ||
| WRONG_RELEASE = 7 | ||
| WRONG_ABAP_TYPE = 8 | ||
| IF_DATA_MISSING = 9 | ||
| . " BDL_GENERATE_INCLUDES | ||
ABAP code using 7.40 inline data declarations to call FM BDL_GENERATE_INCLUDES
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 FUNCNAME FROM BDLFUVERS INTO @DATA(ld_option). | ||||
| DATA(ld_option) | = ' '. | |||
| "SELECT single PROGRAMM FROM RS38M INTO @DATA(ld_report_name). | ||||
| DATA(ld_report_name) | = 'BDLMTEST'. | |||
| "SELECT single PROGRAMM FROM RS38M INTO @DATA(ld_pool_name). | ||||
| DATA(ld_pool_name) | = 'BDLSAIF'. | |||
| "SELECT single PROGRAMM FROM RS38M INTO @DATA(ld_fill_var_name). | ||||
| DATA(ld_fill_var_name) | = 'BDLSAIMP'. | |||
| "SELECT single PROGRAMM FROM RS38M INTO @DATA(ld_fill_form_name). | ||||
| DATA(ld_fill_form_name) | = 'BDLSAIFO'. | |||
| "SELECT single PROGRAMM FROM RS38M INTO @DATA(ld_copy_var_name). | ||||
| DATA(ld_copy_var_name) | = 'BDLSACPY'. | |||
| "SELECT single PROGRAMM FROM RS38M INTO @DATA(ld_copy_form_name). | ||||
| DATA(ld_copy_form_name) | = 'BDLSACFO'. | |||
| "SELECT single FUNCNAME FROM BDLFUVERS INTO @DATA(ld_if_rel3_name). | ||||
| DATA(ld_if_rel3_name) | = 'IF'. | |||
| "SELECT single FUNCNAME FROM BDLFUVERS INTO @DATA(ld_if_rel4_name). | ||||
| DATA(ld_if_rel4_name) | = '/1CAGTF/IF'. | |||
| "SELECT single STATUS FROM BDLFUVERS INTO @DATA(ld_common_part). | ||||
| DATA(ld_common_part) | = ' '. | |||
| "SELECT single PROGRAMM FROM RS38M INTO @DATA(ld_common_name). | ||||
| DATA(ld_common_name) | = ' '. | |||
| "SELECT single CLUST_ID FROM BDLFUVERS INTO @DATA(ld_clust_id). | ||||
| DATA(ld_clust_id) | = ' '. | |||
| "SELECT single TABNAME FROM DD02D INTO @DATA(ld_except). | ||||
| DATA(ld_except) | = '%EXCEPTION'. | |||
| "SELECT single TABNAME FROM DD02D INTO @DATA(ld_runtime). | ||||
| DATA(ld_runtime) | = '%RUNTIME'. | |||
| "SELECT single STATUS FROM BDLFUVERS INTO @DATA(ld_syntax_check). | ||||
| DATA(ld_syntax_check) | = ' '. | |||
| "SELECT single TABIX FROM SY INTO @DATA(ld_whens_per_case). | ||||
| DATA(ld_whens_per_case) | = '4'. | |||
| "SELECT single RELID FROM BDLDATCOL INTO @DATA(ld_relid). | ||||
| DATA(ld_relid) | = 'DL'. | |||
| "SELECT single DEVCLASS FROM TADIR INTO @DATA(ld_devclass). | ||||
| DATA(ld_devclass) | = 'BDL3'. | |||
| "SELECT single TABNAME FROM DD02D INTO @DATA(ld_datcol_tab). | ||||
| DATA(ld_datcol_tab) | = 'BDLDATCOL'. | |||
| "SELECT single TABNAME FROM DD02D INTO @DATA(ld_dtoc_tab). | ||||
| DATA(ld_dtoc_tab) | = 'BDLDTOC'. | |||
| "SELECT single FIELDNAME FROM DD03D INTO @DATA(ld_dtoc_field). | ||||
| DATA(ld_dtoc_field) | = 'FUNCMOD'. | |||
| "SELECT single TABNAME FROM DD02D INTO @DATA(ld_key_tab). | ||||
| DATA(ld_key_tab) | = 'BDL_DATKEY'. | |||
Search for further information about these or an SAP related objects