Create Parked document and trigger event--HELP!

Lola Oluwa Lola.Oluwa at outokumpu.net
Fri Apr 12 10:09:30 EDT 2002


Hi,
I have defined the following in my own subtype for BKPF:
......
SWC_CONTAINER EVENTCONTAINER.
SWC_CREATE_CONTAINER EVENTCONTAINER.
EVENT_TIME = 5.
 
SWC_GET_ELEMENT CONTAINER 'TransactionCode' TRANSACTIONCODE.
CALL TRANSACTION TRANSACTIONCODE  .
 
*  Get key parameters----------------------------------------
      GET PARAMETER ID 'BUK' FIELD COMPANYCODE.
      GET PARAMETER ID 'BLP' FIELD DOCUMENTNUMBER.
      GET PARAMETER ID 'GJR' FIELD FISCALYEAR.
 
* Fill object key fields
      MOVE FISCALYEAR TO OBJECT-KEY-FISCALYEAR.
      MOVE DOCUMENTNUMBER TO OBJECT-KEY-DOCUMENTNO.
      MOVE COMPANYCODE TO OBJECT-KEY-COMPANYCODE.
 
* Create event
      MYEVENT = 'CreatedInWF'.
      OBJECTKEY = OBJECT-KEY.
 
  CALL FUNCTION 'SWE_EVENT_CREATE'
  EXPORTING
    OBJTYPE                       = 'BKPF'
    OBJKEY                        = OBJECTKEY
    EVENT                         =  MYEVENT
  TABLES
   EVENT_CONTAINER               = EVENTCONTAINER
          .
     IF SY-SUBRC <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
     ENDIF.
 
END_METHOD.
 
The method is asynchronous and instance independent.
 
I have then gone on to define a standard task with this object method. the
terminating event is as defined in the method.
My workflow log shows event is created as expected.
 
The problem I'm having is:
 
When I execute this step in my workflow , I always have to manually set the
workitem to 'done' to get rid of the workitem created for this step. this
is not very good for the end user as they are bound to make make the
mistake of executing the step twice (Workflow + Early archiving).
 
could anyone help out with this one??
 
regards,
Lola.
 


More information about the SAP-WUG mailing list