Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3668

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

$
0
0

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. REPORT  zrk_raise_bo_events. INCLUDE . DATA : it_container TYPE TABLE OF swr_cont,       wa_container TYPE swr_cont,       lv_return TYPE sy-subrc,       ls_poheader TYPE bapimepoheader,       ls_poheaderx TYPE bapimepoheaderx,       lt_poitem  TYPE TABLE OF bapimepoitem,       ls_poitem TYPE bapimepoitem,       lt_poitemx TYPE TABLE OF bapimepoitemx,       ls_poitemx TYPE bapimepoitemx,       lt_poschedule TYPE TABLE OF bapimeposchedule,       ls_poschedule TYPE bapimeposchedule,       lt_poschedulex TYPE TABLE OF bapimeposchedulx,       ls_poschedulex TYPE bapimeposchedulx,       container TYPE TABLE OF swcont ."LIKE LINE OF IT_CONTAINER. *-- Fill the values. ls_poheader-comp_code = '1000'. ls_poheader-doc_type = 'NB'. ls_poheader-creat_date = sy-datum. ls_poheader-created_by = sy-uname. ls_poheader-vendor = '1000'. ls_poheader-langu = sy-langu. ls_poheader-langu_iso = sy-langu. ls_poheader-purch_org = '1000'. ls_poheader-pur_group = '001'. ls_poheader-currency = 'USD'. ls_poheader-currency_iso  = 'USD'. ls_poheader-doc_date = sy-datum. ls_poheaderx-comp_code = 'X'. ls_poheaderx-doc_type = 'X'. ls_poheaderx-creat_date = 'X'. ls_poheaderx-created_by = 'X'. ls_poheaderx-vendor = 'X'. ls_poheaderx-langu = 'X'. ls_poheaderx-langu_iso = 'X'. ls_poheaderx-purch_org = 'X'. ls_poheaderx-pur_group = 'X'. ls_poheaderx-currency = 'X'. ls_poheaderx-currency_iso  = 'X'. ls_poheaderx-doc_date = 'X'. ls_poitem-po_item = '00010'. ls_poitem-short_text = 'CASINGS123 ARTICLE TESTING KR TEST1'. ls_poitem-material = '100-100'. ls_poitem-plant = '1000'. ls_poitem-stge_loc = '0001'. ls_poitem-matl_group = '001'. ls_poitem-quantity = '10.00'. ls_poitem-po_unit = 'PC'. ls_poitem-po_unit_iso = 'PC'. APPEND ls_poitem TO lt_poitem. CLEAR : ls_poitem. ls_poitemx-po_item = '00010'. ls_poitemx-po_itemx = 'X'. ls_poitemx-short_text = 'X'. ls_poitemx-material = 'X'. ls_poitemx-plant = 'X'. ls_poitemx-stge_loc = 'X'. ls_poitemx-matl_group = 'X'. ls_poitemx-quantity = 'X'. ls_poitemx-po_unit = 'X'. ls_poitemx-po_unit_iso = 'X'. APPEND ls_poitemx TO lt_poitemx. CLEAR : ls_poitemx. *-- Append Schedule line items. ls_poschedule-po_item = '00010'. ls_poschedule-del_datcat_ext = 'D'. ls_poschedule-sched_line = '1'. ls_poschedule-delivery_date = sy-datum. ls_poschedule-quantity = '10.00'. ls_poschedule-stat_date = sy-datum. APPEND ls_poschedule TO lt_poschedule. CLEAR : ls_poschedule . ls_poschedulex-po_item = '0010'. ls_poschedulex-po_itemx = 'X'. ls_poschedulex-sched_line = '001'. ls_poschedulex-sched_linex = 'X'. ls_poschedulex-del_datcat_ext =  'X'. ls_poschedulex-sched_line =  'X'. ls_poschedulex-delivery_date = 'X'. ls_poschedulex-quantity =  'X'. ls_poschedulex-stat_date =  'X'. APPEND ls_poschedulex TO lt_poschedulex. CLEAR : ls_poschedulex . *-- Append the values to the container. swc_set_element container 'POHEADER' ls_poheader. swc_set_element container 'POHEADERX' ls_poheaderx. swc_set_table  container 'POITEM' lt_poitem. swc_set_table  container 'POITEMX' lt_poitemx. swc_set_table  container 'POSCHEDULE' lt_poschedule. swc_set_table  container 'POSCHEDULEX' lt_poschedulex. 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  = container[]. *  MESSAGE_LINES          = *  MESSAGE_STRUCT          = Thanks in advance. Regards, Raghunadh Kodali.


Viewing all articles
Browse latest Browse all 3668

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>