cancel
Showing results for 
Search instead for 
Did you mean: 

Not Able to Pass the Values to WorkFlow Container

bpawanchand
Active Contributor
0 Kudos

Hi All,

Iam calling a WF from a BSP application by using the FM

EWW_WORKFLOW_START

for this fucntion module iam passing a table to the parameter

X_CONATINER = t_values

but I am a bit confused that how this table is assigned to the workflow conatiner.

what I want to know is I need to assign the values of t_values to the WF conatiner elements .

Thanks In Advance.

Regards

Pavan

Accepted Solutions (0)

Answers (3)

Answers (3)

bpawanchand
Active Contributor
0 Kudos

Thanks SAHOO it worked

Former Member
0 Kudos

Hi,

in top of your code

include<cntn01>.

then create container

swc_container lt_event_container.

swc_create_container lt_event_container.

To set container element use:

swc_set_element

lt_event_container

'ZDATE' DATE.

To assign table means multiline container element.

swc_set_table

lt_event_container

'ZUSER' zagents.

In above E.G. ZDATE and ZUSER(multiline) is container element. and date and zagents is variable and table.

pass this container when you call WF.

Hope magic Works!

Regards,

Purvesh.

bpawanchand
Active Contributor
0 Kudos

Hi

Thanks for the reply but let me explain my case to you clearly,

First of all

Iam not passing the values from a ABAP program

the values are passed from a BSP application and all the necessary instructions are defined where Iam able to fill the values into the conatiner (T_conatiner) .

Now When I call the FM EWW_WORKFLOW_START from the BSP I am passing the T_conatiner to the work flow , from the BSP side the sy-subrc value is equal to zero.

Workflow side

Now in the workflow side how I can assign the values that are in the table t_conatiner to the workflow conatiner element CONT

Regards

Pavan

Former Member
0 Kudos

Pavan,

this table is used to pass the workflow container element values to the workflow. Make sure you pass the 'ELEMENT' and 'VALUE' pair to this table, whatever values you want to pass to the workflow container. Also make sure the name you pass to the 'ELEMENT' should be present in the workflow container and the name should be exactly same. U can also use the FM 'SAP_WAPI_START_WORKFLOW' or 'SAP_WAPI_CREATE_EVENT' to start the WF.

bpawanchand
Active Contributor
0 Kudos

Hi

I tried but it is not working , as you said I have declared a table enabling Multiline with the same type in the work flow container but still Iam able to see only 0000000000 but nothing any more.

Even I tried to execute the Function module directly from SE37 and passed some values to the table parameter X_CONATINER but still am not able to get the values that are stored in the table.

Regards

Pavan

Former Member
0 Kudos

Pavan,

try this code and include this in your corresponding include.

Make sure that your workflow has a multiline import element with the same name as of the internal table. Here, WERKS.

REPORT yh_sample.
DATA : t_container TYPE TABLE OF swcont WITH HEADER LINE,
        wf_id TYPE swwwihead-wi_id.
DATA: werks TYPE STANDARD TABLE OF werks_d WITH HEADER LINE.

DEFINE swc_set_element.
  call function 'SWC_TABLE_SET'
    exporting
      element       = &2
    tables
      container     = &1
      table         = &3
    exceptions
      type_conflict = 1.
END-OF-DEFINITION.

werks = '1000'.
APPEND werks.
werks = '1003'.
APPEND werks.
werks = '1056'.
APPEND werks.

swc_set_element t_container  'WERKS' werks.

CALL FUNCTION 'EWW_WORKFLOW_START'
  EXPORTING
    x_task          = 'WS99901222'
  IMPORTING
    y_workflow_id   = wf_id
  TABLES
    x_container     = t_container
  EXCEPTIONS
    invalid_task    = 1
    no_active_plvar = 2
    start_failed    = 3
    general_error   = 4.
IF sy-subrc = 0.
  COMMIT WORK.
  MESSAGE 'success' TYPE 'S'.
  WRITE:/ wf_id.
ELSE.
  MESSAGE 'Error' TYPE 'S'.
ENDIF.

Regards

Indu.