cancel
Showing results for 
Search instead for 
Did you mean: 

Repeated valuues

Former Member
0 Kudos

Hi ! , i have a problem , this code needs to add like 80 different values from the context node but the values are repeated 80 times with the 80th value and then send 80 same values to the bapi, !?, does anyone knows why ? thanks

, i tried with zproductoswebPed.addPosnr but it is not such method, zproductoswebPed is an structure from an rfc....

for (int x = 0; x < wdContext.nodeCarrosDocumentados().size(); x++) {

zproductoswebPed.setPosnr(wdContext.nodeCarrosDocumentados().getElementAt(x).getAttributeValue("Peso").toString());

bapiPedidos.addIt_Posiciones(zproductoswebPed);

}

"call rfc" bla bla bla. . .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You are using the same "Object Reference" when adding it to the Collection. This is due the fact you're probably using the "new zproductoswebPed" outside the "for" loop.

Try declaring it inside your "for" logic, set the properties you want, and add it to the Collection before the loop ends, like you're already doing.

Hope it helps.

Regards,

Daniel

Answers (1)

Answers (1)

Former Member
0 Kudos

That is the answer duhhhh , i didnt notice, thanks a lot.