cancel
Showing results for 
Search instead for 
Did you mean: 

User events

Former Member
0 Kudos

Hi All,

can any one help me how to create an User Event(T-code sm62) through ABAP code and also please let me know how does USER Event work.

regards,

Lakshmikanth.T.V

Accepted Solutions (1)

Accepted Solutions (1)

vinod_gunaware2
Active Contributor
0 Kudos

1) SM62->Maintain User Events->Create

2) You can use SM64 to trigger manually the event..

FM 'BP_EVENT_RAISE' is used to trigger Background Event.

Trigger an event in the background processing system. This function module is for use in programs written in ABAP/4. Triggering an event tells the background processing system to start any background jobs that were scheduled to wait for the event.

You can trigger an event with or without an event argument, a string that more precisely identifies an event. Jobs can be scheduled to wait for an event for the combination of event and a particular event argument.

EVENTID is just an identifier to locate the event.

You can find this event in transaction SWEL/SWE2 transactions.

http://help.sap.com/saphelp_nw04/helpdata/en/fa/096e51543b11d1898e0000e8322d00/frameset.htm

regards

vinod

former_member927251
Active Contributor
0 Kudos

Hi,

Here I have created an event to trigger a workflow.

Use the function module 'SWE_EVENT_CREATE' to create an event.

  • Data for workflow trigger

DATA: objtype LIKE swetypecou-objtype,

objkey LIKE sweinstcou-objkey,

event LIKE swetypecou-event,

event_container LIKE swcont OCCURS 0 WITH HEADER LINE.

objtype = 'ZBUS1001'. "Material [sub object of BUS1001]

MOVE v_wfmatnr TO objkey. "V_WFMATNR is material number

event = 'CreatePLMMaterial'."Custom Event defined in

  • ZBUS1001 [Tcode SWO1]

REFRESH event_container.

*Following are the Event parameters required in the *Workflow

swc_set_element event_container 'Attachment' v_wfattachment.

swc_set_element event_container 'Material' v_wfmatnr.

swc_set_element event_container 'TisGroup' v_wftisgroup.

swc_set_element event_container 'SchDate' v_schdate.

CALL FUNCTION 'SWE_EVENT_CREATE'

EXPORTING

objtype = objtype

objkey = objkey

event = event

TABLES

event_container = event_container

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.

COMMIT WORK.

<b>Please reward helpful answer.</b>

Regards,

Amit Mishra

Answers (0)