Unicode System - Outside Communication for ABAP Programmers
Unicode System - Outside Communication for ABAP Programmers
Outside Communication
for ABAP Programmers
Introduction
About Code Pages
Communication: The Ideal Picture
Communication: The Reality
Part I – RFC
Unicode Unicode
Unicode single code page system
Unicode MDMP system
Exercises
2003 SAP AG, Unicode Outside Communication, Christian Hansen 2
About Code Pages: Conventional Code Pages
IS0-5IS0-9
IS0-9 Mircosoft
EBCDIC 1250
697/ 1251
IS0-3
697/ 0277 IS0-7 IS0-2
IS0-3
0500
IS0-7 IS0-2 1256
1257 1252 12
ASCII1252 12
1250
1251
IS0-3
IS0-2
IS0-9
BIG-5
BIG-5 1252 1254
IS0-5
IS0-5 IS0-9
IS0-8 SJIS
IS0-8 SJIS
IS0-4
IS0-3
IS0-4
IS0-3
IS0-2
IS0-7
IS0-7 IS0-6IS0-2
IS0-1
IS0-1IS0-6 SAP:
Languages: 41
Characters: 22,378
2003 SAP AG, Unicode Outside Communication, Christian Hansen 3 Code Pages: 390
Solution: Unicode, one Code Page for all Scripts
Japanese Chinese
Hebrew
Korean
Greek
And more
Taiwanese languages
can be
Russian English supported
Ukrainian easily
without the
Thai need for
Danish
Dutch, German Croatian new code
pages or
ndic
Finnish Czech
French, Italian Hungarian other new
Icela
CJK Ideographs
65,000 characters
Hangul
Compatibility
Additional
Surrogate Area
1,000,000 characters
U+3479 34 79 79 34 E3 91 B9
R/3 Enterprise
Internet Files
IS0-1 IS0-8
1251
...charset=iso-8859-1" >
IS0-9 SJIS
...charset=windows-1257" > BIG-5697/
...charset=Shift_JIS" > 697/
0500
IS0-3
...charset=utf-8" > 0277
IS0-2
IS0-7
1252
Introduction
About Code Pages
The Ideal Picture
Reality
Part I – RFC
Unicode Unicode
Unicode single code page system
Unicode MDMP system
Exercises
2003 SAP AG, Unicode Outside Communication, Christian Hansen 9
RFC Unicode Unicode
• 1 Byte = non-Unicode
• 2 Byte = Unicode
Ä Ä
ß ß
あ #
東 #
한 #
พ #
2003 SAP AG, Unicode Outside Communication, Christian Hansen 11
RFC Unicode non-Unicode MDMP
Ä DE Ä
ß DE ß
あ JA あ
東 JA 東
한 JA #
พ JA #
Flat: C, N, D, T, X, I, F, P and
any structure consisting only of these fields
Deep data types are transferred using an UTF-8 encoded XML format (XRFC).
This enables sending and and receiving tables from MDMP systems
(different code pages for each row):
Introduction
About Code Pages
The Ideal Picture
Reality
Part I – RFC
Unicode Unicode
Unicode single code page system
Unicode MDMP system
Exercises
2003 SAP AG, Unicode Outside Communication, Christian Hansen 19
File transfer: Application server
<modus>:
BINARY MODE
Uninterpreted sequence of bytes.
BINARY MODE
8000
SY-LANGU
SY-LANGU
SY-LANGU 8000
8000
SY-LANGU
Structure information
(no layout / alignment
problems)
UTF-8 based (no data
loss)
Transport in binary
form
SY-LANGU
SY-LANGU
Front end code page matching to the current system code page
(SY-LANGU, SET LOCALE LANGUAGE)
Declared explicitly with optional parameter CODEPAGE
(Starting with release 6.20 SP 21).
Introduction
About Code Pages
The Ideal Picture
Reality
Part I – RFC
Unicode Unicode
Unicode single code page system
Unicode MDMP system
Exercises
2003 SAP AG, Unicode Outside Communication, Christian Hansen 31
Common mistakes: overview
☠ Type hiding
☠ ...
초 록 색 0 0 F F 0 0
Unicode struc_to_cont cont_to_struc
system
초 록 색 0 0 F F 0 0
Data
RFC container
초 록 색 0 0 F F 0 0
Non-Unicode cont_to_struc struc_to_cont
system
초 록 색 0 0 F F 0 0
2003 SAP AG, Unicode Outside Communication, Christian Hansen 35
Common mistakes: Missing language key
Example: ☠ Sending non Latin 1 data without language key by RFC with German logon
Breaking a string into a table of fixed line size and sending the table from a
non-Unicode to a Unicode-system does not work, since the information
about the occupied length is lost and subsequent reassembling into a string
will insert unwanted spaces (☠).
In general you must not send data from a source system into a target
system, if the characters send are not in the target systems code page.
Especially don‘t send one of the characters that are only in the Unicode
code page to an old-fashioned non-Unicode system:
Try to send a white smiling face (☺) or a black smiling face (☻) or
some beamed eigth notes (♫) ! ( # ☠)
Introduction
About Code Pages
The Ideal Picture
Reality
Part I – RFC
Unicode Unicode
Unicode single code page system
Unicode MDMP system
Exercises
2003 SAP AG, Unicode Outside Communication, Christian Hansen 40
Exercises
Send single code page and MDMP data via RFC
Type hiding and missing language keys:
TECHED_UNICODE_EXERCISE_11/12/13/14 and15
Wrong length assumptions:
TECHED_UNICODE_EXERCISE_16/18
Data not in the receivers code page:
TECHED_UNICODE_EXERCISE_17
Further Presentations
http://service.sap.com/Unicode@SAP Unicode Technology
Media Library:
‘Unicode Enabling ABAP Programs’ or
‘ABAP Conversion – SAP Tutor’
Unicode Support in SAP Web Application Server
Q&A
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express
permission of SAP AG. The information contained herein may be changed without prior notice.
Some software products marketed by SAP AG and its distributors contain proprietary software components of other
software vendors.
Microsoft®, WINDOWS®, NT®, EXCEL®, Word®, PowerPoint® and SQL Server® are registered trademarks of
Microsoft Corporation.
IBM®, DB2®, DB2 Universal Database, OS/2®, Parallel Sysplex®, MVS/ESA, AIX®, S/390®, AS/400®, OS/390®,
OS/400®, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere®, Netfinity®, Tivoli®,
Informix and Informix® Dynamic ServerTM are trademarks of IBM Corporation in USA and/or other countries.
ORACLE® is a registered trademark of ORACLE Corporation.
UNIX®, X/Open®, OSF/1®, and Motif® are registered trademarks of the Open Group.
Citrix®, the Citrix logo, ICA®, Program Neighborhood®, MetaFrame®, WinFrame®, VideoFrame®, MultiWin® and
other Citrix product names referenced herein are trademarks of Citrix Systems, Inc.
HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C®, World Wide Web Consortium,
Massachusetts Institute of Technology.
JAVA® is a registered trademark of Sun Microsystems, Inc.
JAVASCRIPT® is a registered trademark of Sun Microsystems, Inc., used under license for technology invented
and implemented by Netscape.
MarketSet and Enterprise Buyer are jointly owned trademarks of SAP AG and Commerce One.
SAP, SAP Logo, R/2, R/3, mySAP, mySAP.com and other SAP products and services mentioned herein as well as
their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other
countries all over the world. All other product and service names mentioned are trademarks of their respective
companies.