Do you have any question about this error?
Message type: E = Error
Message class: E2 - DE Data Dictionary
Message number: 191
Message text: Constant must be enclosed in apostrophes
You did not enclose the constant in apostrophes.
The system issues an error message and will not allow you to continue with this transaction until the error is resolved.
Enclose the constant in apostrophes. q
Example: 'Constant'
Error message extract from SAP system. Copyright SAP SE.
E2191
- Constant must be enclosed in apostrophes ?The SAP error message E2191, which states "Constant must be enclosed in apostrophes," typically occurs in ABAP programming when a constant string is not properly enclosed in single quotes. In ABAP, string literals must be enclosed in apostrophes (single quotes) to be recognized as valid string constants.
Cause:
The error is caused by one of the following scenarios:
- A string constant is missing the enclosing apostrophes.
- The string constant is incorrectly formatted, such as using double quotes instead of single quotes.
- There may be a syntax error in the code where a constant is expected but not provided correctly.
Solution:
To resolve this error, you should:
- Check the line of code where the error occurs.
- Ensure that all string constants are enclosed in single quotes. For example:
- Incorrect:
DATA(my_string) = Hello World.
- Correct:
DATA(my_string) = 'Hello World'.
- If you are using concatenation or other operations involving strings, ensure that all parts are properly quoted.
Example:
Here’s an example of how to correct the error:
Incorrect Code:
DATA(my_string) = Hello World. " This will cause E2191
Correct Code:
DATA(my_string) = 'Hello World'. " This is correct
Related Information:
By ensuring that all string constants are properly enclosed in apostrophes, you can avoid the E2191 error and ensure your ABAP code runs smoothly.
Get instant SAP help. Start your 7-day free trial now.
E2190
Foreign key does not exist in include and will be deleted
What causes this issue? You created a foreign key for a field in an include, but set the 'Inherited from include' flag. The system tries to...
E2189
Foreign key &-& was deleted
What causes this issue? The definition of the specified foreign key was deleted.System Response Information messageHow to fix this error? No action...
E2192
Field assignment for foreign key &-& ambiguous (check proposal)
What causes this issue? The structure of the foreign key definition is ambiguous. When creating the foreign key, all the key fields of the check tabl...
E2193
No further foreign key exists
What causes this issue? You pressed pushbutton <LS>Next foreign key</> to branch to maintenance of another foreign key. However, the tabl...
Click on this link to search all SAP messages.