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: 

Control Events

Former Member
0 Kudos
182

Hi,

Can anyone tell me what control events in ABAP are and their syntax.

Thanks n Regards

Dinesh

1 ACCEPTED SOLUTION

shahid
Product and Topic Expert
Product and Topic Expert
0 Kudos
149

1. AT FIRST

2: AT NEW

3. AT END OF

4. AT LAST

5. ON CHANGE OF...this is can be used out side the loop also....

9 REPLIES 9

Former Member
0 Kudos
149

Hi

I suppose you mean the events for validation, don't you?

If it's so, they are the event AT SELECTION-SCREEN except:

- AT SELECTION-SCREEN OUTPUT: it should be used to change the attributes of selection-screen;

- AT SELECTION-SCREEN ON VALUE-REQUEST: it's to trigger a search help;

- AT SELECTION-SCREEN ON HELP-REQUEST: it's to trigger the documentation of an input field.

These events allow to insert some validations who stops the running of the program at the selection-screen level in order to correct the errors.

Max

Former Member
0 Kudos
149

hi..

control break events are

at new(every new record follows)

at first (at the top of the list i.e,first statement like headers)

at end of (every record ends it get triggered)

at last ( it is useful in summation of records) these r used in loop statements only

If you want to execute some statements for certain records of the dataset only, use the control statements AT and ENDAT.

The system processes the statement blocks between the control statements for the different options of AT as follows:

AT FIRST

The system executes the statement block once for the first record of the dataset.

AT LAST

The system executes the statement block once for the last record of the dataset.

You can also use the AT and ENDAT statements for control level processing

<b>Reward points if useful</b>

Regards

Ashu

Former Member
0 Kudos
149

Refer

Former Member
0 Kudos
149

hi,

check this link

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9f1f35c111d1829f0000e829fbfe/content.htm

Control statements of an internal table are:

1. AT FIRST

2: AT NEW

3. AT END OF

4. AT LAST

AT <line>.

<statement block>

ENDAT.

FIRST

the first line of the internal table

LAST

the last line of the internal table

NEW <field>

the beginning of a group of lines with the same contents in <field> and in the superior fields

END OF <field>

the end of a group of lines with the same contents in <field> and in the superior fields

Regards

Reshma

Former Member
0 Kudos
149

Hi,

Control Events are

1. AT NEW f. 
2. AT END OF f. 
3. AT FIRST. 
4. AT LAST.

When you sort an extract dataset, control levels are defined in it.The control level hierarchy of an extract dataset corresponds to the sequence of the fields in the HEADER field group. After sorting, you can use the AT statement within a loop to program statement blocks that the system processes only at a control break, that is, when the control level changes.

AT NEW <f> | AT END OF <f>.

...

ENDAT.

A control break occurs when the value of the field <f> or a superior field in the current record has a different value from the previous record (AT NEW) or the subsequent record (AT END). Field <f> must be part of the HEADER field group.

If the extract dataset is not sorted, the AT... ENDAT block is never executed. Furthermore, all extract records with the value HEX 00 in the field <f> are ignored when the control breaks are determined.

The AT... ENDAT blocks in a loop are processed in the order in which they occur. This sequence should be the same as the sort sequence. This sequence must not necessarily be the sequence of the fields in the HEADER field group, but can also be the one determined in the SORT statement.

If you have sorted an extract dataset by the fields <f1>, <f2>, ..., the processing of the control levels should be written between the other control statements as follows:

LOOP.

AT FIRST.... ENDAT.

AT NEW <f1>....... ENDAT.

AT NEW <f2>....... ENDAT.

...

AT <fgi>..... ENDAT.

<single line processing without control statement>

...

AT END OF <f2>.... ENDAT.

AT END OF <f1>.... ENDAT.

AT LAST..... ENDAT.

ENDLOOP.

You do not have to use all of the statement blocks listed here, but only the ones you require.

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/at_itab.htm

Regards

Sudheer

Former Member
0 Kudos
149

shahid
Product and Topic Expert
Product and Topic Expert
0 Kudos
150

1. AT FIRST

2: AT NEW

3. AT END OF

4. AT LAST

5. ON CHANGE OF...this is can be used out side the loop also....

Former Member
0 Kudos
149

Thanks Guys.... it was helpful

Former Member
0 Kudos
149

check out

help.sap.com