‎2007 Feb 23 4:59 AM
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.
‎2007 Feb 23 5:02 AM
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
‎2007 Feb 23 5:02 AM
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
‎2007 Feb 23 5:04 AM
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
‎2007 Feb 23 5:12 AM
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
‎2007 Feb 23 5:21 AM
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.