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

ABAP

Former Member
0 Likes
716

Hi

Why we need to put two quotes ' ' to get a single displayed quote.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
682

Hi Jeyashree,

Generally single quote is used to mark start and end of literal. If you want to display single quote in a string then it is considered as end of the literal and gives you error too. To avoid this ambiguity, we convey the system as double quotes followed by a single a quote is a single quote in a literal.

Thanks,

Vinay

6 REPLIES 6
Read only

Former Member
0 Likes
682

hi

whatever u give in double quotes, it ll come as like as it is. that is considered as a string.

regards

karthik

Read only

Former Member
0 Likes
682

OTHERWISE ABAP WILL TREAT THAT STRING IS END WITH THAT....

FOR EXAMPLE....

'JEYA'SHREE'.

IN THE ABOVE STRING...ABAP TREAT THAT STRING ALREADY ENDED WITH 'JEYA'....

TO AVOID THIS....'JEYA''SHREE'.

Read only

0 Likes
682

Try to execute

write : ''''.

we will get a single quote as an output.

Read only

Former Member
0 Likes
682

string funcation used for quotes.

string literal,char num. all give quotes ' '

write 'hello' .-> hard code.

Read only

Former Member
0 Likes
682

HI

IN ABAP LANGUAGE '' SINGLE QUOTE MEANS IT WILL DISPLAY A STRING SAME AS IN C WE USE " "

IF YOU WRITE ' ' THEN ABAP TREATS THAT TOTAL CHARACTERS INTO THE STRING FORMAT

IF YOU DON'T GIVE 2 AND IF YOU GIVE OBNLY ONE QUOTE THEN ABAP TREATS IT AS AN ERROR MESSAGE

Read only

Former Member
0 Likes
683

Hi Jeyashree,

Generally single quote is used to mark start and end of literal. If you want to display single quote in a string then it is considered as end of the literal and gives you error too. To avoid this ambiguity, we convey the system as double quotes followed by a single a quote is a single quote in a literal.

Thanks,

Vinay