UNICODE PRGG

59
8/10/2019 UNICODE PRGG http://slidepdf.com/reader/full/unicode-prgg 1/59 LCM262 Making Programs Unicode Enabled

Transcript of UNICODE PRGG

Page 1: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 1/59

LCM262

Making Programs

Unicode Enabled

Page 2: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 2/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 2

Contributing Speaker(s)

Markus EbleNW Foundation Internationalization, SAP AG

Martin SchmidtNW Foundation Internationalization, SAP AG

Page 3: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 3/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 3

Learning Objectives

As a result of this workshop, you will be able to:

Do the Unicode enabling for your own ABAP programs

Understand how to adapt your fi le and RFC interfaces

Page 4: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 4/59

Overview

 ABAP Language Enhancements

File Interfaces

Communication via RFC

Unicode enabling tools

Page 5: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 5/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 5

English

German

Turkish

DanishDutch,Finnish

French, ItalianNorwegianPortugueseSpanish

Swedish

CroatianCzechHungarianPolish

RumanianSlovakian

Slovene

RussianUkrainian

Greek

Hebrew

Thai

Korean

JapaneseChinese

Taiwanese

      I    c    e      l    a

    n     d      i    c

 And morelanguages

can besupportedeasilywithout theneed for new code

pages or 

other newmethods

Unicode, one Code Page for all Scripts

Page 6: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 6/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 6

 ASCII

General Scripts

Symbols

CJK Ideographs

Hangul

Compatibility

Surrogate Area

65,000 characters

 Addi tional

1,000,000 characters(e.g. Hong Kong Chinese)

Unicode characters

Page 7: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 7/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 7

Representation of Unicode Characters

UTF-16 – Unicode Transformation Format, 16 bit encoding Fixed length, 1 character = 2 bytes (surrogate pairs = 2 + 2 bytes)

Platform dependent byte order 

UTF-8 – Unicode Transformation Format, 8 bit encoding Variable length, 1 character = 1...4 bytes

Platform independent

7 bit US ASCII compatible

E3 91 B979 3434 79U+3479

CE B1B1 0303 B1U+03B1

C3 A4E4 0000 E4U+00E4ä

6161 0000 61U+0061a

UTF-8UTF-16litt le endian

UTF-16big endian

Unicodescalar value

Character 

F0A081BB00DA7BDCDA00 DC7BU+2007B

Page 8: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 8/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 8

Representation of Unicode characters in ABAP

Keep existing coding as far as possible

Use existing character type for Unicode data

Use UTF-16 to keep buffer sizes

Page 9: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 9/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 9

Transparent Unicode Enabling of R/3

Character Expansion Model

Separate Unicode and non-Unicode versions of R/3

No explicit Unicode data type in ABAP

Single ABAP source for Unicode and non-Unicode systems

1 character = 2 bytes (UTF16),

(types C, N, D, T, STRING)

Unicode kernel

Unicode database

1 character = 1 byte(types C, N, D, T, STRING)

Non-Unicode kernel

Non-Unicode database

 ABAPsource

Non-Unicode

R/3

UnicodeR/3

 ABAPsource ABAPsource

Page 10: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 10/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 10

ABAP Unicode Enabling – Golden Rule

Distinguish character and byte based data

1 Character   1 Byte

Page 11: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 11/59

Overview

 ABAP Language Enhancements

File Interfaces

Communication via RFC

Unicode enabling tools

Page 12: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 12/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 12

Program Attribute „Unicode checks active“

Page 13: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 13/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 13

Unicode-Enabled ABAP Programs

Program attribute „ Unicode checks active“

Required to run on a Unicode system

If attribute is set, additional restrictions: –  apply at compile and at run time

 –  apply in Unicode systems and in non-Unicode systems

 –  ensure that program will run on non-Unicode and Unicode systems with(almost) identical behavior 

not allowedok Attribute not set

(not Unicodeenabled)

okok Attribute set(Unicode enabled)

Unicodesystem

Non-Unicodesystem

Page 14: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 14/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 14

CONCATENATE cf1 cf2 TO cf3.

IF cf1 CS cf2. ...

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODE.

IF xf1 BYTE-CS xf2. ...

Unicode Restrictions – String Processing

Character Processing

String operations are only allowed for character-like operands

 –  ABAP types C, N, D, and T, STRING

 –  Structures consisting only of characters (C, N, D, T)

 –  X and XSTRING are no longer considered character-like types

Byte Processing

Variants of string operations for byte processing –  Addi tion „ IN BYTE MODE“ for statements

 –  Prefix „ BYTE-“ for comparison operations

