lost value of line no. out of for loop


i import the data using xmldom variable from xml file

my xml file file have one payment and one one payment have multiple invoice and booking.

i get the properly get all the value. but when i insert the data in customized table i lost line no. valueout of the loop

this is my code

in this code my invoice loop is end and data is inserted in table.

then i fetch the booking data by setrange with LineNo_gint variable and modify the table.

but issue is that after my loop is end after invoice tag.for multiple line i have found last value for that line. i can’t fetch all the line after exiting the invoice loop.

can any one give me the suggetion regrading this issue?

FOR f := 0 TO items2.Count - 1 DO
title3 := items2.Item(f);
items3 := title3.SelectNodes(‘Invoice’);
FOR g := 0 TO items3.Count -1 DO BEGIN
title4 := items3.Item(g);
attributesList2 := title4.Attributes;
FOR h := 0 TO attributesList2.Count - 1 DO

PaymentCreationDate_inv_gtxt := attributesList2.GetNamedItem(‘PaymentCreationDate’).Value;

IF CustomerPayment_hdr1.FINDLAST THEN
LineNo_gint := CustomerPayment_hdr1.LineNo + 10000
LineNo_gint := 10000;

EVALUATE(CustomerPayment_hdr.Id , Payment_idgxtx);
CustomerPayment_hdr.LineNo := LineNo_gint;



items4 := title.SelectNodes(‘Bookings’);
FOR i := 0 TO items4.Count - 1 DO
title5 := items4.Item(i);
items5 := title5.SelectNodes(‘Booking’);
FOR j := 0 TO items5.Count -1 DO BEGIN
title6 := items5.Item(j);
attributesList3 := title6.Attributes;
FOR k := 0 TO attributesList3.Count - 1 DO
Booking_PaymentLineId_gtxt := attributesList3.GetNamedItem(‘PaymentLineId’).Value;

IF CustomerPayment_hdr2.FINDSET THEN
CustomerPayment_hdr2.“Booking PaymentLineId” := Booking_PaymentLineId_gtxt;

UNTIL CustomerPayment_hdr2.NEXT = 0;

Hi Expn,
Exactly what do you mean? It does everything correct, but the last line on each invoice or just the last line?
And which version of NAV is this?