07-03-2007 12:56 PM
Is it possible (using the WRITE statement) to write on the 1st line, then the 2nd line, then the 3rd line and then go back to the 1st line again?
I have got a report which I need to look like the following (¦ being the symbol for the column splits):
1100 ¦ 1200
_____¦______
5 ¦ 6
10 ¦ 54
I would like to write the 1100 columns first and then the 1200 column, but I am unsure if I can go back to the 1st line once I have written on more lines.
i.e.
WRITE (line1)(1) '1100'
WRITE (line2)(1) '----'
WRITE (line3)(1) '5'
WRITE (line4)(1) '10'
WRITE (line1)(6) '1200'
WRITE (line2)(6) '----'
WRITE (line3)(6) '5'
WRITE (line4)(6) '10'
Kind Regards
Carly
07-03-2007 1:02 PM
07-03-2007 1:04 PM
Hi
You can write the data using WRITE statement, any number of lines, any no of columns
after writing 1100, 1200 columns
going to first line, no problem scroll up the page and go..
But what's this requirement? really real scenario..
Reward points for useful Answers
Regards
Anji
07-03-2007 1:04 PM
write:
/10 '1100', sy-vline, 20 '1200'.
write sy-uline.
write:
/10 '5',sy-vline, 20 '6',
write:
/10 '10',sy-vline, 20 '54'.
regards,
Pavan P.
07-03-2007 1:07 PM
Is it possible (using the WRITE statement) to write
on the 1st line, then the 2nd line, then the 3rd line
and then go back to the 1st line again?
I have got a report which I need to look like the
following (¦ being the symbol for the column splits):
1100 ¦ 1200
_____¦______
5 ¦ 6
¦ 54
I would like to write the 1100 columns first and then
the 1200 column, but I am unsure if I can go back to
the 1st line once I have written on more lines.
i.e.
WRITE (line1)(1) '1100'
WRITE (line2)(1) '----'
WRITE (line3)(1) '5'
WRITE (line4)(1) '10'
WRITE (line1)(6) '1200'
WRITE (line2)(6) '----'
WRITE (line3)(6) '5'
WRITE (line4)(6) '10'
Kind Regards
Carly
This is case I will suggest you to prepare a internal table with all the calculation first and then print the records sequentially. This way you won't need to go back and print the values...
If at all it is needed then of course you can use statement
MODIFY LINE n OF CURRENT PAGE
See help on this statement...
07-03-2007 1:08 PM
Hi Carly,
Try this sample code,
It will help you.
data : temp(5) value 'viji'.
write : 10(4) temp.
uline.
write : 25(4) temp.
uline.
write : 50(4) temp.
uline.
write : 75(4) temp.
uline.
Thanks,
Reward If Helpful.
07-03-2007 1:19 PM
Hi Bond,
You can achieve this using BACK and RESERVE statements.
Check this sample code.
DATA: TOWN(10) VALUE 'New York',
CUSTOMER1(10) VALUE 'Charly',
CUSTOMER2(10) VALUE 'Sam',
SALES1 TYPE I VALUE 1100,
SALES2 TYPE I VALUE 2200.
RESERVE 2 LINES.
WRITE: TOWN, CUSTOMER1,
/ CUSTOMER2 UNDER CUSTOMER1.
BACK.
WRITE: 50 SALES1,
/ SALES2 UNDER SALES1.
Thanks,
Vinay
07-03-2007 1:21 PM
You can move the cursor back, check sap help for abap statement 'BACK'
This statement takes the cursor back to first line in current page.
DATA: title TYPE c LENGTH 3,
sname TYPE c LENGTH 20,
fname TYPE c LENGTH 20.
SKIP 5.
RESERVE 3 LINES.
WRITE: / 'Title',
/ 'Second name',
/ 'First name'.
BACK.
WRITE: /14 title INPUT,
/14 sname INPUT,
/14 fname INPUT.
Also you can use statement 'Skip to line n' where n is a number like 1,2,3........
Cheers
07-03-2007 2:34 PM
You can follow the following code.I think it will help you :-
write:
/10 '1100', sy-vline, 20 '1200'.
write sy-uline.
write:
/10 '5',sy-vline, 20 '6',
write:
/10 '10',sy-vline, 20 '54'.
Regards :-
Srikanta Gope
07-03-2007 3:22 PM
HI
Use UNDER Statement with WRITE.
WRITE (line1)(1) '1100' UNDER '----' UNDER (1) '5' UNDER '10'.
Reward me if its helpful.
Regards
Ravi