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

AT FIRST

Former Member
0 Likes
698

Hi Experts,

suppose i have a internal table which contains 5 fields and let suppose it contains 100 records. and i want to use AT NEW event

like

At New Field1. (key field)

it is displaying the value of field1 only and rest of the fields which of type 'C' and 'V' is replaced by 0 and spaces. How to overcome this problem.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
587

data: l_index type sy-index.

Loop at itab.

l_index = sy-index.

at new Field1.

read table itab into wa_itab index l_index.

*here you will get values for all the fields in work area wa_itab.

endat.

endloop.

I hope it helps.

Do let me know if u find any problem in this.

Best Regards,

Vibha

*Please mark all the helpful answers

4 REPLIES 4
Read only

Former Member
0 Likes
588

data: l_index type sy-index.

Loop at itab.

l_index = sy-index.

at new Field1.

read table itab into wa_itab index l_index.

*here you will get values for all the fields in work area wa_itab.

endat.

endloop.

I hope it helps.

Do let me know if u find any problem in this.

Best Regards,

Vibha

*Please mark all the helpful answers

Read only

Former Member
0 Likes
587

Hi,

DO LIKE THIS.

First sort the internal table by the Key field.

Sort itab by F1 F2 F3 ..

Loop at Itab.

at new F1.

write.....

endat.

write:...< other fields>

Endloop.

Regards,

Anji

Read only

Former Member
0 Likes
587

Hi,

in control events the values after the field is being referred will be ***** like this or zeroes will be there

to over come this declare a variable and perform the operation

DATA: BEGIN OF COMPANIES OCCURS 20,

NAME(30),

PRODUCT(20),

SALES TYPE I,

END OF COMPANIES.

...

LOOP AT COMPANIES.

AT NEW NAME.

NEW-PAGE.

WRITE / COMPANIES-NAME.

ENDAT.

WRITE: / COMPANIES-PRODUCT, COMPANIES-SALES.

AT END OF NAME.

SUM.

WRITE: / COMPANIES-NAME, COMPANIES-SALES.

ENDAT.

ENDLOOP.

The AT statements refer to the field COMPANIES-NAME

Regards

Shiva

Read only

Former Member
0 Likes
587

Hi,

If u use AT NEW f1or ant event like AT END xxx

As soon as this reads the ne filed it will make the entire row into like that.

Only the numeric filed will be dispalyed.

Loop at itab into wa.

AT NEW f1.
take the values from wa, or
read the values from the itab.

ENDAT.
ENDLOOP

.

Hoep thisis clear.