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
4,376

Hi

What is the difference between

Write /'Hello'.

and

Write : / , 'hello'.

Why is the second statement leaving a line gap.

/ is used to leave a line gap.

I am confused because

write : 'hello'.

prints on the same line. But having a slash in front leaves a line gap instead of going to next line.

Thanks in advance,

Bala

1 ACCEPTED SOLUTION
Read only

Former Member
3,746

Hi

write: / means SKIP 1 line. that means after leaving one line the data will be printed....

so


Write : / , 'hello'. is equivalent to...
write: /.
write: 'hello'.

but Write /'Hello'. means only "go to new line and print the data...

Arunima

3 REPLIES 3
Read only

Former Member
0 Likes
3,746

Hi,

In ABAP '/' represent breaking a line and write the entries in the next line.

/ break the line or terminates the current processing line and starts with the next line.

see for example

Tables: makt.

Data itab like makt occurs 0 with header line.

select * from makt into table itab.

append itab.

loop at itab.

Translate itab to LOWER CASE.

write:/ itab-MAKTX.

endloop. Here all the entries will be line by line

Tables: makt.

Data itab like makt occurs 0 with header line.

select * from makt into table itab.

append itab.

loop at itab.

Translate itab to LOWER CASE.

write itab-MAKTX. "Here records will be continuous

endloop.

Cheers!!

VEnk@

Edited by: Venkat Reddy on Oct 29, 2008 12:51 PM

Read only

Former Member
0 Likes
3,746

+Missing first item+

if you are not specify the position for first item it will take the whole line length and from the next line it will print all other itmes.

Example --> 1.

write 😕 ,

'hello',

'ABAP'.

Example --> 2.

write : / ,

10 'hello',

30 'ABAP'.

If you specify the position for the first item it will start with first line and specified position

Example --> 1.

write : /2 'first' ,

'hello'.

Example --> 2.

write : /2 'first' ,

10 'hello'.

I think it will help.

Regards,

Florian

Read only

Former Member
3,747

Hi

write: / means SKIP 1 line. that means after leaving one line the data will be printed....

so


Write : / , 'hello'. is equivalent to...
write: /.
write: 'hello'.

but Write /'Hello'. means only "go to new line and print the data...

Arunima