SAP AS_DATASOURCE_SELECT Function Module for
AS_DATASOURCE_SELECT is a standard as datasource select SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 as datasource select FM, simply by entering the name AS_DATASOURCE_SELECT into the relevant SAP transaction such as SE37 or SE38.
Function Group: AS_DATASOURCE
Program Name: SAPLAS_DATASOURCE
Main Program: SAPLAS_DATASOURCE
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function AS_DATASOURCE_SELECT 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 'AS_DATASOURCE_SELECT'".
EXPORTING
* I_DB_AND_ARC = 'X' "Data Element for Domain BOOLE: TRUE (='X') and FALSE (=' ')
* I_NO_SOURCE_SELECT = "Data Element for Domain BOOLE: TRUE (='X') and FALSE (=' ')
* I_INFOSYS_POSSIBLE = 'X' "Data Element for Domain BOOLE: TRUE (='X') and FALSE (=' ')
* I_DOCUMENTATION = 'DEFAULT' "Documentation Object
* I_REPORT = "ABAP Program Name
* I_REPORTTYPE = "Report type
* IT_OBJECTS = "
CHANGING
* C_USE_DATABASE = 'X' "Data Element for Domain BOOLE: TRUE (='X') and FALSE (=' ')
* C_USE_ARCHIVE = "Data Element for Domain BOOLE: TRUE (='X') and FALSE (=' ')
* C_USE_INFOSYS = 'X' "Data Element for Domain BOOLE: TRUE (='X') and FALSE (=' ')
* C_ARCHOBJ = "Archiving Object
* CT_ARCH_SEL = "Ranking table for archive file
EXCEPTIONS
WRONG_ARCHIVE_OBJECT = 1
IMPORTING Parameters details for AS_DATASOURCE_SELECT
I_DB_AND_ARC - Data Element for Domain BOOLE: TRUE (='X') and FALSE (=' ')
Data type: BOOLE_DDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_NO_SOURCE_SELECT - Data Element for Domain BOOLE: TRUE (='X') and FALSE (=' ')
Data type: BOOLE_DOptional: Yes
Call by Reference: No ( called with pass by value option)
I_INFOSYS_POSSIBLE - Data Element for Domain BOOLE: TRUE (='X') and FALSE (=' ')
Data type: BOOLE_DDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_DOCUMENTATION - Documentation Object
Data type: DOKHL-OBJECTDefault: 'DEFAULT'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_REPORT - ABAP Program Name
Data type: PROGNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
I_REPORTTYPE - Report type
Data type: REPORTTYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_OBJECTS -
Data type: AS_T_ARCHOBJOptional: Yes
Call by Reference: Yes
CHANGING Parameters details for AS_DATASOURCE_SELECT
C_USE_DATABASE - Data Element for Domain BOOLE: TRUE (='X') and FALSE (=' ')
Data type: BOOLE_DDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
C_USE_ARCHIVE - Data Element for Domain BOOLE: TRUE (='X') and FALSE (=' ')
Data type: BOOLE_DOptional: Yes
Call by Reference: No ( called with pass by value option)
C_USE_INFOSYS - Data Element for Domain BOOLE: TRUE (='X') and FALSE (=' ')
Data type: BOOLE_DDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
C_ARCHOBJ - Archiving Object
Data type: ARCH_OBJ-OBJECTOptional: Yes
Call by Reference: No ( called with pass by value option)
CT_ARCH_SEL - Ranking table for archive file
Data type: AS_T_RNG_ARCHIVOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
WRONG_ARCHIVE_OBJECT -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for AS_DATASOURCE_SELECT 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_i_db_and_arc | TYPE BOOLE_D, " 'X' | |||
| lv_c_use_database | TYPE BOOLE_D, " 'X' | |||
| lv_wrong_archive_object | TYPE BOOLE_D, " | |||
| lv_c_use_archive | TYPE BOOLE_D, " | |||
| lv_i_no_source_select | TYPE BOOLE_D, " | |||
| lv_c_use_infosys | TYPE BOOLE_D, " 'X' | |||
| lv_i_infosys_possible | TYPE BOOLE_D, " 'X' | |||
| lv_c_archobj | TYPE ARCH_OBJ-OBJECT, " | |||
| lv_i_documentation | TYPE DOKHL-OBJECT, " 'DEFAULT' | |||
| lv_i_report | TYPE PROGNAME, " | |||
| lv_ct_arch_sel | TYPE AS_T_RNG_ARCHIV, " | |||
| lv_i_reporttype | TYPE REPORTTYPE, " | |||
| lv_it_objects | TYPE AS_T_ARCHOBJ. " |
|   CALL FUNCTION 'AS_DATASOURCE_SELECT' " |
| EXPORTING | ||
| I_DB_AND_ARC | = lv_i_db_and_arc | |
| I_NO_SOURCE_SELECT | = lv_i_no_source_select | |
| I_INFOSYS_POSSIBLE | = lv_i_infosys_possible | |
| I_DOCUMENTATION | = lv_i_documentation | |
| I_REPORT | = lv_i_report | |
| I_REPORTTYPE | = lv_i_reporttype | |
| IT_OBJECTS | = lv_it_objects | |
| CHANGING | ||
| C_USE_DATABASE | = lv_c_use_database | |
| C_USE_ARCHIVE | = lv_c_use_archive | |
| C_USE_INFOSYS | = lv_c_use_infosys | |
| C_ARCHOBJ | = lv_c_archobj | |
| CT_ARCH_SEL | = lv_ct_arch_sel | |
| EXCEPTIONS | ||
| WRONG_ARCHIVE_OBJECT = 1 | ||
| . " AS_DATASOURCE_SELECT | ||
ABAP code using 7.40 inline data declarations to call FM AS_DATASOURCE_SELECT
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.| DATA(ld_i_db_and_arc) | = 'X'. | |||
| DATA(ld_c_use_database) | = 'X'. | |||
| DATA(ld_c_use_infosys) | = 'X'. | |||
| DATA(ld_i_infosys_possible) | = 'X'. | |||
| "SELECT single OBJECT FROM ARCH_OBJ INTO @DATA(ld_c_archobj). | ||||
| "SELECT single OBJECT FROM DOKHL INTO @DATA(ld_i_documentation). | ||||
| DATA(ld_i_documentation) | = 'DEFAULT'. | |||
Search for further information about these or an SAP related objects