SAP CREATE_URL_TEMPLATE Function Module for Create an URL for an URL template with placeholders
CREATE_URL_TEMPLATE is a standard create url template SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Create an URL for an URL template with placeholders 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 create url template FM, simply by entering the name CREATE_URL_TEMPLATE into the relevant SAP transaction such as SE37 or SE38.
Function Group: URL_GENERATION
Program Name: SAPLURL_GENERATION
Main Program: SAPLURL_GENERATION
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CREATE_URL_TEMPLATE 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 'CREATE_URL_TEMPLATE'"Create an URL for an URL template with placeholders.
EXPORTING
* SERVICE_LOGSYS = ' ' "Logical System
* URL_TEMPLATE = ' ' "URL Tempate
* USERNAME = ' ' "SAP System, User Logon Name
* LANGUAGE = ' ' "Language ID
* USAGE_MODE = ' ' "URL generation mode: local or WP Server
* DEVICE = ' ' "Device Type
IMPORTING
SERVICE_URL = "URL for a Service
WP_URL_TYPE = "Workplace URL Type
TABLES
* URL_PARAM_TBL = "Structure for Parameter Pairs in URLs
EXCEPTIONS
NO_WEBSERVER_FOUND = 1 NO_SERVICE_FILE_FOUND = 2 UNKNOWN_PROBLEM = 3
IMPORTING Parameters details for CREATE_URL_TEMPLATE
SERVICE_LOGSYS - Logical System
Data type: LOGSYSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
URL_TEMPLATE - URL Tempate
Data type: SERVICE_RLDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
USERNAME - SAP System, User Logon Name
Data type: UNAMEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LANGUAGE - Language ID
Data type: LANGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
USAGE_MODE - URL generation mode: local or WP Server
Data type: URLMODEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
DEVICE - Device Type
Data type: SDEVTYPEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CREATE_URL_TEMPLATE
SERVICE_URL - URL for a Service
Data type: SERVICE_RLOptional: No
Call by Reference: No ( called with pass by value option)
WP_URL_TYPE - Workplace URL Type
Data type: WP_URL_TPOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for CREATE_URL_TEMPLATE
URL_PARAM_TBL - Structure for Parameter Pairs in URLs
Data type: URL_PARAMSOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
NO_WEBSERVER_FOUND - No Web server for the logical system
Data type:Optional: No
Call by Reference: Yes
NO_SERVICE_FILE_FOUND - Could not determine name of service file
Data type:Optional: No
Call by Reference: Yes
UNKNOWN_PROBLEM - Unknown problem
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CREATE_URL_TEMPLATE 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_service_url | TYPE SERVICE_RL, " | |||
| lt_url_param_tbl | TYPE STANDARD TABLE OF URL_PARAMS, " | |||
| lv_service_logsys | TYPE LOGSYS, " SPACE | |||
| lv_no_webserver_found | TYPE LOGSYS, " | |||
| lv_wp_url_type | TYPE WP_URL_TP, " | |||
| lv_url_template | TYPE SERVICE_RL, " SPACE | |||
| lv_no_service_file_found | TYPE SERVICE_RL, " | |||
| lv_username | TYPE UNAME, " SPACE | |||
| lv_unknown_problem | TYPE UNAME, " | |||
| lv_language | TYPE LANG, " SPACE | |||
| lv_usage_mode | TYPE URLMODE, " SPACE | |||
| lv_device | TYPE SDEVTYPE. " SPACE |
|   CALL FUNCTION 'CREATE_URL_TEMPLATE' "Create an URL for an URL template with placeholders |
| EXPORTING | ||
| SERVICE_LOGSYS | = lv_service_logsys | |
| URL_TEMPLATE | = lv_url_template | |
| USERNAME | = lv_username | |
| LANGUAGE | = lv_language | |
| USAGE_MODE | = lv_usage_mode | |
| DEVICE | = lv_device | |
| IMPORTING | ||
| SERVICE_URL | = lv_service_url | |
| WP_URL_TYPE | = lv_wp_url_type | |
| TABLES | ||
| URL_PARAM_TBL | = lt_url_param_tbl | |
| EXCEPTIONS | ||
| NO_WEBSERVER_FOUND = 1 | ||
| NO_SERVICE_FILE_FOUND = 2 | ||
| UNKNOWN_PROBLEM = 3 | ||
| . " CREATE_URL_TEMPLATE | ||
ABAP code using 7.40 inline data declarations to call FM CREATE_URL_TEMPLATE
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_service_logsys) | = ' '. | |||
| DATA(ld_url_template) | = ' '. | |||
| DATA(ld_username) | = ' '. | |||
| DATA(ld_language) | = ' '. | |||
| DATA(ld_usage_mode) | = ' '. | |||
| DATA(ld_device) | = ' '. | |||
Search for further information about these or an SAP related objects