SAP Function Modules

CREATE_URL_OBJECT SAP Function module - Create an URL for a transaction







CREATE_URL_OBJECT is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name CREATE_URL_OBJECT into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: URL_GENERATION
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM CREATE_URL_OBJECT - CREATE URL OBJECT





CALL FUNCTION 'CREATE_URL_OBJECT' "Create an URL for a transaction
  EXPORTING
*   object_logsys = SPACE       " logsys        Logical System
    object_type =               " swo_objtyp    Object Type
    object_key = SPACE          " swo_typeid    Object Key
*   object_name = SPACE         " swc_objede    Object Name
*   username = SPACE            " uname         User Name
*   language = SPACE            " lang          Language ID
*   usage_mode = SPACE          " urlmode       URL generation mode: local or WP Server
*   device = SPACE              " sdevtype      Device Type
*   mdcheck = 'X'               " mdcheck       Drag&Relate: Check for Plug-In and Metadata
  IMPORTING
    service_url =               " service_rl    URL for a Service
    wp_url_type =               " wp_url_tp     Description of URL type
* TABLES
*   url_param_tbl =             " url_params    Structure for Parameter Pairs in URLs
  EXCEPTIONS
    NO_WEBSERVER_FOUND = 1      "               No Web server for the logical system
    UNKNOWN_PROBLEM = 2         "               Unknown problem
    LOGSYS_OFFLINE = 3          "               Logical system not available
    NO_OBJECT_METADATA = 4      "               No Drag&Relate metadata for object type
    PLUGIN_NOT_FOUND = 5        "               Could not find Workplace plug-in
    .  "  CREATE_URL_OBJECT

ABAP code example for Function Module CREATE_URL_OBJECT





The ABAP code below is a full code listing to execute function module CREATE_URL_OBJECT including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_service_url  TYPE SERVICE_RL ,
ld_wp_url_type  TYPE WP_URL_TP ,
it_url_param_tbl  TYPE STANDARD TABLE OF URL_PARAMS,"TABLES PARAM
wa_url_param_tbl  LIKE LINE OF it_url_param_tbl .

DATA(ld_object_logsys) = '20210129'.
DATA(ld_object_type) = 'some text here'.
DATA(ld_object_key) = 'some text here'.
DATA(ld_object_name) = 'some text here'.
DATA(ld_username) = 'some text here'.
DATA(ld_language) = 'some text here'.
DATA(ld_usage_mode) = 'some text here'.
DATA(ld_device) = 'some text here'.
DATA(ld_mdcheck) = 'some text here'.

"populate fields of struture and append to itab
append wa_url_param_tbl to it_url_param_tbl. . CALL FUNCTION 'CREATE_URL_OBJECT' EXPORTING * object_logsys = ld_object_logsys object_type = ld_object_type object_key = ld_object_key * object_name = ld_object_name * username = ld_username * language = ld_language * usage_mode = ld_usage_mode * device = ld_device * mdcheck = ld_mdcheck IMPORTING service_url = ld_service_url wp_url_type = ld_wp_url_type * TABLES * url_param_tbl = it_url_param_tbl EXCEPTIONS NO_WEBSERVER_FOUND = 1 UNKNOWN_PROBLEM = 2 LOGSYS_OFFLINE = 3 NO_OBJECT_METADATA = 4 PLUGIN_NOT_FOUND = 5 . " CREATE_URL_OBJECT
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_service_url  TYPE SERVICE_RL ,
ld_object_logsys  TYPE LOGSYS ,
it_url_param_tbl  TYPE STANDARD TABLE OF URL_PARAMS ,
wa_url_param_tbl  LIKE LINE OF it_url_param_tbl,
ld_wp_url_type  TYPE WP_URL_TP ,
ld_object_type  TYPE SWO_OBJTYP ,
ld_object_key  TYPE SWO_TYPEID ,
ld_object_name  TYPE SWC_OBJEDE ,
ld_username  TYPE UNAME ,
ld_language  TYPE LANG ,
ld_usage_mode  TYPE URLMODE ,
ld_device  TYPE SDEVTYPE ,
ld_mdcheck  TYPE MDCHECK .

ld_object_logsys = '20210129'.

"populate fields of struture and append to itab
append wa_url_param_tbl to it_url_param_tbl.
ld_object_type = 'some text here'.
ld_object_key = 'some text here'.
ld_object_name = 'some text here'.
ld_username = 'some text here'.
ld_language = 'some text here'.
ld_usage_mode = 'some text here'.
ld_device = 'some text here'.
ld_mdcheck = 'some text here'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name CREATE_URL_OBJECT or its description.