SAP SUBST_CREATE_NAME Function Module for Erzeuge einen Commandfilenamen aus einem Template









SUBST_CREATE_NAME is a standard subst create name SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Erzeuge einen Commandfilenamen aus einem Template 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 subst create name FM, simply by entering the name SUBST_CREATE_NAME into the relevant SAP transaction such as SE37 or SE38.

Function Group: SUGX
Program Name: SAPLSUGX
Main Program: SAPLSUGX
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function SUBST_CREATE_NAME 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 'SUBST_CREATE_NAME'"Erzeuge einen Commandfilenamen aus einem Template
EXPORTING
* IV_TEMPLATE = ' ' "Name of command file with replacement characters
* IV_TEMPLATE_NAME = ' ' "
* IV_SAPRELEASE = ' ' "SAP Release
* IV_SYSID = ' ' "SAP System Name
* IV_DBSYS = ' ' "Database System
* IV_REPID = SY-REPID "ABAP Program Name

IMPORTING
EV_NAME = "File Name
EV_EXPANDED_NAME = "

EXCEPTIONS
SAPRELEASE_NOT_FOUND = 1 TEMPLATE_NAME_NOT_SET = 2
.



IMPORTING Parameters details for SUBST_CREATE_NAME

IV_TEMPLATE - Name of command file with replacement characters

Data type: TSTRF01-FILENAME
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_TEMPLATE_NAME -

Data type: TSTRF01-LONG_NAME
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_SAPRELEASE - SAP Release

Data type: SY-SAPRL
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_SYSID - SAP System Name

Data type: SY-SYSID
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_DBSYS - Database System

Data type: SY-DBSYS
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_REPID - ABAP Program Name

Data type: TRDIR-NAME
Default: SY-REPID
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for SUBST_CREATE_NAME

EV_NAME - File Name

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

EV_EXPANDED_NAME -

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

EXCEPTIONS details

SAPRELEASE_NOT_FOUND - SAP Release could not be found

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

TEMPLATE_NAME_NOT_SET -

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

Copy and paste ABAP code example for SUBST_CREATE_NAME 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_ev_name  TYPE TSTRF01-FILENAME, "   
lv_iv_template  TYPE TSTRF01-FILENAME, "   ' '
lv_saprelease_not_found  TYPE TSTRF01, "   
lv_ev_expanded_name  TYPE TSTRF01-LONG_NAME, "   
lv_iv_template_name  TYPE TSTRF01-LONG_NAME, "   ' '
lv_template_name_not_set  TYPE TSTRF01, "   
lv_iv_saprelease  TYPE SY-SAPRL, "   ' '
lv_iv_sysid  TYPE SY-SYSID, "   ' '
lv_iv_dbsys  TYPE SY-DBSYS, "   ' '
lv_iv_repid  TYPE TRDIR-NAME. "   SY-REPID

  CALL FUNCTION 'SUBST_CREATE_NAME'  "Erzeuge einen Commandfilenamen aus einem Template
    EXPORTING
         IV_TEMPLATE = lv_iv_template
         IV_TEMPLATE_NAME = lv_iv_template_name
         IV_SAPRELEASE = lv_iv_saprelease
         IV_SYSID = lv_iv_sysid
         IV_DBSYS = lv_iv_dbsys
         IV_REPID = lv_iv_repid
    IMPORTING
         EV_NAME = lv_ev_name
         EV_EXPANDED_NAME = lv_ev_expanded_name
    EXCEPTIONS
        SAPRELEASE_NOT_FOUND = 1
        TEMPLATE_NAME_NOT_SET = 2
. " SUBST_CREATE_NAME




ABAP code using 7.40 inline data declarations to call FM SUBST_CREATE_NAME

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 FILENAME FROM TSTRF01 INTO @DATA(ld_ev_name).
 
"SELECT single FILENAME FROM TSTRF01 INTO @DATA(ld_iv_template).
DATA(ld_iv_template) = ' '.
 
 
"SELECT single LONG_NAME FROM TSTRF01 INTO @DATA(ld_ev_expanded_name).
 
"SELECT single LONG_NAME FROM TSTRF01 INTO @DATA(ld_iv_template_name).
DATA(ld_iv_template_name) = ' '.
 
 
"SELECT single SAPRL FROM SY INTO @DATA(ld_iv_saprelease).
DATA(ld_iv_saprelease) = ' '.
 
"SELECT single SYSID FROM SY INTO @DATA(ld_iv_sysid).
DATA(ld_iv_sysid) = ' '.
 
"SELECT single DBSYS FROM SY INTO @DATA(ld_iv_dbsys).
DATA(ld_iv_dbsys) = ' '.
 
"SELECT single NAME FROM TRDIR INTO @DATA(ld_iv_repid).
DATA(ld_iv_repid) = SY-REPID.
 


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!