11-16-2007 2:20 PM
Hi All,
I have defined strings as
data: string1 type string,
string2 type string.
But we should not define like this we have to define as
data: string1,string2 type string.
If I define like this system is show as
string1 type c and length is 1
string2 type string.
How to define multiple strings like this
data: string1,string2 type string.
11-16-2007 2:23 PM
data: string1 type string,
string2 type string.
The above syntax is right.
IF you define like this,
data: string1,string2 type string.
System will always asisgn by defualt CHAR 1 to the variabes which don't have any type aasociated.
So, whenever you want to have same strcutre you need to defined explicitly for each and every variables. That's why the first syntax is correct.
Regards,
Naimesh Patel
11-16-2007 2:33 PM
Hi there,
You're trying to tell system to define string1 but no type is given, therefore
system will assing to it the defaut type which in ABAP is char 1.
Regards,
Marcin
11-16-2007 2:30 PM
Hi,
Consider this example
data : string1.
string1 = 'A'.
write string1.
if a variable is defined like this it is implicit that string1 is of type char and of length 1.
example2(as yours)
data : string1,string2 type string.
the above statement is equal to
data string1.
data string2 type srring1.
so the system understands that 1st variable which is string1 is of type char and length 1.
regards,
kannan
11-16-2007 2:35 PM
Hi Gowri,
It is not possible in ABAP. You have to define each variable inividually like
data: v1 type string,
v2 type string.
Regards,
Atish