cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass multiple values to table type

Former Member
0 Kudos

hi,

we have a requirment like this :

we are using the BAPI - SWN_UWL_GET_WORKLIST to get work list.

here i need to pass multiple status to the inputparameter - IM_STATUS_FILTER

which of type - Swr_Status(which of type table type).

i am using following code to do that:

Swr_Status inputStatus = new Swr_Status();

Swr_Status_List statusList = new Swr_Status_List();

inputStatus.setWi_Stat("ready");

statusList.addSwr_Status(inputStatus);

input.setIm_Status_Filter(statusList);

Swr_Status inputStatus1 = new Swr_Status();

Swr_Status_List statusList1 = new Swr_Status_List();

inputStatus1.setWi_Stat("started");

statusList1.addSwr_Status(inputStatus1);

input.setIm_Status_Filter(statusList1);

but it is not taking values for both the status.it is taking only latest one .how can i pass multiple values to table type ?

Pls suggest me on this.

Regards,

Anitha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

thanks

Former Member
0 Kudos

You are welcome!

But is your issue resolved?

Regards,

Tushar Sinha

Answers (2)

Answers (2)

Former Member
0 Kudos

yes , its resolved.

Regards,

Anitha

Former Member
0 Kudos

Hi Anitha,

Use the following code instead. Should work.

-


SWN_UWL_GET_WORKLIST_INPUT input = new SWN_UWL_GET_WORKLIST_INPUT();

Swr_Status_List statusList = new Swr_Status_List();

Swr_Status inputStatus = new Swr_Status();

inputStatus.setWi_Stat("ready");

statusList.addSwr_Status(inputStatus);

Swr_Status inputStatus1 = new Swr_Status();

inputStatus1.setWi_Stat("started");

statusList.addSwr_Status(inputStatus);

input.setIm_Status_Filter(statusList);

-


It was happening because you were using the line

input.setIm_Status_Filter(statusList1);

and creating new instance statusList1 for Swr_Status_List for the second time which was not required

as input (instance of SWN_UWL_GET_WORKLIST_INPUT) is instance of structure node and not a table node

which can take multiple values as when you were trying to use the below line twice.

input.setIm_Status_Filter(<Object>);

So it was only taking what was updating the first value with the last value and only the last value vas getting passed.

Remember only Swr_Status_List is a table and not SWN_UWL_GET_WORKLIST_INPUT.

Cardinality of structure is 0..1 and that of a table is 0..n (where Cardinality is the potential to contain elements within a node).

Hope it helps!

Regards,

Tushar Sinha