SAP Function Modules

SWW_WI_CREATE_SIMPLE SAP Function module







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

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


Pattern for FM SWW_WI_CREATE_SIMPLE - SWW WI CREATE SIMPLE





CALL FUNCTION 'SWW_WI_CREATE_SIMPLE' "
  EXPORTING
*   creator = SPACE             " swwwihead-wi_creator  WI Creator
*   priority = SWFCO_NO_PRIO    " swwwihead-wi_prio  Priority of WI
    task =                      " swwwihead-wi_rh_task  Associated Task ID According to Task Catalog
*   called_in_background = SPACE  " swwcommit-dialogflag  Indicator Showing Whether FM Called in Background
*   deadline_data = SPACE       " swwdeaddat    Deadline Monitoring Data
*   no_deadline_parameters = SPACE  " swwcommit-deadlckflg  Indicator for Whether Deadline Data Was Passed
  IMPORTING
    wi_id =                     " swwwihead-wi_id  ID of WI Created
    wi_header =                 " swwwihead     Header Data of WI Created
  TABLES
    agents =                    " swhactor      Selected Agents for Work Item
*   deadline_agents =           " swhactor      Agents For Latest End
*   desired_end_agents =        " swhactor      Agents for Requested End
*   latest_start_agents =       " swhactor      Agents for Latest Start
*   excluded_agents =           " swhactor      Excluded Agents for Work Item
*   notification_agents =       " swhactor      Agents for End Notification
*   secondary_methods =         " swwmethods    Object Methods To Be Called Additionally
*   wi_container =              " swcont        Data Container of Work Item
* CHANGING
*   wi_container_handle =       " if_swf_cnt_container  Container - Implementation of a 'Collection'
  EXCEPTIONS
    ID_NOT_CREATED = 1          "               Work Item ID Cannot Be Created
    READ_FAILED = 2             "               Task Cannot Be Read
    .  "  SWW_WI_CREATE_SIMPLE

ABAP code example for Function Module SWW_WI_CREATE_SIMPLE





The ABAP code below is a full code listing to execute function module SWW_WI_CREATE_SIMPLE 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_wi_id  TYPE SWWWIHEAD-WI_ID ,
ld_wi_header  TYPE SWWWIHEAD ,
it_agents  TYPE STANDARD TABLE OF SWHACTOR,"TABLES PARAM
wa_agents  LIKE LINE OF it_agents ,
it_deadline_agents  TYPE STANDARD TABLE OF SWHACTOR,"TABLES PARAM
wa_deadline_agents  LIKE LINE OF it_deadline_agents ,
it_desired_end_agents  TYPE STANDARD TABLE OF SWHACTOR,"TABLES PARAM
wa_desired_end_agents  LIKE LINE OF it_desired_end_agents ,
it_latest_start_agents  TYPE STANDARD TABLE OF SWHACTOR,"TABLES PARAM
wa_latest_start_agents  LIKE LINE OF it_latest_start_agents ,
it_excluded_agents  TYPE STANDARD TABLE OF SWHACTOR,"TABLES PARAM
wa_excluded_agents  LIKE LINE OF it_excluded_agents ,
it_notification_agents  TYPE STANDARD TABLE OF SWHACTOR,"TABLES PARAM
wa_notification_agents  LIKE LINE OF it_notification_agents ,
it_secondary_methods  TYPE STANDARD TABLE OF SWWMETHODS,"TABLES PARAM
wa_secondary_methods  LIKE LINE OF it_secondary_methods ,
it_wi_container  TYPE STANDARD TABLE OF SWCONT,"TABLES PARAM
wa_wi_container  LIKE LINE OF it_wi_container .

DATA(ld_wi_container_handle) = 'Check type of data required'.

SELECT single WI_CREATOR
FROM SWWWIHEAD
INTO @DATA(ld_creator).


SELECT single WI_PRIO
FROM SWWWIHEAD
INTO @DATA(ld_priority).


SELECT single WI_RH_TASK
FROM SWWWIHEAD
INTO @DATA(ld_task).


DATA(ld_called_in_background) = some text here
DATA(ld_deadline_data) = 'Check type of data required'.

DATA(ld_no_deadline_parameters) = some text here

"populate fields of struture and append to itab
append wa_agents to it_agents.

"populate fields of struture and append to itab
append wa_deadline_agents to it_deadline_agents.

