Character sequence within single quote " ' " is character literal while within " ` " is a string literal.
you will notice the difference when trailing space exists.
Char literal ignores the trailing space but string literal preserves it.
Simple test:
DATA v_char TYPE c LENGTH 32.
* v_char will become "text sample".
v_char = 'sample'.
CONCATENATE 'text ' v_char INTO v_char SEPARATED BY space.
WRITE: / v_char.
* v_char will become "text sample".
v_char = 'sample'.
CONCATENATE `text ` v_char INTO v_char SEPARATED BY space.
WRITE: / v_char.
* v_char will become "text sample".
v_char = 'sample'.
CONCATENATE 'text ' v_char INTO v_char SEPARATED BY space.
WRITE: / v_char.
* v_char will become "text sample".
v_char = 'sample'.
CONCATENATE `text ` v_char INTO v_char SEPARATED BY space.
WRITE: / v_char.
No comments:
Post a Comment