on 08-06-2008 2:53 PM
In my scenerio i have to pass some rows from table to bapi as input to create Sales order.I have to pass material number and quantity to BApi.
i am doing the following way but it is creating order but material Number and Quantity is not storing in backend.
Bapiitemin item = new Bapiitemin();
AbstractList Itemin = new Bapiitemin.Bapiitemin_List();
for(int i=0;i<wdContext.nodeVn_TablePop().size();i++)
{
item.setMaterial(wdContext.nodeVn_TablePop().getVn_TablePopElementAt(i).getVa_MaterialName());
Itemin.add(item);
}
Bapiitemin item1 = new Bapiitemin();
AbstractList Itemin1 = new Bapiitemin.Bapiitemin_List();
for(int i=0;i<wdContext.nodeVn_TablePop().size();i++)
{
item1.setReq_Qty(wdContext.nodeVn_TablePop().getVn_TablePopElementAt(i).getVA_ReqQuantity());
Itemin1.add(item1);
}
Hi saifee,
Follow the below codeing. try to minimize looping
Bapiitemin item = new Bapiitemin();
for(int i=0;i<wdContext.nodeVn_TablePop().size();i++)
{
Bapiitemin_List listitem = new Bapiitemin_List();
listitem.setMaterial(wdContext.nodeVn_TablePop().getVn_TablePopElementAt(i).getVa_MaterialName());
item1.setReq_Qty(wdContext.nodeVn_TablePop().getVn_TablePopElementAt(i).getVA_ReqQuantity());
listitem.add(listitem);
}
wdContext.node<yourbapi node name>.bind(item);
item.execute();
wdContext.node<your bapi output node>.invalidate();
regards,
sukanta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the problem got resolved with the soln help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It is not clear in your question where the problem is unless you provide more details about context structure and properties. But I guess, if you set entire structure in one place it can help you. Try like this:
Bapiitemin item = new Bapiitemin();
for(int i=0;i<wdContext.nodeVn_TablePop().size();i++)
{
AbstractList Itemin = new Bapiitemin.Bapiitemin_List();
item.setMaterial(wdContext.nodeVn_TablePop().getVn_TablePopElementAt(i).getVa_MaterialName());
item.setReq_Qty(wdContext.nodeVn_TablePop().getVn_TablePopElementAt(i).getVA_ReqQuantity());
Itemin.add(item);
}
Regards,
Siva`
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.