Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

report

Former Member
0 Likes
460

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
441

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.

5 REPLIES 5
Read only

Former Member
0 Likes
441

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.

Read only

Former Member
0 Likes
442

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.

Read only

0 Likes
441

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

Read only

0 Likes
441

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

Read only

0 Likes
441

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