Application Development 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: 

About at new control statement

Former Member
0 Kudos

hello everybody

I need a small information about at new control ..like when i'm using this control to get every new vendor details ...in the out put its coming the related data like ********** .why its comin like this .can i know .please help me out .

thanks&regards

Lavanya

1 ACCEPTED SOLUTION

Former Member
0 Kudos

after AT NEW , READ the itab

Loop at itab.

at new lifnr.

<b>READ TABLE ITAB INDEX SY-TABIX.</b>

endat.

endloop.

5 REPLIES 5

Former Member
0 Kudos

after AT NEW , READ the itab

Loop at itab.

at new lifnr.

<b>READ TABLE ITAB INDEX SY-TABIX.</b>

endat.

endloop.

0 Kudos

Thank you for your response sir.

but the thing is why those ****** are coming in place of my data . i want to know .can u please help me.

thanks & regards

lavanya

0 Kudos

The reason for such happening is,

Suppose the records are like

100 abc

100 def

100 ghi

200 abc

200 def

200 ghi.

You want the output to be displayed as

100 abc

def

ghi

200 abc

def

ghi.

But when you use Control events, you are reading the value of first field as 100 and then you have 3 different values to be printed(i.e., abc, def, ghi). So the system will not be able to judge which value to print and it prints that ***** sequence.

To avoid this we use READ TABLE...

Regards,

Pavan P.

0 Kudos

One way to get the original values is to use a temporary work area for the loop:

LOOP AT lt_tab INTO lw_temp.

  • Copy work area to avoid dataloss during AT command

lw_tab = lw_temp.

AT NEW some_field.

  • At this point use the original work area lw_tab instead of lw_temp to avoid *****

ENDAT.

ENDLOOP.

Hope it helps

Former Member
0 Kudos

AT for group change

Change of group when processing loops of extracts and internal tables.

Syntax

AT NEW <f>.

AT END OF <f>.

AT FIRST.

AT LAST.

AT <fg>.

The statements are used to process group levels within a loop using an extract dataset or an internal table. They introduce statement blocks that must be closed with ENDAT. The statements between AT and ENDAT are only executed if the corresponding group change occurred.

When ever you use the control events and display the data you get some scrapped values.

So, to avoid it use <b>READ TABLE <table name> INTO <WA></b>. and then print the values.

Regards,

Pavan P.