2015 Aug 12 9:28 AM
Hi,
using string templates for the first time. Every example i found, seems very simple, like
DATA(string) = |Hello World!|.
But i always get a syntax error:
Field "|HELLO" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement.
So what am i missing? System is running SAP NW 7.4.
best regards
Folker
2015 Aug 12 11:52 AM
Hey all,
the answer is: string templates only work in Unicode-programs. I am working on a non-Unicode System and Unicode checking was disabled in the program.
thanks for your help
Folker
Hi, Folker.
I'm on 7.40 sp08, all works fine. Try to use backquotes for test.
data(string) = `some text`.
2015 Aug 12 9:36 AM
Hello,
You didn't defined the variable which will be type string. Try this:
DATA variable TYPE string.
variable = 'Hello World!'.
2015 Aug 12 9:45 AM
Hi Folker ,
You can define a variable without using type.
Like; data string.
But this will be 1 character variable.
So you can write like this ;
data string value 'Hello World!'.
but string actually contains only 'H'.
You should write like this ;
data lv_string type string value 'Hello World!'.
2015 Aug 12 9:50 AM
Hi, Folker.
I'm on 7.40 sp08, all works fine. Try to use backquotes for test.
data(string) = `some text`.
2015 Aug 12 10:28 AM
Hi Evgeniy,
i tried this:
DATA string1 TYPE string.
DATA string2 TYPE string.
string1 = |Hello World!|.
string2 = `Hello World!`.
DATA(string3) = `Hello World!`.
string2 and string3 are working fine, string1 results in the same syntax error like described above. It just looks like pipes are not recognized as keywords.
2015 Aug 12 10:36 AM
Hello,
Strange, the following code is working for me :
DATA string1 TYPE string.
string1 = '|Hello world|'.
I am on NW 7.4 EHP7.
br,
Christophe
2015 Aug 12 10:51 AM
Hi Christophe,
for me too, but only because it has ' ' around the pipes.
string1 = '|Hello world|'.
Have you tried it without quotes?
string1 = |Hello world|.
btw what's the best way to determine your platform (NW, AS ABAP)?
br
Folker
2015 Aug 12 10:53 AM
Hello Folker,
Yes I tried w/o quotes and it's working also.
To determine your plateform go to sytem>status>Product version and you click on the button to see the details.
Tks.
Br,
christophe
2015 Aug 12 11:45 AM
I found that string pipes were implemented in 7.3 so it should work on any 7.40. Maybe you have old/broken sapgui?..
Try to run DEMO_STRING_TEMPLATE_ALIGN_PAD. Will it work for you?
2015 Aug 12 11:52 AM
Hey all,
the answer is: string templates only work in Unicode-programs. I am working on a non-Unicode System and Unicode checking was disabled in the program.
thanks for your help
Folker
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |