SAP Function Modules

IW_C_USER_CONTEXT_SET SAP Function module







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

Associated Function Group: SI63
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM IW_C_USER_CONTEXT_SET - IW C USER CONTEXT SET





CALL FUNCTION 'IW_C_USER_CONTEXT_SET' "
* EXPORTING
*   user = SY-UNAME             " sy-uname
*   area = 'IWBHELP'            " iw_area
*   subarea = 'IOM'             " sy-ucomm
*   mode = 'DOCU'               " iwbentry_s-wrk_mode
*   src_language =              " sy-langu
*   trg_language =              " sy-langu
*   country =                   " t005-land1
*   extension =                 " iwextend-id
*   rel =                       " iwextend-rel
*   entry_object =              " sdokobject
*   folder_to_delete =          " sdokobject
* TABLES
*   context =                   " sdokpropty
*   folders_to_insert =         " sdokobject
*   folders_to_delete =         " sdokobject
*   properties_to_insert =      " iwbvalue2
*   properties_to_delete =      " sdokproptn
*   multi_props_to_insert =     " iwbvalue
*   multi_props_to_delete =     " iwbvalue
    .  "  IW_C_USER_CONTEXT_SET

ABAP code example for Function Module IW_C_USER_CONTEXT_SET





The ABAP code below is a full code listing to execute function module IW_C_USER_CONTEXT_SET 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:
it_context  TYPE STANDARD TABLE OF SDOKPROPTY,"TABLES PARAM
wa_context  LIKE LINE OF it_context ,
it_folders_to_insert  TYPE STANDARD TABLE OF SDOKOBJECT,"TABLES PARAM
wa_folders_to_insert  LIKE LINE OF it_folders_to_insert ,
it_folders_to_delete  TYPE STANDARD TABLE OF SDOKOBJECT,"TABLES PARAM
wa_folders_to_delete  LIKE LINE OF it_folders_to_delete ,
it_properties_to_insert  TYPE STANDARD TABLE OF IWBVALUE2,"TABLES PARAM
wa_properties_to_insert  LIKE LINE OF it_properties_to_insert ,
it_properties_to_delete  TYPE STANDARD TABLE OF SDOKPROPTN,"TABLES PARAM
wa_properties_to_delete  LIKE LINE OF it_properties_to_delete ,
it_multi_props_to_insert  TYPE STANDARD TABLE OF IWBVALUE,"TABLES PARAM
wa_multi_props_to_insert  LIKE LINE OF it_multi_props_to_insert ,
it_multi_props_to_delete  TYPE STANDARD TABLE OF IWBVALUE,"TABLES PARAM
wa_multi_props_to_delete  LIKE LINE OF it_multi_props_to_delete .

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

SELECT single WRK_MODE
FROM IWBENTRY_S
INTO @DATA(ld_mode).

DATA(ld_src_language) = 'Check type of data required'.
DATA(ld_trg_language) = 'Check type of data required'.

SELECT single LAND1
FROM T005
INTO @DATA(ld_country).


SELECT single ID
FROM IWEXTEND
INTO @DATA(ld_extension).


SELECT single REL
FROM IWEXTEND
INTO @DATA(ld_rel).

DATA(ld_entry_object) = 'Check type of data required'.
DATA(ld_folder_to_delete) = 'Check type of data required'.

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

"populate fields of struture and append to itab
append wa_folders_to_insert to it_folders_to_insert.

"populate fields of struture and append to itab
append wa_folders_to_delete to it_folders_to_delete.

"populate fields of struture and append to itab
append wa_properties_to_insert to it_properties_to_insert.

"populate fields of struture and append to itab
append wa_properties_to_delete to it_properties_to_delete.

"populate fields of struture and append to itab
append wa_multi_props_to_insert to it_multi_props_to_insert.

"populate fields of struture and append to itab
append wa_multi_props_to_delete to it_multi_props_to_delete. . CALL FUNCTION 'IW_C_USER_CONTEXT_SET' * EXPORTING * user = ld_user * area = ld_area * subarea = ld_subarea * mode = ld_mode * src_language = ld_src_language * trg_language = ld_trg_language * country = ld_country * extension = ld_extension * rel = ld_rel * entry_object = ld_entry_object * folder_to_delete = ld_folder_to_delete * TABLES * context = it_context * folders_to_insert = it_folders_to_insert * folders_to_delete = it_folders_to_delete * properties_to_insert = it_properties_to_insert * properties_to_delete = it_properties_to_delete * multi_props_to_insert = it_multi_props_to_insert * multi_props_to_delete = it_multi_props_to_delete . " IW_C_USER_CONTEXT_SET
IF SY-SUBRC EQ 0. "All OK 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_user  TYPE SY-UNAME ,
it_context  TYPE STANDARD TABLE OF SDOKPROPTY ,
wa_context  LIKE LINE OF it_context,
ld_area  TYPE IW_AREA ,
it_folders_to_insert  TYPE STANDARD TABLE OF SDOKOBJECT ,
wa_folders_to_insert  LIKE LINE OF it_folders_to_insert,
ld_subarea  TYPE SY-UCOMM ,
it_folders_to_delete  TYPE STANDARD TABLE OF SDOKOBJECT ,
wa_folders_to_delete  LIKE LINE OF it_folders_to_delete,
ld_mode  TYPE IWBENTRY_S-WRK_MODE ,
it_properties_to_insert  TYPE STANDARD TABLE OF IWBVALUE2 ,
wa_properties_to_insert  LIKE LINE OF it_properties_to_insert,
ld_src_language  TYPE SY-LANGU ,
it_properties_to_delete  TYPE STANDARD TABLE OF SDOKPROPTN ,
wa_properties_to_delete  LIKE LINE OF it_properties_to_delete,
ld_trg_language  TYPE SY-LANGU ,
it_multi_props_to_insert  TYPE STANDARD TABLE OF IWBVALUE ,
wa_multi_props_to_insert  LIKE LINE OF it_multi_props_to_insert,
ld_country  TYPE T005-LAND1 ,
it_multi_props_to_delete  TYPE STANDARD TABLE OF IWBVALUE ,
wa_multi_props_to_delete  LIKE LINE OF it_multi_props_to_delete,
ld_extension  TYPE IWEXTEND-ID ,
ld_rel  TYPE IWEXTEND-REL ,
ld_entry_object  TYPE SDOKOBJECT ,
ld_folder_to_delete  TYPE SDOKOBJECT .

ld_user = 'some text here'.

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

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

"populate fields of struture and append to itab
append wa_folders_to_delete to it_folders_to_delete.

SELECT single WRK_MODE
FROM IWBENTRY_S
INTO ld_mode.


"populate fields of struture and append to itab
append wa_properties_to_insert to it_properties_to_insert.
ld_src_language = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_properties_to_delete to it_properties_to_delete.
ld_trg_language = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_multi_props_to_insert to it_multi_props_to_insert.

SELECT single LAND1
FROM T005
INTO ld_country.


"populate fields of struture and append to itab
append wa_multi_props_to_delete to it_multi_props_to_delete.

SELECT single ID
FROM IWEXTEND
INTO ld_extension.


SELECT single REL
FROM IWEXTEND
INTO ld_rel.

ld_entry_object = 'Check type of data required'.
ld_folder_to_delete = 'Check type of data required'.

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_SET or its description.