Skip to Content

Passing the values from BO event parameters to the wf container.

Dear Experts, I am new to workflow events concept . I developed a workflow which will create the purchase order based on my below program. I tested in SWUE transaction which is working fine data is passing to workflow but when I am running my workflow through a zprogram the values from the event parameter to the workflow container are not passing . I tried with swr_cont structure by passing the values to the internal table but I am getting syntax error so I changed the structure to swcont and passed through the macro and program is working fine but the values are not passing to the workflow container. Please find my below source code. (1.2 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Aug 24, 2015 at 07:30 AM


    Please the macro you used for container element 'POHEADER' . In workflow also you created with exactly same. ie Upper case letter

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 24, 2015 at 07:17 AM

    Hi Experts. I changed the function module from 'SAP_WAPI_CREATE_EVENT' to 'SWE_EVENT_CREATE' and it is passing the parameters from event to the wf container Please find the below code. swc_create_container container. swc_set_element container 'USERNAME' sy-uname. swc_set_element container 'POHEADER' ls_poheader. swc_set_element container 'POHEADERX' ls_poheaderx. swc_set_element container 'POITEM' lt_poitem. swc_set_element container 'POITEMX' lt_poitemx. swc_set_element container 'POITEMX' lt_poitemx. swc_set_element container 'POSCHEDULE' lt_poschedule. swc_set_element container 'POSCHEDULEX' lt_poschedulex. CALL FUNCTION 'SWE_EVENT_CREATE' EXPORTING objtype = 'ZRK_BO' objkey = '1222' event = 'CREATE_PURCHASEORDER' * CREATOR = ' ' * TAKE_WORKITEM_REQUESTER = ' ' * START_WITH_DELAY = ' ' * START_RECFB_SYNCHRON = ' ' * NO_COMMIT_FOR_QUEUE = ' ' * DEBUG_FLAG = ' ' * NO_LOGGING = ' ' * IDENT = * IMPORTING * EVENT_ID = * RECEIVER_COUNT = TABLES event_container = container EXCEPTIONS objtype_not_found = 1 OTHERS = 2. IF sy-subrc <> 0. * Implement suitable error handling here ENDIF. *CALL FUNCTION 'SAP_WAPI_CREATE_EVENT' * EXPORTING * object_type = 'ZRK_BO' * object_key = '1221' * event = 'CREATE_PURCHASEORDER' * commit_work = 'X' * event_language = sy-langu * language = sy-langu * user = sy-uname ** IFS_XML_CONTAINER = * IMPORTING * return_code = lv_return ** EVENT_ID = * TABLES * input_container = it_container. ** MESSAGE_LINES = ** MESSAGE_STRUCT = *** IF sy-subrc IS INITIAL AND lv_return IS INITIAL. COMMIT WORK. ENDIF. But why it is not working for SAP_WAPI_CREATE_EVENT? Thanks in advance. Regards, Raghunadh Kodali.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 24, 2015 at 09:13 AM


    you should stick with SAP_WAPI_CREATE_EVENT.

    Populating the event container is extemely easy.

    input_container = lt_event_container

    The event container is a table of type swr_cont and consists of 2 fields

    element and value.

    Check the name of the event parameter in the business object, that exact name, case sensitive is the element.

    For Multiline element containers, simply repeat the element, for business object simply pass the key and everything should work fine.

    SAP_WAPI_CREATE_EVENT has function module Documentation for more info.

    Kind regards, Rob Dielemans

    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.