Only operands of type X or XSTRING allowed

Page 15: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 15/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 15

Unicode Restrictions – Length and Distance

Determining the Length and Distance

Counted in bytes or in characters? Specify!

DESCRIBE FIELD...LENGTH... IN (BYTE | CHARACTER) MODE

DESCRIBE DISTANCE BETWEEN ... AND ... INTO ...IN (BYTE | CHARACTER) MODE.

ExampleFORM write3 USING fld TYPE c.

DATA: fldlen TYPE i.

DESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODE.

IF fldlen >= 3.

 WRITE: / fld(3).ENDIF.

ENDFORM.

Page 16: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 16/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 16

Unicode Restrictions – Access with Offset or Length

 Access To Structures With Offset/Length

Structure must begin with characters

Offset/length counted in characters

 Access only allowed within the character type prefix of a structure

 ASSIGN fld+off(len) TO ...  Access must not exceed field boundaries

If ASSIGN fails, field-symbol is set to „ unassigned“

New ... RANGE addition allows the permissible boundariesto be expanded

N(6) C(4) X(3) C(5)

+off(len)

Page 17: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 17/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 17

New ABAP Features – Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-key.

srest = stru-rest.

 WRITE: stru-r2.

skey = stru(4).

srest = stru+4(20).

 WRITE: stru-r2.

Pre-Unicode Unicode enabled with group names

DATA: BEGIN OF stru.INCLUDE TYPE t_key as key.INCLUDE TYPE t_rest as rest.

DATA: END OF stru.

DATA: skey TYPE t_key,srest TYPE t_rest.

TYPES: BEGIN OF t_key,

k1(2) TYPE x,

k2(2) TYPE c,

END OF t_key.

TYPES: BEGIN OF t_rest,

r1(10) TYPE c,

r2(10) TYPE c,END OF t_rest.

stru

k1 k2 r1 r2

key rest

Page 18: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 18/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 18

New ABAP Features – Golden Rule

Think in types

Think in semantics

Tell the system what you want to do

Page 19: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 19/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 19

Unicode Restrictions - MOVE

MOVE Between Incompatible Structures

Matching data layout („ fragment views“ ) required

Example

C(4) C(3) X(3) C(4) I

C(6) N(4) X(3) N(4) I P(8)

C(3)

C(10) X(3) C(4) I P(8)

struc1

struc2

fragments

cstru = xstru. "Unicode error!

DATA:

BEGIN OF cstru,first(10) TYPE c,tab(1) TYPE c,last(10) TYPE c,

END OF cstru.

DATA:

BEGIN OF xstru,first(10) TYPE c,tab(1) TYPE x VALUE '09',last(10) TYPE c,

END OF xstru.

Page 20: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 20/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 20

DATA: my_buffer TYPE xstring.

data1 TYPE some_type.

...

EXPORT id = data1 TO DATA BUFFER  my_buffer.

FORM read_buffer USING buffer TYPE xstring.

DATA: fld2 TYPE some_type.IMPORT id = fld2 FROM DATA BUFFER  buffer.

...

ENDFORM.

New ABAP Features – Import/Export Data Buffer 

Using fields of type xstring as data containers

Writing data to an xstring.

 –  Data is stored in a platform-independent format

 –  Contents of xstring can be exchanged with any other 6.10-system (Unicodeand non-Unicode)

Reading data from an xstring

 –  Automat ic convers ion of data during import

Page 21: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 21/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 21

New ABAP Features – Dynamic Programming Support

Creating Data Objects Dynamically

Creating and accessing data objects on the heap

Casting to User Defined Types

Look at the contents of a field as a value of another type

fld must provide sufficient alignment and length for the given type

DATA: dref TYPE REF TO data.

CREATE DATA dref TYPE sometype.

CREATE DATA dref TYPE (typename).

CREATE DATA dref TYPE c LENGTH len.

CREATE DATA dref TYPE STANDARD TABLE OF (typename)

 ASSIGN dref->* TO <f>. "access data object

FIELD-SYMBOLS: <f> TYPE any.

 ASSIGN fld TO <f> CASTING TYPE sometype.

 ASSIGN fld TO <f> CASTING TYPE (typename).

Page 22: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 22/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 22

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(C,N,D,T)

character-likestructures(C,N,D,T)

New ABAP Features - Generic Types

New generic types for parameters and field-symbols

Eliminate untyped parameters or field-symbols for improved securityand performance

Page 23: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 23/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 23

New ABAP Features – Enhancement categorization

If you are writ ing software for others you may have the following

