SAP DB_CREATE_ALIAS_S Function Module for









DB_CREATE_ALIAS_S is a standard db create alias s 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 db create alias s FM, simply by entering the name DB_CREATE_ALIAS_S into the relevant SAP transaction such as SE37 or SE38.

Function Group: SDB22
Program Name: SAPLSDB22
Main Program: SAPLSDB22
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function DB_CREATE_ALIAS_S 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 'DB_CREATE_ALIAS_S'"
EXPORTING
ALIASNAME = "
DBREFNAME = "
* SCHEMA_NAME = '_SYS_BIC' "
* NO_EXEC = ABAP_TRUE "
* DB_CHECK_FLAG = ABAP_TRUE "
* DB_CHECK_FLAG_DBVIEW = ABAP_TRUE "
* PRID = -1 "

IMPORTING
SQLSTRING_TAB = "

EXCEPTIONS
ALREADY_EXISTS = 1 SQL_ERROR = 2 NOT_GENERATED = 3 ALIAS_NOT_CREATED = 4 DBVIEW_NOT_FOUND = 5
.



IMPORTING Parameters details for DB_CREATE_ALIAS_S

ALIASNAME -

Data type: DDOBJNAME
Optional: No
Call by Reference: Yes

DBREFNAME -

Data type: DBVIEWNAME
Optional: No
Call by Reference: Yes

SCHEMA_NAME -

Data type: DDSCHEMA
Default: '_SYS_BIC'
Optional: Yes
Call by Reference: Yes

NO_EXEC -

Data type: ABAP_BOOL
Default: ABAP_TRUE
Optional: Yes
Call by Reference: Yes

DB_CHECK_FLAG -

Data type: ABAP_BOOL
Default: ABAP_TRUE
Optional: Yes
Call by Reference: Yes

DB_CHECK_FLAG_DBVIEW -

Data type: ABAP_BOOL
Default: ABAP_TRUE
Optional: Yes
Call by Reference: Yes

PRID -

Data type: SYTABIX
Default: -1
Optional: Yes
Call by Reference: Yes

EXPORTING Parameters details for DB_CREATE_ALIAS_S

SQLSTRING_TAB -

Data type: DDLINE_TAB
Optional: No
Call by Reference: Yes

EXCEPTIONS details

ALREADY_EXISTS -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

SQL_ERROR -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NOT_GENERATED -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ALIAS_NOT_CREATED -

Data type:
Optional: No
Call by Reference: Yes

DBVIEW_NOT_FOUND -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for DB_CREATE_ALIAS_S 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_aliasname  TYPE DDOBJNAME, "   
lv_sqlstring_tab  TYPE DDLINE_TAB, "   
lv_already_exists  TYPE DDLINE_TAB, "   
lv_dbrefname  TYPE DBVIEWNAME, "   
lv_sql_error  TYPE DBVIEWNAME, "   
lv_schema_name  TYPE DDSCHEMA, "   '_SYS_BIC'
lv_not_generated  TYPE DDSCHEMA, "   
lv_no_exec  TYPE ABAP_BOOL, "   ABAP_TRUE
lv_alias_not_created  TYPE ABAP_BOOL, "   
lv_db_check_flag  TYPE ABAP_BOOL, "   ABAP_TRUE
lv_dbview_not_found  TYPE ABAP_BOOL, "   
lv_db_check_flag_dbview  TYPE ABAP_BOOL, "   ABAP_TRUE
lv_prid  TYPE SYTABIX. "   -1

  CALL FUNCTION 'DB_CREATE_ALIAS_S'  "
    EXPORTING
         ALIASNAME = lv_aliasname
         DBREFNAME = lv_dbrefname
         SCHEMA_NAME = lv_schema_name
         NO_EXEC = lv_no_exec
         DB_CHECK_FLAG = lv_db_check_flag
         DB_CHECK_FLAG_DBVIEW = lv_db_check_flag_dbview
         PRID = lv_prid
    IMPORTING
         SQLSTRING_TAB = lv_sqlstring_tab
    EXCEPTIONS
        ALREADY_EXISTS = 1
        SQL_ERROR = 2
        NOT_GENERATED = 3
        ALIAS_NOT_CREATED = 4
        DBVIEW_NOT_FOUND = 5
. " DB_CREATE_ALIAS_S




ABAP code using 7.40 inline data declarations to call FM DB_CREATE_ALIAS_S

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_schema_name) = '_SYS_BIC'.
 
 
DATA(ld_no_exec) = ABAP_TRUE.
 
 
DATA(ld_db_check_flag) = ABAP_TRUE.
 
 
DATA(ld_db_check_flag_dbview) = ABAP_TRUE.
 
DATA(ld_prid) = -1.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!