Difference between “‘” and “`” in ABAP

A basic difference: still I find that most of the programmer hardly uses string literal. String literal is generally a forgotten case.

A character sequence within single quote characters (‘) is a char literal, while within (`) is a string literal. That is especially important for trailing spaces: a string literal preserves the trailing space while a char literal ignores them.

This can be best understood by the following example:

DATA v_char TYPE c LENGTH 32.
v_char = 'This is a'.
CONCATENATE v_char 'text   ' INTO v_char SEPARATED BY space.
*" v_char would be "This is a text"
CONCATENATE v_char `text   ` INTO v_char SEPARATED BY space.
*" v_char would be "This is a text   "
  • Share/Bookmark

Related posts:

  1. ABAP Program Showing a progress bar in SAP
  2. ABAP Program to add Colors in ALV Grid
  3. Pretty Report Vs Pretty Printer in ABAP
  4. Difference Between BAPI and RFC
  5. Displaying Icons in ALV Grid using ABAP

No Responses to “Difference between “‘” and “`” in ABAP”

Post a Comment