Problem

Enhancements on structures or tables may affect your coding:

 –  Syntax-/runtime errors

 –  Changed behavior (e.g. damaged or changed data)

Solution Maintaining the enhancement category in the DDIC: SE11 (Extras ->

Enhancement Category)

 –  Can not be enhanced

 –  Can be enhanced - character like

 –  Can be enhanced – character and numerical type

 –  Can be arbitrarily enhanced

 

 Additional checks are done on your ABAP programs (SLIN) and showpossib le problems in allowed enhancement situations

Page 24: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 24/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 24

New ABAP Features – ABAP list programming

 ABAP lists: Difference between memory and display length

  1 Character   1 Display Column

’’Character units

in the memory

Display columns

Non-Unicode 2 2Unicode 1 2

Page 25: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 25/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 25

New ABAP Features – Different list types

DynamicHalf width (Default) Full width

Page 26: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 26/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 26

ABAP list programming – Golden Rules

Use ALV Grid and ALV List

Explicitely define display length

class CL_ABAP_LIST_UTILITIES

helps in complex cases

Page 27: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 27/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 27

New ABAP Features – Character Utilities

Class CL_ABAP_CHAR_UTILITIES

Constant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lf form_feedhorizontal_tab

vertical_tabbackspaceminchar X’00‘ in non-Unicode systems, U+0000 in Unicode systemsmaxchar X‘FF‘ in non-Unicode systems, U+FFFD in Unicode systems

Example

CLASS cl_abap_char_utilities DEFINITION LOAD.

DATA: text TYPE string.

REPLACE cl_abap_char_utilites=>horizontal_tab

 WITH space INTO text.

Page 28: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 28/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 28

system code page  any code pageCL_ABAP_CONV_OUT_CE

any code page 

any code pageCL_ABAP_CONV_X2X_CE

any code page 

system code pageCL_ABAP_CONV_IN_CE

Conversion ABAP Class

New ABAP Features – Conversion Classes

Conversion classes

Code page conversion –  Unicode / non-Unicode code pages

Endian conversion

 –  l ittle endian / big endian byte order 

Character conversion

 –  Unicode codepoint / ABAP character 

Page 29: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 29/59

Overview

 ABAP Language Enhancements

File Interfaces

Communication via RFC

Unicode enabling tools

Page 30: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 30/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 30

File transfer – Golden Rule

Know the code page used by the other side

or ask the user 

Page 31: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 31/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 31

File transfer: Application server 

Pattern for writing/reading files on the application server:

OPEN DATASET IN <mode> MODE

TRANSFER/READ

CLOSE DATASET

Page 32: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 32/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 32

File transfer: TEXT MODE ENCODING NON-UNICODE

TEXT MODE ENCODING NON-UNICODE

 Al lowed typescharacter like

Behavior convert text data between system code page and non-Unicode encodingmatching to current system language (sy-langu)

Usagebackward compatible exchange of text data with systems that cannotsupport UTF-8

Page 33: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 33/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 33

Example: TEXT MODE NON-UNICODE

R/3

ISO8859-1

SJIS

SY-LANGU

TEXT MODENON-UNICODE

SY-LANGU

TEXT MODENON-UNICODE

TEXT MODENON-UNICODE

TEXT MODENON-UNICODE1100

8000

1100

8000

  Only part of UC charset supported (possible data loss in the file)

  Structured data as a whole 

wri te f ield by f ield = 

File transfer: TEXT MODE ENCODING NON-UNICODE

R/3 Enterprise

Page 34: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 34/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 34

File transfer: ENCODING UTF-8

TEXT MODE ENCODING UTF-8

 Al lowed typescharacter like

Behavior convert text data between system code page and UTF-8 encoding

Usage

loss free exchange of text data

Page 35: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 35/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 35

Example: TEXT MODE UTF-8

R/3

ISO8859-1

SJISTEXT MODE UTF-8 TEXT MODE UTF-8

SY-LANGU

TEXT MODE UTF-8 TEXT MODE UTF-8

SY-LANGU

  Full charset supported (no data loss in the file)

  Structured data as a whole 

wri te f ield by f ield = 

File transfer: TEXT MODE ENCODING UTF-8

R/3 Enterprise

Page 36: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 36/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 36

File transfer: BINARY MODE

BINARY MODE

 Al lowed typesbinary and character like

Behavior no conversion, copy bytes between memory and file

Usage

fix format with defined encoding, endian and data structure

Page 37: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 37/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 37

Using XML as transport format

Use CALL TRANSFORMATION with target data type XSTRING to create anUTF-8 based XML representation of your data.

