Dear all,i have this following codes
a = Long.parseLong(wdContext.currentContextElement().getMat_doc_frm());
b = Long.parseLong(wdContext.currentContextElement().getMat_doc_to());
c = b-a + 1;
Zbapi_Goodsmvt_Getdetail_Input stockitem = new Zbapi_Goodsmvt_Getdetail_Input();
Zdocnum docnum = new Zdocnum();
for(int x = 1; x <= c; x++){
docnum.setMat_Doc(String.valueOf(a));
docnum.setDoc_Year(wdContext.currentContextElement().getYear());
stockitem.addZdocnum(docnum);
wdComponentAPI.getMessageManager().reportSuccess(docnum.getMat_Doc());
wdComponentAPI.getMessageManager().reportSuccess(docnum.getDoc_Year());
a = a+1;
}
wdContext.nodeZbapi_Goodsmvt_Getdetail_Input().bind(stockitem);
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try {
wdContext.currentZbapi_Goodsmvt_Getdetail_InputElement().modelObject().execute();
} catch (WDDynamicRFCExecuteException ce) {
manager.reportException(ce.getMessage(), false);
}
let said i key in the doc_num_frm as 5000002567 and doc_num_to as 5000002568,it seems that the stockitem.addZdocnum(docnum); only captur the last number which is 5000002568 for 2 times...it shd be 5000002567 and 5000002568..but now the data inside the stockitem for zdocnum is both oso 5000002568.. any idea why lead to this? thanks