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: 

ABAP GENERAL

Former Member
0 Kudos

How do you clear data already written using the 'WRITE' syntax?

1 ACCEPTED SOLUTION

vinod_vemuru2
Active Contributor
0 Kudos

Hi Siddarth,

While writing data to a list output u can over write the already written data only if your cursor is there in the same line. If the cursor is moved to the next line using the syntax WRITE:/ or

SKIP or NEW-LINE u can't return back the previous line.

Check below sample code for over writing the data which is already written to the list output.

DATA w_space(5) TYPE c VALUE IS INITIAL.

WRITE:/1 'Vinod'.

WRITE: 1 w_space.

O/P: Blank.

u can over write data by specifyings the position from where u want to over write also.

WRITE AT 3 w_space.

O/P: Vi

Thanks,

Vinod.

5 REPLIES 5

dhruv_shah3
Active Contributor
0 Kudos

Hi,

Clear that Work Area....in which the data is stored runtime.

CLEAR WA_IT.

HTH

Regards,

Dhruv Shah

Former Member
0 Kudos

Hi,

Just use CLEAR ITAB before WRITE STATEMENT.

Award Points If Useful

Former Member
0 Kudos

hi ,

check this ......

data: v_test(23).

write 'this is working boss' to v_test.

write:/ v_test.

write 'this is working boss' to v_test.

clear v_test.

write:/ v_test.

regards,

venkat.

aris_hidalgo
Contributor
0 Kudos

Hi,

As mentioned above, you can clear the variable before it is being displayed using WRITE statement. Otherwise, you cannot do anything once it is displayed.

Hope it helps...

P.S. Please award points if it helps...

vinod_vemuru2
Active Contributor
0 Kudos

Hi Siddarth,

While writing data to a list output u can over write the already written data only if your cursor is there in the same line. If the cursor is moved to the next line using the syntax WRITE:/ or

SKIP or NEW-LINE u can't return back the previous line.

Check below sample code for over writing the data which is already written to the list output.

DATA w_space(5) TYPE c VALUE IS INITIAL.

WRITE:/1 'Vinod'.

WRITE: 1 w_space.

O/P: Blank.

u can over write data by specifyings the position from where u want to over write also.

WRITE AT 3 w_space.

O/P: Vi

Thanks,

Vinod.