query in using repeat and until

Hi All,

I have below code , here i want to take out the number of shipment has been done along one Sales order. here i have write this code here iam getting only the last vaule . means for example (suppoese SO/1213/001 is sales order now i have done shipment ,SHIP/1213/001,SHIP/1213/002, SHIP/1213/003,in three time , now i want all these 3 shipment number along with Sales order number iam only able to get either the first one(SHIP/1213/001) or the last one(SHIP/1213/004) , can any one give me any idea how to get all these three shipment number .)

int := 1;
shipmentno := ‘’ ;
shipmentno1 := ‘’ ;
recsalesshipmenthead.SETRANGE(recsalesshipmenthead.“Order No.”,sonumber);
IF recsalesshipmenthead.FINDFIRST THEN
IF recsalesshipmenthead.“Order No.” = ‘’ THEN
shipmentno := ‘’
shipmentno1 := recsalesshipmenthead.“No.”;
shipmentno := recsalesshipmenthead.“No.”;
UNTIL recsalesshipmenthead. NEXT = 0;

grecExcelBuffer.AddColumn( shipmentno,FALSE,’’,FALSE,FALSE,FALSE,’’);
shipmentno1 := shipmentno;



where do you need this?

report? form?

in report , i have to made the report which PO is use against which SO, here i have to give the details. GRN ,PI, Shipmet number , sales invoice.

Sales Order No. Customer Name Customer Code Sales Person Shipment No.
SO-A/1112/0359 MsourcE India Private Limited C02739 VIPUL P. SALAHM/1213/0037

Here iam attching the data which i require and how the data is coming4087.Reqirement data.xlsx (9.78 KB)

You should use repeat until like

recsalesshipmenthead.SETRANGE(recsalesshipmenthead.“Order No.”,sonumber);
IF recsalesshipmenthead.FINDSET THEN

shipmentno1 := recsalesshipmenthead.“No.”;

// you should add code here to export to excel.

UNTIL recsalesshipmenthead. NEXT = 0;

i have done this but the data is coming in worng fromat like this which iam attaching with this4744.Reqirement data.xlsx (9.61 KB)

You need to increase the Row No.

ok, i will try this also