SAP Function Modules

IW_C_USER_CONTEXT_GET SAP Function module







IW_C_USER_CONTEXT_GET 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 IW_C_USER_CONTEXT_GET into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM IW_C_USER_CONTEXT_GET - IW C USER CONTEXT GET





CALL FUNCTION 'IW_C_USER_CONTEXT_GET' "
* EXPORTING
*   user = SY-UNAME             " sy-uname
*   area = 'IWBHELP'            " iw_area
*   subarea = 'IOM'             " sy-ucomm
*   property_name = SPACE       " iwbvalue-name
*   multi_prop_name = SPACE     " iwbvalue-name
  IMPORTING
    mode =                      " iwbentry_s-wrk_mode  Processing mode (doc/translation)
    src_langu =                 " sy-langu
    trg_langu =                 " sy-langu
    country =                   " t005-land1
    extension =                 " iwextend-id
    rel =                       " iwextend-rel
    entry_object =              " sdokobject
* TABLES
*   folders =                   " sdokobject
*   context =                   " sdokpropty
*   properties =                " iwbvalue2
*   multi_props =               " iwbvalue
  EXCEPTIONS
    NO_CONTEXT_INFO_FOUND = 1   "
    .  "  IW_C_USER_CONTEXT_GET

ABAP code example for Function Module IW_C_USER_CONTEXT_GET





The ABAP code below is a full code listing to execute function module IW_C_USER_CONTEXT_GET 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_mode  TYPE IWBENTRY_S-WRK_MODE ,
ld_src_langu  TYPE SY-LANGU ,
ld_trg_langu  TYPE SY-LANGU ,
ld_country  TYPE T005-LAND1 ,
ld_extension  TYPE IWEXTEND-ID ,
ld_rel  TYPE IWEXTEND-REL ,
ld_entry_object  TYPE SDOKOBJECT ,
it_folders  TYPE STANDARD TABLE OF SDOKOBJECT,"TABLES PARAM
wa_folders  LIKE LINE OF it_folders ,
it_context  TYPE STANDARD TABLE OF SDOKPROPTY,"TABLES PARAM
wa_context  LIKE LINE OF it_context ,
it_properties  TYPE STANDARD TABLE OF IWBVALUE2,"TABLES PARAM
wa_properties  LIKE LINE OF it_properties ,
it_multi_props  TYPE STANDARD TABLE OF IWBVALUE,"TABLES PARAM
wa_multi_props  LIKE LINE OF it_multi_props .

DATA(ld_user) = 'some text here'.
DATA(ld_area) = 'some text here'.
DATA(ld_subarea) = 'some text here'.

DATA(ld_property_name) = some text here

DATA(ld_multi_prop_name) = some text here

"populate fields of struture and append to itab
append wa_folders to it_folders.

"populate fields of struture and append to itab
append wa_context to it_context.

"populate fields of struture and append to itab
append wa_properties to it_properties.

"populate fields of struture and append to itab
append wa_multi_props to it_multi_props. . CALL FUNCTION 'IW_C_USER_CONTEXT_GET' * EXPORTING * user = ld_user * area = ld_area * subarea = ld_subarea * property_name = ld_property_name * multi_prop_name = ld_multi_prop_name IMPORTING mode = ld_mode src_langu = ld_src_langu trg_langu = ld_trg_langu country = ld_country extension = ld_extension rel = ld_rel entry_object = ld_entry_object * TABLES * folders = it_folders * context = it_context * properties = it_properties * multi_props = it_multi_props EXCEPTIONS NO_CONTEXT_INFO_FOUND = 1 . " IW_C_USER_CONTEXT_GET
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "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_mode  TYPE IWBENTRY_S-WRK_MODE ,
ld_user  TYPE SY-UNAME ,
it_folders  TYPE STANDARD TABLE OF SDOKOBJECT ,
wa_folders  LIKE LINE OF it_folders,
ld_src_langu  TYPE SY-LANGU ,
ld_area  TYPE IW_AREA ,
it_context  TYPE STANDARD TABLE OF SDOKPROPTY ,
wa_context  LIKE LINE OF it_context,
ld_trg_langu  TYPE SY-LANGU ,
ld_subarea  TYPE SY-UCOMM ,
it_properties  TYPE STANDARD TABLE OF IWBVALUE2 ,
wa_properties  LIKE LINE OF it_properties,
ld_country  TYPE T005-LAND1 ,
ld_property_name  TYPE IWBVALUE-NAME ,
it_multi_props  TYPE STANDARD TABLE OF IWBVALUE ,
wa_multi_props  LIKE LINE OF it_multi_props,
ld_extension  TYPE IWEXTEND-ID ,
ld_multi_prop_name  TYPE IWBVALUE-NAME ,
ld_rel  TYPE IWEXTEND-REL ,
ld_entry_object  TYPE SDOKOBJECT .

ld_user = 'some text here'.

"populate fields of struture and append to itab
append wa_folders to it_folders.
ld_area = 'some text here'.

"populate fields of struture and append to itab
append wa_context to it_context.
ld_subarea = 'some text here'.

"populate fields of struture and append to itab
append wa_properties to it_properties.

ld_property_name = some text here

"populate fields of struture and append to itab
append wa_multi_props to it_multi_props.

ld_multi_prop_name = 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 IW_C_USER_CONTEXT_GET or its description.