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: 

clear screen

Former Member
0 Kudos
2,753

hi experts,

like in 'C' language we have a command called 'CLRSCR' to the clear screen.

do we have in abap also .

or any another way.

please send me.

regards,

aejaz

8 REPLIES 8

Former Member
0 Kudos
502

To reset a variable <f> to the appropriate initial value for its type, use the statement

CLEAR <f>.

This statement has different effects for different data types:

Elementary ABAP types

The CLEAR statement sets the value of an elementary variable to the initial value specified for its type (see the table in Predefined ABAP Types), and not to the starting value that you specified in the VALUE addition to the DATA statement.

References

The CLEAR statement resets a reference variable to its initial value, that is, so that it does not point to an object.

Structures

The CLEAR statement resets the individual components of a structure to their respective initial values.

Internal tables

The CLEAR statement deletes the entire contents of an internal table (see also Initializing Internal Tables).

You cannot use the CLEAR statement to reset a constant.

DATA NUMBER TYPE I VALUE '10'.

WRITE NUMBER.

CLEAR NUMBER.

WRITE / NUMBER.

The output appears as follows:

10

0

The CLEAR statement resets the contents of the field NUMBER from 10 to its initial value 0.

0 Kudos
502

hi,

i need a command to clear the entire screen.

i think u got me now

Former Member
0 Kudos
502

hi,

u can clear statement in abap.

or initial keyword also.

ex: clear a. // value will be erased.

clear itab. /// work area is cleaerd.

clear itab[] /// body of internal table is cleared.

if helpful reward some points.

with regards,

Suresh.A

Former Member
0 Kudos
502

Hi,

There is no such command.

One way you can do it like HIDE screen elements.

Use AT SELECTION SCREEN OUTPUT in that modify screen and make elements invisible.

Reward if useful!

Former Member
0 Kudos
502

Hi Aejaj,

CLEAR

Resets a variable to its initial value.

Syntax

CLEAR <f>.

Resets the variable <f>, which may be of any data type, to the initial value defined for that type.

the clear statement for clear the moemory space.

If useful rewrd points.

Thanks.

Sanket.

Former Member
0 Kudos
502

i don't think there is any particular syntax for clearing a screen.

u can definitely clear a filed and work area and body of internal tables as told by our friends.

regards,

srinivas

<b>*reward for useful answers*</b>

Former Member
0 Kudos
502

Well,

You cannot actually clear the screen in ABAP.

However, we can create the illusion that the screen is clear.

if we use the statement 'write : /' around 100 times,

the cursor goes 100 rows below.

This gives an impression that the screen is clear.

However a scrollbar is there.

Regards,

Ravi

Former Member
0 Kudos
502

Hi ,

I dont think there is a command like CLRSCR in ABAP :

If you could tell what is your exact requirement may be we could suggest you some alternatives.

Regards

Arun