Application Development and Automation 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: 
Read only

overwriting the same line

Former Member
0 Likes
1,467

experts,

need a solution for the example below.

ex : loop at t_vbap into w_vbap.

write 😕 w_vbap,

endloop.

loop at t_vbap into w_ vbap.

write 😕 w_vbap.

endloop.

if table t_vbap contains 5 records, first loop displays 5 records followed by 5 records by the second loop.

my query is can you overwrite the first 5 records of the list by the second loop records,

other than using back or modify line statements.

with regards.

experts,

need a solution for the example below.

ex : loop at t_vbap into w_vbap.

write 😕 w_vbap,

endloop.

loop at t_vbap into w_ vbap.

write 😕 w_vbap.

endloop.

if table t_vbap contains 5 records, first loop displays 5 records followed by 5 records by the second loop.

my query is can you overwrite the first 5 records of the list by the second loop records,

other than using back or modify line statements.

with regards.

6 REPLIES 6
Read only

Former Member
0 Likes
1,179

i think u cant do like that...

Regards

Anbu

Read only

Former Member
0 Likes
1,179

Hi Ramesh,

You can achieve this using 'POSITION' in write statement. Check for the syntax.

But for this you need to store the position in which the previous record has been displayed and now write the second loop records at the same position.

Hope this helps you.

Any queries, get back to me.

Regards,

Chandra Sekhar

Edited by: Chandrasekhar Gandla on Jun 27, 2008 7:54 AM

Read only

Former Member
0 Likes
1,179

hi,

You can achieve this by using

SKIP to <line No>

You can set the line No you want to over write and perform the loop statement.

reward if useful.

Sumit Agarwal

Read only

Former Member
0 Likes
1,179

Hi,

We normally achive the same with MODIFY LINE by the given example below.

MODIFY LINE 1 FIELD VALUE w_num1 FROM w_num1

w_num2 FROM w_num2

w_result1 FROM w_result1.

Otherwise we can use the

SKIP to Line...

and then

Loop at t_vbap...endloop.

Warm Regards

R Adarsh

Read only

Former Member
0 Likes
1,179

Hi Ramesh,

From your example:

ex : loop at t_vbap into w_vbap.

write 😕 w_vbap,

endloop.

SKIP TO LINE 1. --> Add This

loop at t_vbap into w_ vbap.

write 😕 w_vbap.

endloop.

Thanks,

Victor.

Read only

Former Member
0 Likes
1,179

Hi,

Try this

loop at t_vbap into w_vbap.
   write :/ w_vbap,
 endloop.

WRITE:
/ 'Double click on this line to change list.'.

at line-selection.

sy-lsind = 0.

loop at t_vbap into w_ vbap.
write :/ w_vbap.
endloop.

This will defenitely work and make the code interactive and also you will be in basic list.

Rewad if found helpful.

Anirban Bhattacharjee