Skip to Content
author's profile photo Former Member
Former Member

How to set the Event Parameter with a value and then trigger the event

Hi All,

I have a event DISPLAY of the BOR Object ZTESTBOR.

The Event DISPLAY has a parameter 'Matnr' of type mara-matnr.

Now i want to start a work flow when the event is triggered.

So i have done the binidng in the worl flow.

How can i pass a value say '1000001' to Matnr ( i.e the event parameter ) and then trigger the event so that the work flow container element can take the value in the container element so that i can use it in the WF.

Can u suggest any FM's or documents where this could be found.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 12, 2007 at 01:19 PM

    Check the Code below it is with SWE_EVENT_CREATE.

    <b>Reward Points if useful</b>

    FUNCTION zwf_process_trip.

    *"----


    ""Local Interface:

    *" IMPORTING

    *" VALUE(I_EMP_NUMBER) TYPE PERNR_D

    *" VALUE(I_EMP_TRIP) TYPE REINR

    *"----


    INCLUDE <cntn01> .

    DATA:i_emp_details TYPE STANDARD TABLE OF p0001, "Employee Details

    wa_request TYPE p0001, "Workarea for Employee details

    v_country_grp TYPE molga, "Country SubGrouping

    v_object_key TYPE sweinstcou-objkey. "Key for the buisness object ZWOBUSTRIP

    CONSTANTS: c_bo_trip TYPE swo_objtyp VALUE 'ZWOBUSTRIP',

    c_event_trip TYPE swo_event VALUE 'TripCreate',

    c_infy_type_1 TYPE infty VALUE '0001'.

    • Event Container declaration

    swc_container i_event_cont.

    swc_create_container i_event_cont.

    • Reading the INFO TYPE 0001 to obtain the

    • Employee details

    CALL FUNCTION 'HR_READ_INFOTYPE'

    EXPORTING

    pernr = i_emp_number

    infty = c_infy_type_1

    begda = sy-datum

    endda = sy-datum

    TABLES

    infty_tab = i_emp_details

    EXCEPTIONS

    infty_not_found = 1

    OTHERS = 2.

    • SY-SUBRC check is not required as the error

    • handelling will be done by WorkFlow rule

    • resolution.

    CLEAR wa_request.

    READ TABLE i_emp_details INTO wa_request INDEX 1.

    IF sy-subrc = 0.

    • Retrieving the Country SubGrouping for the employee

    SELECT SINGLE molga

    FROM t001p

    INTO v_country_grp

    WHERE werks = wa_request-werks

    AND btrtl = wa_request-persk.

    ENDIF.

    • Sending the relevant data to event container

    swc_set_element i_event_cont 'EmpId' i_emp_number.

    IF sy-subrc <> 0.

    • No Processing needed.

    ENDIF.

    swc_set_element i_event_cont 'PersonnelArea' wa_request-werks.

    IF sy-subrc <> 0.

    • No Processing needed.

    ENDIF.

    swc_set_element i_event_cont 'CountryGrouping' v_country_grp.

    IF sy-subrc <> 0.

    • No Processing needed.

    ENDIF.

    swc_set_element i_event_cont 'EmpSubGrp' wa_request-persk.

    IF sy-subrc <> 0.

    • No Processing needed.

    ENDIF.

    swc_set_element i_event_cont 'EmpTripId' i_emp_trip.

    IF sy-subrc <> 0.

    • No Processing needed.

    ENDIF.

    • Raising the event to trigger the workflow

    v_object_key = i_emp_number.

    CALL FUNCTION 'SWE_EVENT_CREATE'

    EXPORTING

    objtype = c_bo_trip

    objkey = v_object_key

    event = c_event_trip

    TABLES

    event_container = i_event_cont

    EXCEPTIONS

    objtype_not_found = 1

    OTHERS = 2.

    IF sy-subrc <> 0.

    • No Processing needed.

    ENDIF.

    COMMIT WORK.

    ENDFUNCTION.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.