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

Unicode in text edit CL_GUI_TEXTEDIT

Former Member
0 Likes
2,102

Hi guru,

I used the class CL_GUI_TEXTEDIT to input text, but I cannot type unicode.

I checked the sample program SAPTEXTEDIT_TEST_EVENTS. The upper text edit, I cannot type unicode, but the lower text edit, I can.

Could anyone explain me why this happens?

Thanks.

8 REPLIES 8
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,590

What do you mean by Unicode character (as all characters are part of unicode). Could you give one example, and tell us what you get when you type this "unicode character". I don't know what happens but the 2 controls are exactly the same, so that's really weird.

Read only

0 Likes
1,590

Thanks for your reply.

I knew the reason. If you use the language that has the accents (for ex: Vietnamese), when you type in textedit, it does not display correctly.

The reason stays in the parameter WORDWRAP_MODE of CONSTRUCTOR method (should use 0 or 1, but 2).

So I close this thread.

Edited by: Kebab Monsieur on Mar 23, 2010 11:33 AM

Read only

0 Likes
1,590

I couldn't find any information in SAP marketplace about a problem with WORDWRAP_MODE.

Check the SAP notes (for example Note 766995 - CNDP/text edit: Characters are truncated on Unicode systems)

and make sure to use the latest SAPGUI.

Read only

0 Likes
1,590

@Venkat:

Thanks. I read this thread before.

@Sandra:

You can test with the program SAPTEXTEDIT_TEST_EVENTS for the following phrase "nhà cung cấp" (it means the supplier).

You will see the upper textedit displaying the text incorrectly, but the lower textedit.

Thanks all for your replies.

Read only

0 Likes
1,590

Interesting. I've tested with report SAPTEXTEDIT_TEST_EVENTS as you suggested on an ECC 6.0 box and the text also got displayed incorrectly. To be more specific, in the upper text edit control the ấ character gets displayed as a rectangular box, whereas the lower text control shows all characters correctly. Interestingly enough, when I export the contents of the upper text control to a local file and use Notepad to look at it, all characters are displayed correctly.

Tried to search OSS, but couldn't really find anything useful. I came across OSS note [766995|https://service.sap.com/sap/support/notes/766995], which Sandra mentioned, but this is not applicable (only up to basis 6.40). The program coding didn't really show much differences.

Are you saying that you can fix it in your own coding if you change the wordwrap parameter as you described?

Also, I tried to pasted lots of Chinese text from the forums here into the text control. None of the characters got messed up, only the ấ (Unicode code point U+1EA5) showed this behavior (might be others, but I didn't ran into any other issues with my test samples).

I appreciate if you could keep us updated on this weird behavior.

Cheers, harald

Read only

0 Likes
1,590

Thx for the info. I also have the same weird behavior (as detailed by Harald) with SAPGUI 7.1 SP 13, and SAP Basis 7.0 SP 13, my computer has French_France locale.

gotcha! when you use wordwrap_at_fixed_position mode, the textedit control displays the characters in a fixed font by default (Courier New in my case, that does not contain Vietnamese characters). When you use one of the 2 other modes, it displays in a proportional font (Arial in my case, that does contain Vietnamese characters).

You may make it work if you change the SAPGUI option (alt-F12) Character Set to Vietnamese. I guess SAP automatically chooses a font that contains the Vietnamese characters (Tahoma in my case, I don't know why it doesn't choose Arial as it also contains Vietnamese characters, as it did in the case above).

sandra

Edited by: Sandra Rossi on Mar 24, 2010 2:22 PM

Read only

0 Likes
1,590

Hey Sandra,

Good observation (I completely missed the difference in the fonts) and good information on switching the character set. It's actually nice to see with program SAPTEXTEDIT_TEST_2, where one can toggle between fixed font and proportional font.

I must admit the handling of the special characters is still a bit of a mystery to me. E.g. I have the Unicode option enabled and in a simple test report where I used a WRITE statement to print special characters (chinese, etc.) SAP automatically switched to a font that could display the characters. Guess the problem is that the text edit control has to settle on one font and all non-proportional fonts are basically lacking the more "exotic" characters. Should probably do some reading on how SAPgui handles all this...

Thanks for the update.

Cheers, harald

Read only

Former Member
0 Likes
1,590

Refer to link below for the info:

Regards,

Venkat.