Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

wait for event step..

hi all,

I have a wait for event step in my owrkflow and it is working fine. My problem us i am not able to trigger this event using program can anyone please let me know what i am doing wrong. following is the code i am using to trigger the event

 DATA: key TYPE SWEINSTCOU-OBJKEY,
        object  TYPE  SWETYPECOU-OBJTYPE,
        event TYPE SWETYPECOU-EVENT.

  DATA: event_id LIKE swr_struct-event_id,
        return_code LIKE sy-subrc,
        input_container TYPE swr_cont OCCURS 0 WITH HEADER LINE,
        message_lines TYPE swr_messag OCCURS 0 WITH HEADER LINE,
        message_struct TYPE swr_mstruc OCCURS 0 WITH HEADER LINE.

*  CONCATENATE pernr reinr INTO key.

key = reinr.

  object = 'BUS2089'.

  IF action = 'APPROVED'.
    event = 'APPROVED'.
  ELSEIF action = 'REJECTED'.
    event = 'CANCELLED'.
  ENDIF.

*  swc_create_object object 'BUS2089' key.

  CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
    EXPORTING
      object_type             = 'BUS2089'
      object_key              =  key
      event                   = event
     commit_work             = 'X'
     event_language          = sy-langu
     language                = sy-langu
     user                    = sy-uname
*    IFS_XML_CONTAINER       =
   IMPORTING
     return_code             = return_code
     event_id                = event_id
   TABLES
     input_container         = input_container
     message_lines           = message_lines
     message_struct          = message_struct
            .

*
commit WORK.

however if i execute the FM SAP_WAPI_CREATE_EVENT by passing the values it works fine.

Thanks

Saurabh

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question