cancel
Showing results for 
Search instead for 
Did you mean: 

passing variables from abap program to workflow

Mirzonabot
Discoverer
0 Kudos

I am creating a container for the function to pass some variables to the workflow. Below is the code of how I am creating the container and adding elements and tables to it.

 

swc_container lt_input_container.
    swc_create_container lt_input_container.
*Set container element
    swc_set_element lt_input_container 'HeaderData' wa_header.
    swc_set_element lt_input_container 'HeaderDataAdd' wa_header_add.
    swc_set_element lt_input_container 'Language' sy-langu.
    swc_set_element lt_input_container 'Testrun' v_testrun.
*Set Container table
    swc_set_table lt_input_container 'ItemData' it_item.
    swc_set_table lt_input_container 'SenderItemData' it_sender.
    swc_set_table lt_input_container 'PeriodData' it_period.
    swc_set_table lt_input_container 'SenderPeriodData' it_period_send.

    MESSAGE 'Sent for approval. Check mail for further updates.' TYPE 'I'.
*Trigger Workflow
    CALL FUNCTION 'EWW_WORKFLOW_START'
      EXPORTING
        x_task          = 'WS99600001'
      IMPORTING
        y_workflow_id   = lv_workitem_id
      TABLES
        x_container     = lt_input_container
      EXCEPTIONS
        invalid_task    = 1
        no_active_plvar = 2
        start_failed    = 3
        general_error   = 4
        OTHERS          = 5. 

Next in the approval of the workflow, I am trying to get the container as shown in the below code:

  swc_get_element ac_container 'LEVEL' l_wflevel.
  swc_get_table ac_container 'PeriodData' perioddata.

The interesting thing is that in the ac_container (while debugging) I do not see other tables and elements  (like SenderItemData). I see only level and perioddata in the debugging.

Can someone please help me figure out how to get all of the container elements and tables in the workflow?

Accepted Solutions (0)

Answers (0)