0% found this document useful (0 votes)
8 views2 pages

AT New Event

The document describes the 'AT NEW' event in programming, which is triggered at the first record of each block and converts subsequent fields into masked values based on their data type. It provides an example of defining a structure and populating a table with data, demonstrating how to use 'AT NEW' to format output. The example illustrates how character fields are converted to asterisks and numeric fields to zeros when the event is triggered.

Uploaded by

Niranjan Thakur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

AT New Event

The document describes the 'AT NEW' event in programming, which is triggered at the first record of each block and converts subsequent fields into masked values based on their data type. It provides an example of defining a structure and populating a table with data, demonstrating how to use 'AT NEW' to format output. The example illustrates how character fields are converted to asterisks and numeric fields to zeros when the event is triggered.

Uploaded by

Niranjan Thakur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Description: AT New Event

1.At new event is triggered at first record of each block


2.When this event is triggered it converts the field after the selected field into
*********(for character type) & 000000000(for numeric type)
Example:- AT NEW bukrs.
write:/ wa_comp-bukrs, wa_comp-butxt, wa_comp-ort01.
ENDAT.
In this example all the fields after bukrs will be converted into ********* because
the data is provided in character type.
3.

types: BEGIN OF ty_comp,


bukrs type t001-bukrs,
butxt type t001-butxt,
ort01 type t001-ort01,
END OF ty_comp.

data: wa_comp type ty_comp,


wa type ty_comp,
it_comp type TABLE OF ty_comp.

wa_comp-bukrs = '1000'.
wa_comp-butxt = 'HCL'.
wa_comp-ort01 = 'Hyderabad'.
append wa_comp to it_comp.
clear wa_comp.

wa_comp-bukrs = '2000'.
wa_comp-butxt = 'CTS'.
wa_comp-ort01 = 'Bangalore'.
append wa_comp to it_comp.
clear wa_comp.

wa_comp-bukrs = '2000'.
wa_comp-butxt = 'TCS'.
wa_comp-ort01 = 'Mumbai'.
append wa_comp to it_comp.
clear wa_comp.

wa_comp-bukrs = '2000'.
wa_comp-butxt = 'TCS'.
wa_comp-ort01 = 'Mumbai'.
append wa_comp to it_comp.
clear wa_comp.

wa_comp-bukrs = '3000'.
wa_comp-butxt = 'HCL'.
wa_comp-ort01 = 'Chennai'.
append wa_comp to it_comp.
clear wa_comp.

wa_comp-bukrs = '3000'.
wa_comp-butxt = 'HCL'.
wa_comp-ort01 = 'Mumbai'.
append wa_comp to it_comp.
clear wa_comp.

sort it_comp with bukrs butxt.


LOOP AT it_comp into wa_comp.
wa_comp = wa.
At new butxt.
write:/ wa_comp-bukrs, wa_comp-butxt, wa_comp-ort01.
ENDAT.
ENDLOOP.

You might also like