Skip to Content

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

Triggering workflow WS00500001


Hi Experts,

Please let me know how to trigger the WF - WS00500001 with object type - CL_EHHSS_PCO_INC_LC and Event - CREATED. And given data below.

1.       Title / Event :

  Table: EHHSSD_INC_BINFA

Field name: TITLE

Data element: EHHSS_INC_TITLE

Data type (Format): Character format

Length: 80 characters

2.       Data and Time

Table: EHHSSD_INC_BINFA

Field name: DATETIME_CR

Data Element: /BOBF/DATETIME_CR

Data type(Format): System format (Example : 31.07.2014 time  10:00 )

Length:  15

3.       Incident Reporter

Table: EHHSSD_INC_BINFA

Field name: USER_ID_CR

Data Element: /BOBF/USER_ID_CR

Data Type(Format): CHARACTER

Length: 12 Characters

4.       Locations

Table: EHHSSD_INC_BINFA

Field name:  LOC_ROOT_KEY_REF

Data Element: EHFND_LOCATION_KEY_REF

Data Type(Format): RAW (It will accept characters and numbers )

Length: 16

 

5.       Vehicle details

Table: EHHSSD_INC_VEHIC

Field for vehicle description: VEHICLE_DESC

Data element for vehicle description: EHFND_VEHICLE_DESC

Data type(Format): CHARACTER

Length: 40

Failed to trigger with below code

    CALL FUNCTION 'SWE_EVENT_CREATE'
    EXPORTING
      OBJTYPE           = 'CL_EHHSS_PCO_INC_LC'
      OBJKEY            =   LV_REPORT

       EVENT             = 'CREATED'
    TABLES
      EVENT_CONTAINER   = GIT_EVT
    EXCEPTIONS
      OBJTYPE_NOT_FOUND = 1
      OTHERS            = 2.
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

Regards,

Srivijay

replied

Issue resolved, able to trigger it with below code.

DATA: lv_objtype           TYPE sibftypeid,
lv_event            
TYPE sibfevent,
lr_event_parameters 
TYPE REF TO if_swf_ifs_parameter_container,
lv_TITLE_EVENT      
type char80,
lv_DATE_TIME        
type char15,
lv_INCIDENT_REPORTER
type char12,
lv_LOCATION1         
type char16,
VEHICLE_DETAILS     
type char15.


lv_objtype
= 'CL_EHHSS_PCO_INC_LC'.
lv_event  
= 'CREATED'.
CALL METHOD CL_SWF_EVT_EVENT=>GET_EVENT_CONTAINER
EXPORTING
IM_OBJCATEG 
= cl_swf_evt_event=>mc_objcateg_cl
IM_OBJTYPE  
= lv_objtype
IM_EVENT    
= lv_event
RECEIVING
RE_REFERENCE
= lr_event_parameters        .

lv_TITLE_EVENT      
= LV_TITLE.
lv_DATE_TIME        
= lv_date.
lv_INCIDENT_REPORTER
= LV_REPORTER.
lv_LOCATION1        
= LV_LOCATION.
VEHICLE_DETAILS     
= LV_VEHICLE.
try.
CALL METHOD lr_event_parameters->set
EXPORTING
name 
= 'TITLE'
value = lv_TITLE_EVENT.

CATCH cx_swf_cnt_cont_access_denied .
CATCH cx_swf_cnt_elem_access_denied .
CATCH cx_swf_cnt_elem_not_found .
CATCH cx_swf_cnt_elem_type_conflict .
CATCH cx_swf_cnt_unit_type_conflict .
CATCH cx_swf_cnt_elem_def_invalid .
CATCH cx_swf_cnt_container .
ENDTRY.

data: lv_key type char20.
try.
CALL METHOD CL_SWF_EVT_EVENT=>RAISE
EXPORTING
IM_OBJCATEG       
= cl_swf_evt_event=>mc_objcateg_cl
IM_OBJTYPE        
= lv_objtype
IM_EVENT          
= lv_event
IM_OBJKEY         
= lv_key
IM_EVENT_CONTAINER
= lr_event_parameters       .

CATCH CX_SWF_EVT_INVALID_OBJTYPE .
CATCH CX_SWF_EVT_INVALID_EVENT .
ENDTRY.
commit WORK.




Thank you Siraj, Murali and Rick for your kind responses :-)



Regards,

Srivijay

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question