SAP Function Modules

SWF_WSC_TASK_GENERATE SAP Function module







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

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


Pattern for FM SWF_WSC_TASK_GENERATE - SWF WSC TASK GENERATE





CALL FUNCTION 'SWF_WSC_TASK_GENERATE' "
  EXPORTING
    i_task_description =        " swlwptdsc     Describes Task to Be Generated by RFC (on Server Side)
    i_devclass =                " devclass      Package
    i_korrnum =                 " trkorr        Request/Task
*   i_uname = SY-UNAME          " syuname       SAP System, User Logon Name
*   i_langu = SY-LANGU          " sylangu       SAP R/3 System, Current Language
*   i_master_language = SY-LANGU  " sylangu     SAP R/3 System, Current Language
  IMPORTING
    e_hrs_otype =               " hrsobject-otype  Standard object type
    e_hrs_objid =               " hrsobject-objid  Object ID of Standard Object
  TABLES
    t_wi_texts =                " swlwptwit     Structure for Work Item Texts
    t_cnt_elem_def =            " swlwpcndsc    Describes Container Definition to Be Generated by RFC
    t_cnt_elem_descr =          " swlwpcndes    Names of Container Elements
    .  "  SWF_WSC_TASK_GENERATE

ABAP code example for Function Module SWF_WSC_TASK_GENERATE





The ABAP code below is a full code listing to execute function module SWF_WSC_TASK_GENERATE 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_e_hrs_otype  TYPE HRSOBJECT-OTYPE ,
ld_e_hrs_objid  TYPE HRSOBJECT-OBJID ,
it_t_wi_texts  TYPE STANDARD TABLE OF SWLWPTWIT,"TABLES PARAM
wa_t_wi_texts  LIKE LINE OF it_t_wi_texts ,
it_t_cnt_elem_def  TYPE STANDARD TABLE OF SWLWPCNDSC,"TABLES PARAM
wa_t_cnt_elem_def  LIKE LINE OF it_t_cnt_elem_def ,
it_t_cnt_elem_descr  TYPE STANDARD TABLE OF SWLWPCNDES,"TABLES PARAM
wa_t_cnt_elem_descr  LIKE LINE OF it_t_cnt_elem_descr .

DATA(ld_i_task_description) = 'Check type of data required'.
DATA(ld_i_devclass) = 'Check type of data required'.
DATA(ld_i_korrnum) = 'Check type of data required'.
DATA(ld_i_uname) = 'some text here'.
DATA(ld_i_langu) = 'Check type of data required'.
DATA(ld_i_master_language) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_wi_texts to it_t_wi_texts.

"populate fields of struture and append to itab
append wa_t_cnt_elem_def to it_t_cnt_elem_def.

"populate fields of struture and append to itab
append wa_t_cnt_elem_descr to it_t_cnt_elem_descr. . CALL FUNCTION 'SWF_WSC_TASK_GENERATE' EXPORTING i_task_description = ld_i_task_description i_devclass = ld_i_devclass i_korrnum = ld_i_korrnum * i_uname = ld_i_uname * i_langu = ld_i_langu * i_master_language = ld_i_master_language IMPORTING e_hrs_otype = ld_e_hrs_otype e_hrs_objid = ld_e_hrs_objid TABLES t_wi_texts = it_t_wi_texts t_cnt_elem_def = it_t_cnt_elem_def t_cnt_elem_descr = it_t_cnt_elem_descr . " SWF_WSC_TASK_GENERATE
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_e_hrs_otype  TYPE HRSOBJECT-OTYPE ,
ld_i_task_description  TYPE SWLWPTDSC ,
it_t_wi_texts  TYPE STANDARD TABLE OF SWLWPTWIT ,
wa_t_wi_texts  LIKE LINE OF it_t_wi_texts,
ld_e_hrs_objid  TYPE HRSOBJECT-OBJID ,
ld_i_devclass  TYPE DEVCLASS ,
it_t_cnt_elem_def  TYPE STANDARD TABLE OF SWLWPCNDSC ,
wa_t_cnt_elem_def  LIKE LINE OF it_t_cnt_elem_def,
ld_i_korrnum  TYPE TRKORR ,
it_t_cnt_elem_descr  TYPE STANDARD TABLE OF SWLWPCNDES ,
wa_t_cnt_elem_descr  LIKE LINE OF it_t_cnt_elem_descr,
ld_i_uname  TYPE SYUNAME ,
ld_i_langu  TYPE SYLANGU ,
ld_i_master_language  TYPE SYLANGU .

ld_i_task_description = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_wi_texts to it_t_wi_texts.
ld_i_devclass = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_cnt_elem_def to it_t_cnt_elem_def.
ld_i_korrnum = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_cnt_elem_descr to it_t_cnt_elem_descr.
ld_i_uname = 'some text here'.
ld_i_langu = 'Check type of data required'.
ld_i_master_language = '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 SWF_WSC_TASK_GENERATE or its description.