01-29-2009 3:44 AM
Hi all,
AT END OF (char field) not working,
I sorted the itab and also avoid the stars(*) problem also, but its not working.
Thanks in advance.
Edited by: Vijay Babu Dudla on Jan 28, 2009 11:01 PM
01-29-2009 3:48 AM
AT END OF <field>.
automatically compares all fields preceding <field> and including <field>, so if yous internal table has it structure like
field1 field3 field3 field4
and you do
AT END OF <field3>.
field1, field2 and field3 will be compared, so you need to sort the table upto and including all fields preceding field3
01-29-2009 3:48 AM
hi
there can be some problems like the fields on which we want BREAK,should always be on the left.also
SORT on the date field initially.
check the order of your fields and sort it accordingly.
hope it helps
regards
Aakash Banga
01-29-2009 3:48 AM
AT END OF <field>.
automatically compares all fields preceding <field> and including <field>, so if yous internal table has it structure like
field1 field3 field3 field4
and you do
AT END OF <field3>.
field1, field2 and field3 will be compared, so you need to sort the table upto and including all fields preceding field3
01-29-2009 4:36 AM
Thank U Vuishnu,
ur timely response solved my problem.
Regards Niranjan.
01-29-2009 3:48 AM
01-29-2009 3:51 AM
01-29-2009 3:54 AM
01-29-2009 4:22 AM
Hi Niranjan.
Please beware of the list as follow when u want to use loop control suach AT END OF ,AT *
1.All fields which you want to use as a key of loop must be ordered and sorted.
2.Don't use WHERE condition on LOOP AT
3.beware to use LOOP inside LOOP
Hope it helps.
Sayan.
01-29-2009 4:26 AM
Hi,
At end will work only if the field is on the first position in the table structure.
Regards,
Dev.
01-29-2009 4:29 AM
Hello Niranjan
try this it will help you
AT END OF field name.
.
ENDAT.
At end of check automatically end of the field value that you have compared.
Thanks
Arun kayal.
01-29-2009 4:33 AM
Hi, Niranjan
Test the following Sample Code it will solve out your Problem,
" This is not working properly right now.
TYPES: BEGIN OF t_name,
name1(10), " if You Change Cut the Name2 from the 2nd line and past it up to the Name one will work fine
name2(10),
amount1 TYPE p,
amount2 TYPE p,
END OF t_name.
DATA: it1_sum TYPE STANDARD TABLE OF t_name WITH HEADER LINE,
wa_it1_sum TYPE t_name,
it2_sum TYPE STANDARD TABLE OF t_name WITH HEADER LINE,
wa_it2_sum TYPE t_name.
wa_it1_sum-name1 = 'AAAAAA'.
wa_it1_sum-name2 = 'AAAAAA'.
wa_it1_sum-amount1 = 500.
wa_it1_sum-amount2 = 200.
APPEND wa_it1_sum TO it1_sum.
wa_it1_sum-name1 = 'AAAAAA'.
wa_it1_sum-name2 = 'AAAAAA'.
wa_it1_sum-amount1 = 500.
wa_it1_sum-amount2 = 200.
APPEND wa_it1_sum TO it1_sum.
wa_it1_sum-name1 = 'BBBBBB'.
wa_it1_sum-name2 = 'AAAAAA'.
wa_it1_sum-amount1 = 100.
wa_it1_sum-amount2 = 200.
APPEND wa_it1_sum TO it1_sum.
wa_it1_sum-name1 = 'AAAAAA'.
wa_it1_sum-name2 = 'AAAAAA'.
wa_it1_sum-amount1 = 500.
wa_it1_sum-amount2 = 10000.
APPEND wa_it1_sum TO it1_sum.
wa_it1_sum-name1 = 'BBBBBB'.
wa_it1_sum-name2 = 'AAAAAA'.
wa_it1_sum-amount1 = 105000.
wa_it1_sum-amount2 = 20500.
APPEND wa_it1_sum TO it1_sum.
wa_it1_sum-name1 = 'BBBBBB'.
wa_it1_sum-name2 = 'AAAAAA'.
wa_it1_sum-amount1 = 21000.
wa_it1_sum-amount2 = 22000.
APPEND wa_it1_sum TO it1_sum.
SORT it1_sum BY name1 name2.
LOOP AT it1_sum INTO wa_it1_sum.
APPEND wa_it1_sum TO it2_sum.
AT END OF name2. " When you will use this in this Condition it will give you wrong Because this row is on number two and
" it is not changing but the Row one is Changing so it will work fine if LEFT MOST
SUM.
wa_it1_sum-name1 = 'End Name 2'.
wa_it1_sum-name2 = 'End Name 2'.
APPEND wa_it1_sum TO it2_sum.
ENDAT.
AT LAST.
SUM.
wa_it1_sum-name1 = 'At Last'.
APPEND wa_it1_sum TO it2_sum.
ENDAT.
ENDLOOP.
Please Reply if need more help about it.
Kind Regards,
Faisal