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

write statement.

Former Member
0 Likes
637

In write statement how we can reset the line no to 1, suppose we have written 10 write statement and again we have to write some text in line 1 , should I use skip statement ? but skip statement skips line further it is not coming to 1st line.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
615

Hi dude,

The system field sy-linno contains the current line number.

Try setting it to the intended line number(1 in ur case) and

include write statement to output the necessary info.

Reward if useful.

Regards,

Lakshmanan

6 REPLIES 6
Read only

Former Member
0 Likes
615

Hi

Can u explain the scenerio for which it is needed

generally write statment is written in this way

loop at internal table

write: internal-table-fields.

endloop.

Edited by: neetu chhabra on Feb 12, 2008 8:13 AM

Read only

Former Member
0 Likes
616

Hi dude,

The system field sy-linno contains the current line number.

Try setting it to the intended line number(1 in ur case) and

include write statement to output the necessary info.

Reward if useful.

Regards,

Lakshmanan

Read only

Former Member
0 Likes
615

Hi,

u can do that using reserve and skip statements

initially u need to reserve and then skip the statements.

REPORT NO STANDARD PAGE HEADING LINE-COUNT 10(2).

START-OF-SELECTION.

DO 5 TIMES.

RESERVE 4 LINES.

WRITE: / '1', / '2', / '3'.

SKIP TO LINE 1.

ENDDO.

END-OF-PAGE.

ULINE.

WRITE sy-pagno.

Plzz reward points if it helps.

Read only

Former Member
0 Likes
615

Hi,

Come back to ur program there at first write statement write whatever u want that will come in output...

I dont think coming back to program and adding something to write statement is a big task.

But for the same write statement without making modification how can v expect the output which v want..

Regards.

Read only

Former Member
0 Likes
615

Try this sample code:

data: w_col like syst-colno,

w_lin like syst-linno.

write:/ '1'.

w_col = sy-colno.

w_lin = sy-linno.

write:/ '2',

/ '3'.

skip.

sy-colno = w_col.

sy-linno = w_lin.

write: '4'.

Output will be:

1 4

2

3

Read only

Former Member
0 Likes
615

>

> In write statement how we can reset the line no to 1, suppose we have written 10 write statement and again we have to write some text in line 1 , should I use skip statement ? but skip statement skips line further it is not coming to 1st line.

Hi,

you can use skip statement in this situation.

because first you want to display first column and then you have to display a text message in the next colum.

if that is the case, follow the below code.

loop at itab.

write: itab-field1........itab-fieldn.

endloop.

skip to line 3.

means by default the first line contains the discription of program and second line is underline in that discription.

so our output will display from 3rd line onwards usually.

loop at jtab.

write : jtab-field1....jtab-fieldn.

endloop.

or

take two internal tables itab and jtab.

loop at jtab.

read table jtab with index i.

read table itab with index i.

write : itab-fields.

wtite : jtab-fiels.

endloop.

the second procedure gives you a better performance.

regards,

swaminath reddy.