05-13-2010 9:57 AM
Hi,
Why does write statement behave as below when we write 4 single quotes together.
write '''' .
Outputs ' (Single Quote)
05-13-2010 10:12 AM
>
> write '''' .
>
> Outputs ' (Single Quote)
This is a FAQ.
SAP interprets an apostrophe as a special character. So to print it you have to use an escape character i.e., before every apostrophe to be displayed you have to add an escape character before it.
Ironically escape character for an apostrophe is an apostrophe itself !!! So for 4 quotes you have specified SAP interprets it as a single apostrophe with an escape character in the beginning.
Alternatively you can use back quotes `'`. This looks good
05-13-2010 10:03 AM
HI,
According to ABAP syntax two single quotes ('') interpret as one single qoute in write
statement. So if you write four single qoutes ('''') the middle two single qoutes treated as
literal. so thats why it prints one single qoute.
Example
write:/ 'AA'.
will output AA
Same way Write:/ ''''.
Will result in single qoute.
Regards and Best wishes.
05-13-2010 10:12 AM
>
> write '''' .
>
> Outputs ' (Single Quote)
This is a FAQ.
SAP interprets an apostrophe as a special character. So to print it you have to use an escape character i.e., before every apostrophe to be displayed you have to add an escape character before it.
Ironically escape character for an apostrophe is an apostrophe itself !!! So for 4 quotes you have specified SAP interprets it as a single apostrophe with an escape character in the beginning.
Alternatively you can use back quotes `'`. This looks good
01-06-2015 1:13 PM