2008 Jan 12 1:38 PM
why does the ****** error occur when "AT NEW" keyword is used?
2008 Jan 12 10:23 PM
Hi Sashi,
Assume you have your internal table(ITAB) as
Field1
Field2
Field3
Field4
Field5
Field6
Field7
Now when you say AT NEW FIELD1 then all the remaining fields will show as '*'. This is because the control statement AT NEW <fieldname> will consider values only upto <fieldname> and ignores the rest of the fields.
Thats why when ever you want to use control statements then you always move the value from you workarea to another work are
SORT ITAB.
LOOP AT ITAB INTO WA_ITAB1.
WA_ITAB2 = WA_ITAB1.
AT NEW FIELD1.
BREAK-POINT. ---> Here you will be able to ONLY see values of fields FIELD1 and FIELD2 of WA_ITAB1.
But you will be able to see all the Field values from WA_ITAB2
ENDAT.
ENDLOOP.
Hope this solves your problem.
Reward points of useful.
Enjoy SAP.
Rajasekhar
2008 Jan 12 10:23 PM
Hi Sashi,
Assume you have your internal table(ITAB) as
Field1
Field2
Field3
Field4
Field5
Field6
Field7
Now when you say AT NEW FIELD1 then all the remaining fields will show as '*'. This is because the control statement AT NEW <fieldname> will consider values only upto <fieldname> and ignores the rest of the fields.
Thats why when ever you want to use control statements then you always move the value from you workarea to another work are
SORT ITAB.
LOOP AT ITAB INTO WA_ITAB1.
WA_ITAB2 = WA_ITAB1.
AT NEW FIELD1.
BREAK-POINT. ---> Here you will be able to ONLY see values of fields FIELD1 and FIELD2 of WA_ITAB1.
But you will be able to see all the Field values from WA_ITAB2
ENDAT.
ENDLOOP.
Hope this solves your problem.
Reward points of useful.
Enjoy SAP.
Rajasekhar