Skip to Content
0
Former Member
Feb 25, 2009 at 10:45 AM

Passing parameters to workflow

233 Views

Hi all,

I have called the workflow through program and in the workflow there is one oblligatory element AbsenceForm and i am passing the value through the program by WI_CONTAINER. My problem the value is not passing correctly and the following error is comming when i execute the program .

Import container contains errors (are any obligatory elements missing?)

How to pass the parameters to workflow by using the following function module.

fs_swcont-element = 'AbsenceForm'.
fs_swcont-type    = 'C'.
fs_swcont-value   = '0000000013'.
append fs_swcont to t_swcont.


  CALL FUNCTION 'SWW_WI_START_SIMPLE'
    EXPORTING
*     CREATOR                            = sy-uname
*     PRIORITY                           = SWFCO_NO_PRIO
      TASK                               = 'WS30000015'  
*     CALLED_IN_BACKGROUND               = ' '
*     DEADLINE_DATA                      = ' '
*     NO_DEADLINE_PARAMETERS             = ' '
*   IMPORTING
*     WI_ID                              =
*     WI_HEADER                          =
*     RETURN                             =
*     WI_RESULT                          =
*     SWF_RETURN                         =
    TABLES
      AGENTS                             = T_AGENT
*     DEADLINE_AGENTS                    =
*     DESIRED_END_AGENTS                 =
*     LATEST_START_AGENTS                =
*     EXCLUDED_AGENTS                    =
*     NOTIFICATION_AGENTS                =
*     SECONDARY_METHODS                  =
     WI_CONTAINER                       = T_SWCONT
*   CHANGING
*     WI_CONTAINER_HANDLE                =
   EXCEPTIONS
     ID_NOT_CREATED                     = 1
     READ_FAILED                        = 2
     IMMEDIATE_START_NOT_POSSIBLE       = 3
     EXECUTION_FAILED                   = 4
     INVALID_STATUS                     = 5
     OTHERS                             = 6
            .
  IF SY-SUBRC NE 0.
     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

ENDFORM.                    " call_workflow

Thanks in advance,

Mahi.