‎2008 Sep 30 5:54 AM
HI All,
I decalred constant like this.
constants: help-mandt(3) VALUE '000',
But it is giving error as below.
In Unicode programs, the "-" character cannot appear in names, as it does here in the name "HELP-MANDT".
How shall i declare it in ECC 6.0 (Unicode)
‎2008 Sep 30 5:58 AM
hi.
declare it as:
constants: help_mandt(3) VALUE '000',
u cannot use '-' . u can only use '_'.
regards,
Padma.
Edited by: Padmashree RamMaghenthar on Sep 30, 2008 10:29 AM
‎2008 Sep 30 5:58 AM
hi.
declare it as:
constants: help_mandt(3) VALUE '000',
u cannot use '-' . u can only use '_'.
regards,
Padma.
Edited by: Padmashree RamMaghenthar on Sep 30, 2008 10:29 AM
‎2008 Sep 30 6:02 AM
Hi,
I was trying the way you have given and it is giving a warning and not an error. Just check out once again . It is just giving a warning in ECC 6.0.
Regards,
Srinivas
‎2008 Sep 30 6:02 AM
hi,
Go through the ABAP documentaion, Data statement declaration rules.
You can't use special characters in declaration of variables.
so you have to declare like this only.
Data help_mandt(3) value '000'.
Regards,
Shankar.
‎2008 Sep 30 6:04 AM
Hi Pravin,
'-' is used to represent table or structure fields but not for declaring variables. Use '_' instead of hyphen.
Regards,
Swarna Munukoti
‎2008 Sep 30 6:17 AM
hi..pravin..
even iam using ecc.6.0.
here iam not getting any warning.
pls paste ur code here to check.
As above said, pls read the rules before declaring any varb in ABAP.
regards,
Padma,
for reference:
Local Data Types in Programs
All ABAP programs can define their own data types. Within a program, procedures [Page 449]
can also define local types.
You define local data types in a program using the
TYPES <t> ... [TYPE <type>|LIKE <obj>] ...
statement. The type name <t> may be up to 30 characters long. You can use any letters, digits,
and the underscore character. Do not create a name consisting entirely of numeric characters.
You cannot use the special characters + . , : ( ) - < >. Other special characters are reserved for
internal use. You cannot use the names of the predefined ABAP types (C, D, F, I, N, P, T, X,
STRING, XSTRING) or the name of the generic type TABLE. You should not use names that are
the same as an ABAP keyword or addition. You should:
Use names that explain the meaning of the type without the need for further comments
Use the underscore character to separate compound words
Always use a letter as the first character of a variable name.
You declare local data types in a program either by referring to an existing data type or
constructing a new type.
An existing type can be
A predefined ABAP type to which you refer using the TYPE addition
An existing local type in the program to which you refer using the TYPE addition
The data type of a local object in the program to which you refer using the LIKE addition
A data type in the ABAP Dictionary to which you refer using the TYPE addition. To ensure
compatibility with earlier releases, it is still possible to use the LIKE addition to refer to
database tables and flat structures in the ABAP Dictionary. However, you should use the
TYPE addition in new programs.
Known types must be visible [Page 112] at the point where you define the new type. If the
existing type is generic, you can use further additions to set the attributes of type <t> that are still
undefined.