Skip to Content
0
Nov 18, 2011 at 04:34 AM

WorkFlow Problem

14 Views

Hai Friends,

I am new in workflow.

I created a simple workflow in TCODE : SWDD.

Its input is Time. What it is doing is if the time is > 12pm and < 10 am it will send mail to the workflow initiator's sap inbox.

When I give the input directly to the workflow it is working fine. But when I am trying to initiate it from a program, it is not working. The RETURN_CODE is 0 always. What to do?

CODE IS:

PARAMETERS time TYPE sy-uzeit.
DATA : RETURN_CODE LIKE  SY-SUBRC,
       WORKITEM_ID LIKE  SWR_STRUCT-WORKITEMID,
       NEW_STATUS TYPE  SWR_WISTAT.

data : IT_CONTAINER TYPE TABLE OF SWR_CONT,
       WA_CONTAINER TYPE SWR_CONT.
WA_CONTAINER-ELEMENT = 'TIME'.
WA_CONTAINER-VALUE = TIME.
APPEND WA_CONTAINER TO IT_CONTAINER.

CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
  EXPORTING
    TASK                     = 'WS99900167'
   LANGUAGE                  = SY-LANGU
   DO_COMMIT                 = 'X'
   USER                      = SY-UNAME
*   START_ASYNCHRONOUS        = ' '
*   DESIRED_START_DATE        = DESIRED_START_DATE
*   DESIRED_START_TIME        = DESIRED_START_TIME
*   DESIRED_START_ZONLO       = SY-ZONLO
*   IFS_XML_CONTAINER         = IFS_XML_CONTAINER
 IMPORTING
   RETURN_CODE               = RETURN_CODE
   WORKITEM_ID               = WORKITEM_ID
   NEW_STATUS                = NEW_STATUS
 TABLES
   INPUT_CONTAINER           = IT_CONTAINER.

Thanks,

Anoop