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 question.

Former Member
0 Likes
782

Hi all,

Why does the system not give error when we write the program:

REPORT prog1.

WRITE "Hello World".

Should it now say " Use single quotes in place of double" or something like that?

Charles.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
752

Hi Charles......

in ypur code u have written

REPORT prog1.

WRITE <b>"</b>Hello World".

so when ever the system encounters a double quote (") it treats the successive code as comment ,so your code is only

REPORT prog1.

WRITE

(Hello World". is treated as comment)

because the contents following the " character is interpreted as comment.

but every ABAP statement should end with a period.

so the system throws an error that the last statement is incomplete(Period missing).

if u write

WRITE 'Charles......'. "Hello World".

then <b>charles......</b> will be displayed and "Hello World". will be treated as comment.

Suresh......

7 REPLIES 7
Read only

Former Member
0 Likes
752

Hi,

write it like this.

REPORT prog1.

WRITE:/ 'Hello World'.

Thanks

Pranati

Reward points if helpful

Read only

Former Member
0 Likes
752

Hi

For me it is giving message

Last statement is not complete.(period missing.)

Thanks

Pranati

Read only

Former Member
0 Likes
752

hi,

try it again,it will display error.

sri

Read only

Former Member
0 Likes
752

hi

the code that u have written gives an error even if u use 2 single quotes i.e.,

write: ''abc.''

it still gives an error complie the code again u will definitely get an error.

regards,

kiran kumar k

Read only

Former Member
0 Likes
752

I guess there is nothing wrong it, have u checked the output?

did it give <b>'Hello World'</b> in single quotes...

It can treat the first and last Quotes("Hello World") as Syntax and the inner quotes as the output.. not sure ..guessing

Read only

Former Member
0 Likes
753

Hi Charles......

in ypur code u have written

REPORT prog1.

WRITE <b>"</b>Hello World".

so when ever the system encounters a double quote (") it treats the successive code as comment ,so your code is only

REPORT prog1.

WRITE

(Hello World". is treated as comment)

because the contents following the " character is interpreted as comment.

but every ABAP statement should end with a period.

so the system throws an error that the last statement is incomplete(Period missing).

if u write

WRITE 'Charles......'. "Hello World".

then <b>charles......</b> will be displayed and "Hello World". will be treated as comment.

Suresh......

Read only

Former Member
0 Likes
752

i am not sure what is your query ??

if you want to write hello world with quotes then


write : / '''Hello world'''.

other wise as per your coding it will give an error.

regards

shiba dutta