Structure information (nolayout / alignmentproblems)

UTF-8 based (no data loss)

Transport in binary form

File transfer: Using XML

Page 38: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 38/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 38

Example: UTF-8 based XML + BINARY MODE

R/3

ISO8859-1

SJIS

SY-LANGU

CALLTRANSFORMATION+ BINARY MODE

BINARY MODE +CALLTRANSFORMATION

CALLTRANSFORMATION+ BINARY MODE

SY-LANGU

BINARY MODE +CALLTRANSFORMATION

  Full charset supported (no data loss in the file)

  Structured data

File transfer: BINARY + Using XML

R/3 Enterprise

Page 39: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 39/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 39

File transfer: LEGACY MODE

LEGACY TEXT/BINARY MODE

 Al lowed typesbinary and character like

Behavior Produce in Unicode system format of non-Unicodeconvert text data to non-Unicoderead/transfer b inary data as is

Usagebackward compatibility wi th systems that mix b inary and character datawithin a file

Difference between TEXT and BINARYLEGACY TEXT MODE adds end of l ine marker 

Page 40: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 40/59

Overview

 ABAP Language Enhancements

File Interfaces

Communication via RFC

Unicode enabling tools

Page 41: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 41/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 41

RFC – Golden Rule

Everything Unicode

or ensure data fit to receiver 

Page 42: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 42/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 42

In case of an Unicode 

Unicode combination RFC passes all character 

data without code page conversion or merely with adaption of theendianness.

• UTF-16 big endian = SAP code page 4102• UTF-16 l it tle endian = SAP code page 4103

Information about the destination is maintained in SM59 special opt ions

 

character width in target system

• 1 Byte = non-Unicode• 2 Byte = Unicode

RFC Unicode   Unicode

R/3 Enterprise R/3 Enterprise

Page 43: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 43/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 43

In case of an Unicode 

non-Unicode single code page combination,RFC passes all character data with code page conversion between

Unicode and the old code page.

 As Unicode is a true superset of any old standard codepage not allUnicode characters can be transfered to the non-Unicode system:

 Ä 

 Äß 

ß

 

#

 

#

 

#  

#

RFC Unicode   non-Unicode single code page

R/3 4.6CISO8859-1

R/3 Enterprise

Page 44: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 44/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 44

In case of an Unicode 

non-Unicode MDMP combination RFC passesall character data with code page conversion between Unicode and thedif ferent old code pages.

Which of the MDMP code pages is chosen depends on the language:

 Ä 

DE 

 Äß 

DE 

ß

  JA 

  JA 

This mechanism is only available for flat tables with language key

RFC Unicode   non-Unicode MDMP (table with lang key)

R/3 4.6CISO8859-1

SJIS

R/3 Enterprise

Page 45: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 45/59

Overview

 ABAP Language Enhancements

File Interfaces

Communication via RFC

Unicode enabling tools

Page 46: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 46/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 46

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

 Adapt all ABAP programs to Unicode syntax and runtime restrict ions

Set attribute "Unicode enabled" for all programs

Step 2

Set up a Unicode system

 –  Unicode kernel + Unicode database

 –  Only ABAP programs with the Unicode attribute are executable

Do runtime tests in Unicode system

 –  Check for runtime errors –  Look for sematic errors

 –  Check ABAP list layout with former double byte characters

Page 47: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 47/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 47

Transaction UCCHECK

Page 48: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 48/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 48

Step 1 – Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applications:

Remove errors Inspect statically not analyzable places (optional)

 –  Untyped field symbols

 –  Offset with variable length

 –  Generic access to database tables

Set unicode program attributeusing UCCHECK or SE38 / SE24 / ...

Do additional checks with SLIN (e.g. matching of actual and formalparameters in function modules)

Page 49: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 49/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 49

UCCHECK – Setting Unicode Flag

Page 50: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 50/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 50

UCCHECK – Statically Non-Analyzable Places

What to do with the places that can only be checked at

runtime? Reduce their number 

 –  In many cases you can specify the type of parameters and field-symbols

 –  Use generic ABAP types where neccessary

 –  Mark those places that really need untyped parameters due to some kind of generic programming with “ #EC * as OK after you did revise them.

Do 

Runtime tests

Page 51: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 51/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 51

Step 2 – Testing Your Application

Final tests in the Unicode system

Runtime tests, Runtime tests, Runtime tests, ... –  Because the amount of warnings due to statically not analyzable places may

