‎2007 Apr 29 4:14 PM
hi guru's,
i've internal table namely itab,in tht i've 4 records with 4 four fields.
f1 f2 f3 f4
q 2 e 4
a 3 s 1
z 1 d 5
now while populating , in the loop i've used at new statement i.e
loop at itab.
at new
write : / itab.
end loop.
what will be the output.pls explain in detail.
thanx,
loki
‎2007 Apr 29 4:23 PM
Hi,
1. The code sample provided is incorrect. "At New <field>" will also have "ENDAT".
2. The code inside 'At New' and 'Endat' will be executed once for every new line (means when ever the data changes). If the table has duplicate records, this will be executed once for every unique line.
3. When using AT control statements, you must move the data into temporary work area. Else, the display will have *.
Hope this helps,
Sumant.
‎2007 Apr 29 4:19 PM
at new <field name>
ur output is based on tht field value since here we have different values in the field u will not find any difference.
‎2007 Apr 29 4:23 PM
Hi,
1. The code sample provided is incorrect. "At New <field>" will also have "ENDAT".
2. The code inside 'At New' and 'Endat' will be executed once for every new line (means when ever the data changes). If the table has duplicate records, this will be executed once for every unique line.
3. When using AT control statements, you must move the data into temporary work area. Else, the display will have *.
Hope this helps,
Sumant.
‎2007 Apr 29 5:20 PM
hi sumant,
suppose if i write like that then wat will happen.it's my interview question.if once it clear full points.
thanx
loki
‎2007 Apr 29 5:31 PM
Hi
if you write
loop at itab.
at new
write : / itab.
end loop.
gives syntax error, there is no full stop after at new.
after putting full stop it says that you have to use the AT NEW with a field in the internal table.
and also the table should be sorted before using at new.
reward points
regards
anji
‎2007 Apr 29 5:34 PM
hi anji,
for this if i'll write at new on some field wat wil be the output.if i'l use on change of wqt wil be the output.
thanx
loki