"populate fields of struture and append to itab
append wa_desired_end_agents to it_desired_end_agents.

"populate fields of struture and append to itab
append wa_latest_start_agents to it_latest_start_agents.

"populate fields of struture and append to itab
append wa_excluded_agents to it_excluded_agents.

"populate fields of struture and append to itab
append wa_notification_agents to it_notification_agents.

"populate fields of struture and append to itab
append wa_secondary_methods to it_secondary_methods.

"populate fields of struture and append to itab
append wa_wi_container to it_wi_container. . CALL FUNCTION 'SWW_WI_CREATE_SIMPLE' EXPORTING * creator = ld_creator * priority = ld_priority task = ld_task * called_in_background = ld_called_in_background * deadline_data = ld_deadline_data * no_deadline_parameters = ld_no_deadline_parameters IMPORTING wi_id = ld_wi_id wi_header = ld_wi_header TABLES agents = it_agents * deadline_agents = it_deadline_agents * desired_end_agents = it_desired_end_agents * latest_start_agents = it_latest_start_agents * excluded_agents = it_excluded_agents * notification_agents = it_notification_agents * secondary_methods = it_secondary_methods * wi_container = it_wi_container * CHANGING * wi_container_handle = ld_wi_container_handle EXCEPTIONS ID_NOT_CREATED = 1 READ_FAILED = 2 . " SWW_WI_CREATE_SIMPLE
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 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_wi_container_handle  TYPE IF_SWF_CNT_CONTAINER ,
ld_wi_id  TYPE SWWWIHEAD-WI_ID ,
ld_creator  TYPE SWWWIHEAD-WI_CREATOR ,
it_agents  TYPE STANDARD TABLE OF SWHACTOR ,
wa_agents  LIKE LINE OF it_agents,
ld_wi_header  TYPE SWWWIHEAD ,
ld_priority  TYPE SWWWIHEAD-WI_PRIO ,
it_deadline_agents  TYPE STANDARD TABLE OF SWHACTOR ,
wa_deadline_agents  LIKE LINE OF it_deadline_agents,
ld_task  TYPE SWWWIHEAD-WI_RH_TASK ,
it_desired_end_agents  TYPE STANDARD TABLE OF SWHACTOR ,
wa_desired_end_agents  LIKE LINE OF it_desired_end_agents,
ld_called_in_background  TYPE SWWCOMMIT-DIALOGFLAG ,
it_latest_start_agents  TYPE STANDARD TABLE OF SWHACTOR ,
wa_latest_start_agents  LIKE LINE OF it_latest_start_agents,
ld_deadline_data  TYPE SWWDEADDAT ,
it_excluded_agents  TYPE STANDARD TABLE OF SWHACTOR ,
wa_excluded_agents  LIKE LINE OF it_excluded_agents,
ld_no_deadline_parameters  TYPE SWWCOMMIT-DEADLCKFLG ,
it_notification_agents  TYPE STANDARD TABLE OF SWHACTOR ,
wa_notification_agents  LIKE LINE OF it_notification_agents,
it_secondary_methods  TYPE STANDARD TABLE OF SWWMETHODS ,
wa_secondary_methods  LIKE LINE OF it_secondary_methods,
it_wi_container  TYPE STANDARD TABLE OF SWCONT ,
wa_wi_container  LIKE LINE OF it_wi_container.

ld_wi_container_handle = 'Check type of data required'.

SELECT single WI_CREATOR
FROM SWWWIHEAD
INTO ld_creator.


"populate fields of struture and append to itab
append wa_agents to it_agents.

SELECT single WI_PRIO
FROM SWWWIHEAD
INTO ld_priority.


"populate fields of struture and append to itab
append wa_deadline_agents to it_deadline_agents.

SELECT single WI_RH_TASK
FROM SWWWIHEAD
INTO ld_task.


"populate fields of struture and append to itab
append wa_desired_end_agents to it_desired_end_agents.

ld_called_in_background = some text here

"populate fields of struture and append to itab
append wa_latest_start_agents to it_latest_start_agents.
ld_deadline_data = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_excluded_agents to it_excluded_agents.

ld_no_deadline_parameters = some text here

"populate fields of struture and append to itab
append wa_notification_agents to it_notification_agents.

"populate fields of struture and append to itab
append wa_secondary_methods to it_secondary_methods.

"populate fields of struture and append to itab
append wa_wi_container to it_wi_container.

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