CA Function module RFC Used the same way in S/4HANA

SAP_WAPI_START_WORKFLOW Workflow: Start Workflow

Starts a workflow or task directly, without an event, and returns the ID of the created work item. It is used when a program must start a specific workflow template (WS…) with a filled container, for example from a custom approval transaction. Fill INPUT_CONTAINER with the container elements the workflow expects, set DO_COMMIT if no other COMMIT WORK follows, and check RETURN_CODE and MESSAGE_LINES.

Function group
SWRR
Remote-enabled (RFC)
Yes
Type
Function module

Importing parameters

ParameterTypeDescriptionRequired
TASKSWR_STRUCT-TASKTask or workflow templateYes
LANGUAGESWR_STRUCT-WILANGUAGELanguage—
DO_COMMITXFLAGExecute COMMIT WORK—
USERSYUNAMEUser who starts the workflow—
START_ASYNCHRONOUSXFLAGStart asynchronously—
DESIRED_START_DATESWR_DATEINDesired start date—
DESIRED_START_TIMESWR_TIMEINDesired start time—
DESIRED_START_ZONLOSYSTZONLOTime zone of the start time—
IFS_XML_CONTAINERXSTRINGContainer as XML—

Exporting parameters

ParameterTypeDescription
RETURN_CODESY-SUBRCReturn code
WORKITEM_IDSWR_STRUCT-WORKITEMIDID of the created work item
NEW_STATUSSWR_WISTATStatus of the work item

Tables parameters

ParameterTypeDescriptionRequired
INPUT_CONTAINERSWR_CONTInput container—
AGENTSSWRAGENTAgents—
MESSAGE_LINESSWR_MESSAGMessage lines—
MESSAGE_STRUCTSWR_MSTRUCMessage structure—

Call template (ABAP)

A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.

CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
  EXPORTING
    task = lv_task
  IMPORTING
    return_code = lv_return_code
    workitem_id = lv_workitem_id
    new_status = lv_new_status
  TABLES
    input_container = lt_input_container
    agents = lt_agents
    message_lines = lt_message_lines
    message_struct = lt_message_struct.

Related tables

Can't find the report you need?

We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.

Request a custom report