be very large, you cannot type everything. In this case you have to rely onrun-time tests.

 –  Some semantic problems may be seen only in the Unicodesystem (e.g. byte or character length)

 –  ABAP l is t layout can be checked only manuall y

Monitoring of runtime tests:

Having test plans is good, knowing the coverage of the test isbetter:

Use the ABAP Coverage Analyzer to monitor runtime tests

Page 52: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 52/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 52

Summary

Distinguish characters and bytes

Distinguish characters and display cells

Think in types, think in semantics,

tell the system what you want

Define code page for each communication

You can start ABAP Unicode enabling today

Page 53: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 53/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 53

Further Information

SAP Public Web:SAP Developer Network (SDN): www.sdn.sap.com

SAP Service Marketplace: www.service.sap.com/unicode@sap

Related Workshops/Lectures at SAP TechEd 2007

LCM211, Conversion of MDMP Systems to Unicode, Lecture

LCM212, Conversion of Single Code Page Systems to Unicode,

Lecture

Related SAP Education and Certification Opportunities

http://www.sap.com/education/

Page 54: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 54/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 54

SDN Subscriptions Program

The SDN Subscriptions Program introduces the SAPNetWeaver, Development Subscription for individualdevelopers. Available for purchase in Germany and theUnited States.

Subscription gives you one year access to …

SAP NetWeaver platform software, patches, and updates

Development license for SAP NetWeaver to evaluate, develop and test

Standard software maintenance

Online sessions f rom SAP TechEd  Access to SAP Enterprise Services Workplace for test ing

Premium presence in forums

Purchase the SAP NetWeaver, Development Subscr ipt ion today

at the SAP Community Clubhouse, or online athttps://www.sdn.sap.com/irj/sdn/devsub

Visit us at the Community Clubhouse, show us you are asubscr iber, and get a gift !

Page 55: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 55/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 55

THANK YOU FOR YOUR

ATTENTION !

QUESTIONS – SUGGESTIONS – DISCUSSION

Q & A

Page 56: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 56/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 56

Exercises

Page 57: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 57/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 57

Please complete your session evaluation.Be courteous — deposit your trash,

and do not take the handouts for the fol lowing session.

Feedback

Thank You

Page 58: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 58/59

SAP AG 2007, SAP TechEd ’07 / LCM262 / 58

Disclaimer 

“This presentation outlines our general product direction and should not be relied

on in making a purchase decision. This presentation is not subject to your licenseagreement or any other agreement with SAP. SAP has no obligation to pursue

any course of business outlined in this presentation or to develop or release any

functionality mentioned in this presentation. This presentation and SAP's strategy

and possible future developments are subject to change and may be changed by

SAP at any time for any reason without notice. This document is provided without

a warranty of any kind, either express or implied, including but not limited to, the

implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP assumes no responsibility for errors or omissions in this

document, except if such damages were caused by SAP intentionally or grossly

negligent.”

Page 59: UNICODE PRGG

8/10/2019 UNICODE PRGG

http://slidepdf.com/reader/full/unicode-prgg 59/59

SAP AG 2007 SAP T hEd ’07 / LCM262 / 59

Copyright 2007 SAP AG. All Rights Reserved

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 bechanged without prior notice.

Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.

Microsoft, Windows, Excel, Outlook, and PowerPoint 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, System i, System i5, System p,System p5, System x, System z, System z9, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix, i5/OS, POWER, POWER5, POWER5+, OpenPower and PowerPC aretrademarks or registered trademarks of IBM Corporation.

 Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States 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, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc.

HTML, XML, XHTML and W3C 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.MaxDB is a trademark of MySQL AB, Sweden.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registeredtrademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies.Data contained in this document serves informational purposes only. National product specifications may vary.

The information in this document is proprietary to SAP. No part of this document may be reproduced, copied, or transmitted in any form or for any purpose without the express prior written permission of SAP AG.

This document is a preliminary version and not subject to your license agreement or any other agreement with SAP. This document contains only intended strategies, developments,and functionalities of the SAP® product and is not intended to be binding upon SAP to any particular course of business, product strategy, and/or development. Please note that thisdocument is subject to change and may be changed by SAP at any time without notice.

SAP assumes no responsibility for errors or omissions in this document. SAP does not warrant the accuracy or completeness of the information, text, graphics, links, or other itemscontained within this material. This document is provided without a warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability,fitness for a particular purpose, or non-infringement.

SAP shall have no liability for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. Thislimitation shall not apply in cases of intent or gross negligence.

The statutory liability for personal injury and defective products is not affected. SAP has no control over the information that you may access through the use of hot links contained inthese materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Web pages.