‎2005 Nov 28 4:15 PM
Hi experts,
i want to use at new for 7th field of the table.
i have sorted the table. i have the three records with
opno 10,20,30....
i want to save the data after opno = 30.
see the following code.
but the first loop itself the control is trigging AT END OF event.
where i am doing wrong.
Please help me.
sort itab by opno.
Loop at itab.
at first.
first_flag = 'x'
.....
.....
endat.
AT END OF opno.
last_flag = 'x'.
END AT.
if last flag = 'x'.
....
...
endif.
where i am doing wrong.
Please help me.
‎2005 Nov 28 4:19 PM
Ramesh,
Change as follows in BOLD.
Loop at itab.
at first.
.....
.....
endat.
AT END OF opno.
<b>if opno > 30....
DO WHAT EVER U WANT...
endif.</b>
END AT.
endloop.
Thanks
Kam
‎2005 Nov 28 4:19 PM
Ramesh,
Change as follows in BOLD.
Loop at itab.
at first.
.....
.....
endat.
AT END OF opno.
<b>if opno > 30....
DO WHAT EVER U WANT...
endif.</b>
END AT.
endloop.
Thanks
Kam
‎2005 Nov 28 4:26 PM
thanks for your reply.
my opno will be changed on order number.
for example:
orderno subordno fieldx fieldy opno
900123 10054 xxx yyyy 10
900123 10053 xxx yyyy 20
900123 10057 xxx yyyy 30
900124 10052 xxx yyyy 10
900124 10059 xxx yyyy 20
900126 10053 xxx yyyy 10
900127 10051 xxx yyyy 10
900343 10335 xxx yyyy 10
900345 10334 xxx yyyy 20
900345 10033 xxx yyyy 30
‎2005 Nov 28 4:27 PM
sorry
it shoud be like this
900123 10054 xxx yyyy 10
900123 10053 xxx yyyy 20
900123 10057 xxx yyyy 30
900124 10052 xxx yyyy 10
900124 10059 xxx yyyy 20
900126 10053 xxx yyyy 10
900127 10051 xxx yyyy 10
900345 10335 xxx yyyy 10
900345 10334 xxx yyyy 20
900345 10033 xxx yyyy 30
‎2005 Nov 28 4:30 PM
‎2005 Nov 28 4:33 PM
You should try AT END OF ordernum, because, I think that is what you are trying to do.
Srinivas
‎2005 Nov 28 4:34 PM
‎2005 Nov 28 4:36 PM
hi,
I guess your problem is that, if any field before the 7th have changed, it will get in the "at new" statement.
You got it ?
Alexandre Nogueira.
‎2005 Nov 28 4:37 PM
Ramesh,
Rich, I gave him the same idea in my first posting!!!
Loop at itab.
at first.
.....
.....
endat.
<b>AT END OF opno.
if opno > 30....
DO WHAT EVER U WANT...
endif.
END AT.</b>
endloop.
‎2005 Nov 28 4:26 PM