on 08-22-2015 6:50 AM
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.
Hi,
you should stick with SAP_WAPI_CREATE_EVENT.
Populating the event container is extemely easy.
TABLES
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rob, I tried already by passing only single field with INPUT_CONTAINER TYPE SWR_CONT that is working fine, but my problem is with the structure type . POHEADER IS OF TYPE BAPIMEPOHEADER ( Which is a strcuture type ) I am assigning the values to the workarea but i can't able to pass the values to the swr_cont-value field .. I am getting error as "ARE NOT MUTUALLY CONVERTIBLE" Please find the attached screen shots.
Hi,
There are restrictions with event containers, so if you want to pass a value to your workflow that is larger than the maximum size, then either check if you don't really need all of the fields of the structure or find another way to get the information in the workflow by using maybe a table with a guid or something like that.
Kind regards, Rob Dielemans
hi,
Please the macro you used for container element 'POHEADER' . In workflow also you created with exactly same. ie Upper case letter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rick, Yes what you told is correct , but i am unable to pass the values and i am getting the below error. "WA_CONTAINER-VALUE" and "LS_POHEADER" are not mutually convertible in a Unicode program. program. I used same parameter names "POHEADER" in both program and event parameter. Please find the attachments.
User | Count |
---|---|
86 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.