on 11-26-2009 6:56 AM
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
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes , its resolved.
Regards,
Anitha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.