Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

help-mandt declaration?

Former Member
0 Likes
1,078

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)

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
903

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

5 REPLIES 5
Read only

Former Member
0 Likes
904

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

Read only

Former Member
0 Likes
903

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

Read only

Former Member
0 Likes
903

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.

Read only

former_member217544
Active Contributor
0 Likes
903

Hi Pravin,

'-' is used to represent table or structure fields but not for declaring variables. Use '_' instead of hyphen.

Regards,

Swarna Munukoti

Read only

Former Member
0 Likes
903

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.