session id: spc250 making abap programs unicode enabled › kmuuid2 ›...

54
Session ID: SPC250 Making ABAP Programs Unicode Enabled

Upload: others

Post on 07-Jun-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

Session ID SPC250Making ABAP ProgramsUnicode Enabled

Dr Christian Hansen SAP AG

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Essentials

What is UnicodeCharacter encoding schema for (nearly) all characters used world wide

Each character has a unique number (bdquoUnicode code pointldquo)Notation U+nnnn (where nnnn are hexadecimal digits)

See httpwwwunicodeorg for complete code charts

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Old solution for multiple languages MDMP

Check your system type with report RSCPINST current configuration

West European View Japanese View Korean View

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Old solution for multiple languages MDMP

West European View Japanese View Korean View

End of support withNetWeaver lsquo04

(see notes 838402 and 79991)

(As of release NetWeaver 04s and moving forward MDMP will no longer be supported)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only supported solution for multilingual systems Unicode

UnicodeUnicode

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade the integration platform

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

noEvolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

noSAP NetWeavertrade

Com

posi

te A

pplic

atio

n Fr

amew

ork

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

nono

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only solution for full integration Unicode

yes

yes

yes

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

E3 91 B979 3434 79U+3479

CE B1B1 0303 B1U+03B1

C3 A4E4 0000 E4U+00E4auml6161 0000 61U+0061a

UTF-8UTF-16little endian

UTF-16big endian

Unicodecodepoint

Character

Representation of Unicode Characters

UTF-16 ndash Unicode Transformation Format 16 bit encodingFixed length 1 character = 2 bytes (surrogate pairs = 2 + 2 bytes)Platform dependent byte order2 byte alignment restriction

UTF-8 ndash Unicode Transformation Format 8 bit encodingVariable length 1 character = 14 bytesPlatform independentno alignment restriction7 bit US ASCII compatible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

Character Expansion ModelSeparate Unicode and non-Unicode versions of R3

No explicit Unicode data type in ABAPSingle ABAP source for Unicode and non-Unicode systems

1 character = 2 bytes (UTF16)(types C N D T STRING)Unicode kernelUnicode database

1 character = 1 byte(types C N D T STRING)Non-Unicode kernelNon-Unicode database

ABAPsource

Non-Unicode

R3

UnicodeR3

ABAPsourceABAPsource

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

ImplicationsMajor part of ABAP coding is ready for Unicode without any changes

Minor part of ABAP coding written before release SAP_BASIS 610 hasto be adapted to comply with Unicode restrictions

Syntactical restrictionsAdditional runtime checksRuntime tests for semantic changes

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode-Enabled ABAP Programs

Program attribute bdquoUnicode checks activeldquoRequired to run on a Unicode system

If attribute is set additional restrictionsapply at compile and at run time

apply in Unicode systems and in non-Unicode systemsensure that program will run on non-Unicode and Unicode systems with

(almost) identical behavior

not allowedokAtrribute not set

(not Unicodeenabled)

okokAttribute set(Unicode enabled)

Unicodesystem

Non-Unicodesystem

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Program Attribute bdquoUnicode checks activeldquo

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 2: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

Dr Christian Hansen SAP AG

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Essentials

What is UnicodeCharacter encoding schema for (nearly) all characters used world wide

Each character has a unique number (bdquoUnicode code pointldquo)Notation U+nnnn (where nnnn are hexadecimal digits)

See httpwwwunicodeorg for complete code charts

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Old solution for multiple languages MDMP

Check your system type with report RSCPINST current configuration

West European View Japanese View Korean View

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Old solution for multiple languages MDMP

West European View Japanese View Korean View

End of support withNetWeaver lsquo04

(see notes 838402 and 79991)

(As of release NetWeaver 04s and moving forward MDMP will no longer be supported)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only supported solution for multilingual systems Unicode

UnicodeUnicode

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade the integration platform

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

noEvolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

noSAP NetWeavertrade

Com

posi

te A

pplic

atio

n Fr

amew

ork

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

nono

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only solution for full integration Unicode

yes

yes

yes

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

E3 91 B979 3434 79U+3479

CE B1B1 0303 B1U+03B1

C3 A4E4 0000 E4U+00E4auml6161 0000 61U+0061a

UTF-8UTF-16little endian

UTF-16big endian

Unicodecodepoint

Character

Representation of Unicode Characters

UTF-16 ndash Unicode Transformation Format 16 bit encodingFixed length 1 character = 2 bytes (surrogate pairs = 2 + 2 bytes)Platform dependent byte order2 byte alignment restriction

UTF-8 ndash Unicode Transformation Format 8 bit encodingVariable length 1 character = 14 bytesPlatform independentno alignment restriction7 bit US ASCII compatible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

Character Expansion ModelSeparate Unicode and non-Unicode versions of R3

No explicit Unicode data type in ABAPSingle ABAP source for Unicode and non-Unicode systems

1 character = 2 bytes (UTF16)(types C N D T STRING)Unicode kernelUnicode database

1 character = 1 byte(types C N D T STRING)Non-Unicode kernelNon-Unicode database

ABAPsource

Non-Unicode

R3

UnicodeR3

ABAPsourceABAPsource

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

ImplicationsMajor part of ABAP coding is ready for Unicode without any changes

Minor part of ABAP coding written before release SAP_BASIS 610 hasto be adapted to comply with Unicode restrictions

Syntactical restrictionsAdditional runtime checksRuntime tests for semantic changes

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode-Enabled ABAP Programs

Program attribute bdquoUnicode checks activeldquoRequired to run on a Unicode system

If attribute is set additional restrictionsapply at compile and at run time

apply in Unicode systems and in non-Unicode systemsensure that program will run on non-Unicode and Unicode systems with

(almost) identical behavior

not allowedokAtrribute not set

(not Unicodeenabled)

okokAttribute set(Unicode enabled)

Unicodesystem

Non-Unicodesystem

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Program Attribute bdquoUnicode checks activeldquo

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 3: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Essentials

What is UnicodeCharacter encoding schema for (nearly) all characters used world wide

Each character has a unique number (bdquoUnicode code pointldquo)Notation U+nnnn (where nnnn are hexadecimal digits)

See httpwwwunicodeorg for complete code charts

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Old solution for multiple languages MDMP

Check your system type with report RSCPINST current configuration

West European View Japanese View Korean View

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Old solution for multiple languages MDMP

West European View Japanese View Korean View

End of support withNetWeaver lsquo04

(see notes 838402 and 79991)

(As of release NetWeaver 04s and moving forward MDMP will no longer be supported)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only supported solution for multilingual systems Unicode

UnicodeUnicode

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade the integration platform

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

noEvolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

noSAP NetWeavertrade

Com

posi

te A

pplic

atio

n Fr

amew

ork

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

nono

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only solution for full integration Unicode

yes

yes

yes

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

E3 91 B979 3434 79U+3479

CE B1B1 0303 B1U+03B1

C3 A4E4 0000 E4U+00E4auml6161 0000 61U+0061a

UTF-8UTF-16little endian

UTF-16big endian

Unicodecodepoint

Character

Representation of Unicode Characters

UTF-16 ndash Unicode Transformation Format 16 bit encodingFixed length 1 character = 2 bytes (surrogate pairs = 2 + 2 bytes)Platform dependent byte order2 byte alignment restriction

UTF-8 ndash Unicode Transformation Format 8 bit encodingVariable length 1 character = 14 bytesPlatform independentno alignment restriction7 bit US ASCII compatible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

Character Expansion ModelSeparate Unicode and non-Unicode versions of R3

No explicit Unicode data type in ABAPSingle ABAP source for Unicode and non-Unicode systems

1 character = 2 bytes (UTF16)(types C N D T STRING)Unicode kernelUnicode database

1 character = 1 byte(types C N D T STRING)Non-Unicode kernelNon-Unicode database

ABAPsource

Non-Unicode

R3

UnicodeR3

ABAPsourceABAPsource

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

ImplicationsMajor part of ABAP coding is ready for Unicode without any changes

Minor part of ABAP coding written before release SAP_BASIS 610 hasto be adapted to comply with Unicode restrictions

Syntactical restrictionsAdditional runtime checksRuntime tests for semantic changes

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode-Enabled ABAP Programs

Program attribute bdquoUnicode checks activeldquoRequired to run on a Unicode system

If attribute is set additional restrictionsapply at compile and at run time

apply in Unicode systems and in non-Unicode systemsensure that program will run on non-Unicode and Unicode systems with

(almost) identical behavior

not allowedokAtrribute not set

(not Unicodeenabled)

okokAttribute set(Unicode enabled)

Unicodesystem

Non-Unicodesystem

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Program Attribute bdquoUnicode checks activeldquo

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 4: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Essentials

What is UnicodeCharacter encoding schema for (nearly) all characters used world wide

Each character has a unique number (bdquoUnicode code pointldquo)Notation U+nnnn (where nnnn are hexadecimal digits)

See httpwwwunicodeorg for complete code charts

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Old solution for multiple languages MDMP

Check your system type with report RSCPINST current configuration

West European View Japanese View Korean View

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Old solution for multiple languages MDMP

West European View Japanese View Korean View

End of support withNetWeaver lsquo04

(see notes 838402 and 79991)

(As of release NetWeaver 04s and moving forward MDMP will no longer be supported)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only supported solution for multilingual systems Unicode

UnicodeUnicode

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade the integration platform

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

noEvolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

noSAP NetWeavertrade

Com

posi

te A

pplic

atio

n Fr

amew

ork

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

nono

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only solution for full integration Unicode

yes

yes

yes

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

E3 91 B979 3434 79U+3479

CE B1B1 0303 B1U+03B1

C3 A4E4 0000 E4U+00E4auml6161 0000 61U+0061a

UTF-8UTF-16little endian

UTF-16big endian

Unicodecodepoint

Character

Representation of Unicode Characters

UTF-16 ndash Unicode Transformation Format 16 bit encodingFixed length 1 character = 2 bytes (surrogate pairs = 2 + 2 bytes)Platform dependent byte order2 byte alignment restriction

UTF-8 ndash Unicode Transformation Format 8 bit encodingVariable length 1 character = 14 bytesPlatform independentno alignment restriction7 bit US ASCII compatible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

Character Expansion ModelSeparate Unicode and non-Unicode versions of R3

No explicit Unicode data type in ABAPSingle ABAP source for Unicode and non-Unicode systems

1 character = 2 bytes (UTF16)(types C N D T STRING)Unicode kernelUnicode database

1 character = 1 byte(types C N D T STRING)Non-Unicode kernelNon-Unicode database

ABAPsource

Non-Unicode

R3

UnicodeR3

ABAPsourceABAPsource

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

ImplicationsMajor part of ABAP coding is ready for Unicode without any changes

Minor part of ABAP coding written before release SAP_BASIS 610 hasto be adapted to comply with Unicode restrictions

Syntactical restrictionsAdditional runtime checksRuntime tests for semantic changes

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode-Enabled ABAP Programs

Program attribute bdquoUnicode checks activeldquoRequired to run on a Unicode system

If attribute is set additional restrictionsapply at compile and at run time

apply in Unicode systems and in non-Unicode systemsensure that program will run on non-Unicode and Unicode systems with

(almost) identical behavior

not allowedokAtrribute not set

(not Unicodeenabled)

okokAttribute set(Unicode enabled)

Unicodesystem

Non-Unicodesystem

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Program Attribute bdquoUnicode checks activeldquo

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 5: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Old solution for multiple languages MDMP

Check your system type with report RSCPINST current configuration

West European View Japanese View Korean View

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Old solution for multiple languages MDMP

West European View Japanese View Korean View

End of support withNetWeaver lsquo04

(see notes 838402 and 79991)

(As of release NetWeaver 04s and moving forward MDMP will no longer be supported)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only supported solution for multilingual systems Unicode

UnicodeUnicode

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade the integration platform

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

noEvolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

noSAP NetWeavertrade

Com

posi

te A

pplic

atio

n Fr

amew

ork

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

nono

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only solution for full integration Unicode

yes

yes

yes

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

E3 91 B979 3434 79U+3479

CE B1B1 0303 B1U+03B1

C3 A4E4 0000 E4U+00E4auml6161 0000 61U+0061a

UTF-8UTF-16little endian

UTF-16big endian

Unicodecodepoint

Character

Representation of Unicode Characters

UTF-16 ndash Unicode Transformation Format 16 bit encodingFixed length 1 character = 2 bytes (surrogate pairs = 2 + 2 bytes)Platform dependent byte order2 byte alignment restriction

UTF-8 ndash Unicode Transformation Format 8 bit encodingVariable length 1 character = 14 bytesPlatform independentno alignment restriction7 bit US ASCII compatible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

Character Expansion ModelSeparate Unicode and non-Unicode versions of R3

No explicit Unicode data type in ABAPSingle ABAP source for Unicode and non-Unicode systems

1 character = 2 bytes (UTF16)(types C N D T STRING)Unicode kernelUnicode database

1 character = 1 byte(types C N D T STRING)Non-Unicode kernelNon-Unicode database

ABAPsource

Non-Unicode

R3

UnicodeR3

ABAPsourceABAPsource

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

ImplicationsMajor part of ABAP coding is ready for Unicode without any changes

Minor part of ABAP coding written before release SAP_BASIS 610 hasto be adapted to comply with Unicode restrictions

Syntactical restrictionsAdditional runtime checksRuntime tests for semantic changes

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode-Enabled ABAP Programs

Program attribute bdquoUnicode checks activeldquoRequired to run on a Unicode system

If attribute is set additional restrictionsapply at compile and at run time

apply in Unicode systems and in non-Unicode systemsensure that program will run on non-Unicode and Unicode systems with

(almost) identical behavior

not allowedokAtrribute not set

(not Unicodeenabled)

okokAttribute set(Unicode enabled)

Unicodesystem

Non-Unicodesystem

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Program Attribute bdquoUnicode checks activeldquo

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 6: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Old solution for multiple languages MDMP

West European View Japanese View Korean View

End of support withNetWeaver lsquo04

(see notes 838402 and 79991)

(As of release NetWeaver 04s and moving forward MDMP will no longer be supported)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only supported solution for multilingual systems Unicode

UnicodeUnicode

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade the integration platform

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

noEvolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

noSAP NetWeavertrade

Com

posi

te A

pplic

atio

n Fr

amew

ork

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

nono

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only solution for full integration Unicode

yes

yes

yes

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

E3 91 B979 3434 79U+3479

CE B1B1 0303 B1U+03B1

C3 A4E4 0000 E4U+00E4auml6161 0000 61U+0061a

UTF-8UTF-16little endian

UTF-16big endian

Unicodecodepoint

Character

Representation of Unicode Characters

UTF-16 ndash Unicode Transformation Format 16 bit encodingFixed length 1 character = 2 bytes (surrogate pairs = 2 + 2 bytes)Platform dependent byte order2 byte alignment restriction

UTF-8 ndash Unicode Transformation Format 8 bit encodingVariable length 1 character = 14 bytesPlatform independentno alignment restriction7 bit US ASCII compatible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

Character Expansion ModelSeparate Unicode and non-Unicode versions of R3

No explicit Unicode data type in ABAPSingle ABAP source for Unicode and non-Unicode systems

1 character = 2 bytes (UTF16)(types C N D T STRING)Unicode kernelUnicode database

1 character = 1 byte(types C N D T STRING)Non-Unicode kernelNon-Unicode database

ABAPsource

Non-Unicode

R3

UnicodeR3

ABAPsourceABAPsource

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

ImplicationsMajor part of ABAP coding is ready for Unicode without any changes

Minor part of ABAP coding written before release SAP_BASIS 610 hasto be adapted to comply with Unicode restrictions

Syntactical restrictionsAdditional runtime checksRuntime tests for semantic changes

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode-Enabled ABAP Programs

Program attribute bdquoUnicode checks activeldquoRequired to run on a Unicode system

If attribute is set additional restrictionsapply at compile and at run time

apply in Unicode systems and in non-Unicode systemsensure that program will run on non-Unicode and Unicode systems with

(almost) identical behavior

not allowedokAtrribute not set

(not Unicodeenabled)

okokAttribute set(Unicode enabled)

Unicodesystem

Non-Unicodesystem

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Program Attribute bdquoUnicode checks activeldquo

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 7: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only supported solution for multilingual systems Unicode

UnicodeUnicode

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade the integration platform

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

noEvolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

noSAP NetWeavertrade

Com

posi

te A

pplic

atio

n Fr

amew

ork

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

nono

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only solution for full integration Unicode

yes

yes

yes

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

E3 91 B979 3434 79U+3479

CE B1B1 0303 B1U+03B1

C3 A4E4 0000 E4U+00E4auml6161 0000 61U+0061a

UTF-8UTF-16little endian

UTF-16big endian

Unicodecodepoint

Character

Representation of Unicode Characters

UTF-16 ndash Unicode Transformation Format 16 bit encodingFixed length 1 character = 2 bytes (surrogate pairs = 2 + 2 bytes)Platform dependent byte order2 byte alignment restriction

UTF-8 ndash Unicode Transformation Format 8 bit encodingVariable length 1 character = 14 bytesPlatform independentno alignment restriction7 bit US ASCII compatible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

Character Expansion ModelSeparate Unicode and non-Unicode versions of R3

No explicit Unicode data type in ABAPSingle ABAP source for Unicode and non-Unicode systems

1 character = 2 bytes (UTF16)(types C N D T STRING)Unicode kernelUnicode database

1 character = 1 byte(types C N D T STRING)Non-Unicode kernelNon-Unicode database

ABAPsource

Non-Unicode

R3

UnicodeR3

ABAPsourceABAPsource

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

ImplicationsMajor part of ABAP coding is ready for Unicode without any changes

Minor part of ABAP coding written before release SAP_BASIS 610 hasto be adapted to comply with Unicode restrictions

Syntactical restrictionsAdditional runtime checksRuntime tests for semantic changes

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode-Enabled ABAP Programs

Program attribute bdquoUnicode checks activeldquoRequired to run on a Unicode system

If attribute is set additional restrictionsapply at compile and at run time

apply in Unicode systems and in non-Unicode systemsensure that program will run on non-Unicode and Unicode systems with

(almost) identical behavior

not allowedokAtrribute not set

(not Unicodeenabled)

okokAttribute set(Unicode enabled)

Unicodesystem

Non-Unicodesystem

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Program Attribute bdquoUnicode checks activeldquo

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 8: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade the integration platform

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

noEvolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

noSAP NetWeavertrade

Com

posi

te A

pplic

atio

n Fr

amew

ork

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

nono

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only solution for full integration Unicode

yes

yes

yes

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

E3 91 B979 3434 79U+3479

CE B1B1 0303 B1U+03B1

C3 A4E4 0000 E4U+00E4auml6161 0000 61U+0061a

UTF-8UTF-16little endian

UTF-16big endian

Unicodecodepoint

Character

Representation of Unicode Characters

UTF-16 ndash Unicode Transformation Format 16 bit encodingFixed length 1 character = 2 bytes (surrogate pairs = 2 + 2 bytes)Platform dependent byte order2 byte alignment restriction

UTF-8 ndash Unicode Transformation Format 8 bit encodingVariable length 1 character = 14 bytesPlatform independentno alignment restriction7 bit US ASCII compatible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

Character Expansion ModelSeparate Unicode and non-Unicode versions of R3

No explicit Unicode data type in ABAPSingle ABAP source for Unicode and non-Unicode systems

1 character = 2 bytes (UTF16)(types C N D T STRING)Unicode kernelUnicode database

1 character = 1 byte(types C N D T STRING)Non-Unicode kernelNon-Unicode database

ABAPsource

Non-Unicode

R3

UnicodeR3

ABAPsourceABAPsource

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

ImplicationsMajor part of ABAP coding is ready for Unicode without any changes

Minor part of ABAP coding written before release SAP_BASIS 610 hasto be adapted to comply with Unicode restrictions

Syntactical restrictionsAdditional runtime checksRuntime tests for semantic changes

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode-Enabled ABAP Programs

Program attribute bdquoUnicode checks activeldquoRequired to run on a Unicode system

If attribute is set additional restrictionsapply at compile and at run time

apply in Unicode systems and in non-Unicode systemsensure that program will run on non-Unicode and Unicode systems with

(almost) identical behavior

not allowedokAtrribute not set

(not Unicodeenabled)

okokAttribute set(Unicode enabled)

Unicodesystem

Non-Unicodesystem

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Program Attribute bdquoUnicode checks activeldquo

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 9: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

noEvolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

noSAP NetWeavertrade

Com

posi

te A

pplic

atio

n Fr

amew

ork

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

nono

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only solution for full integration Unicode

yes

yes

yes

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

E3 91 B979 3434 79U+3479

CE B1B1 0303 B1U+03B1

C3 A4E4 0000 E4U+00E4auml6161 0000 61U+0061a

UTF-8UTF-16little endian

UTF-16big endian

Unicodecodepoint

Character

Representation of Unicode Characters

UTF-16 ndash Unicode Transformation Format 16 bit encodingFixed length 1 character = 2 bytes (surrogate pairs = 2 + 2 bytes)Platform dependent byte order2 byte alignment restriction

UTF-8 ndash Unicode Transformation Format 8 bit encodingVariable length 1 character = 14 bytesPlatform independentno alignment restriction7 bit US ASCII compatible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

Character Expansion ModelSeparate Unicode and non-Unicode versions of R3

No explicit Unicode data type in ABAPSingle ABAP source for Unicode and non-Unicode systems

1 character = 2 bytes (UTF16)(types C N D T STRING)Unicode kernelUnicode database

1 character = 1 byte(types C N D T STRING)Non-Unicode kernelNon-Unicode database

ABAPsource

Non-Unicode

R3

UnicodeR3

ABAPsourceABAPsource

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

ImplicationsMajor part of ABAP coding is ready for Unicode without any changes

Minor part of ABAP coding written before release SAP_BASIS 610 hasto be adapted to comply with Unicode restrictions

Syntactical restrictionsAdditional runtime checksRuntime tests for semantic changes

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode-Enabled ABAP Programs

Program attribute bdquoUnicode checks activeldquoRequired to run on a Unicode system

If attribute is set additional restrictionsapply at compile and at run time

apply in Unicode systems and in non-Unicode systemsensure that program will run on non-Unicode and Unicode systems with

(almost) identical behavior

not allowedokAtrribute not set

(not Unicodeenabled)

okokAttribute set(Unicode enabled)

Unicodesystem

Non-Unicodesystem

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Program Attribute bdquoUnicode checks activeldquo

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 10: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

noEvolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

noSAP NetWeavertrade

Com

posi

te A

pplic

atio

n Fr

amew

ork

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

nono

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only solution for full integration Unicode

yes

yes

yes

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

E3 91 B979 3434 79U+3479

CE B1B1 0303 B1U+03B1

C3 A4E4 0000 E4U+00E4auml6161 0000 61U+0061a

UTF-8UTF-16little endian

UTF-16big endian

Unicodecodepoint

Character

Representation of Unicode Characters

UTF-16 ndash Unicode Transformation Format 16 bit encodingFixed length 1 character = 2 bytes (surrogate pairs = 2 + 2 bytes)Platform dependent byte order2 byte alignment restriction

UTF-8 ndash Unicode Transformation Format 8 bit encodingVariable length 1 character = 14 bytesPlatform independentno alignment restriction7 bit US ASCII compatible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

Character Expansion ModelSeparate Unicode and non-Unicode versions of R3

No explicit Unicode data type in ABAPSingle ABAP source for Unicode and non-Unicode systems

1 character = 2 bytes (UTF16)(types C N D T STRING)Unicode kernelUnicode database

1 character = 1 byte(types C N D T STRING)Non-Unicode kernelNon-Unicode database

ABAPsource

Non-Unicode

R3

UnicodeR3

ABAPsourceABAPsource

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

ImplicationsMajor part of ABAP coding is ready for Unicode without any changes

Minor part of ABAP coding written before release SAP_BASIS 610 hasto be adapted to comply with Unicode restrictions

Syntactical restrictionsAdditional runtime checksRuntime tests for semantic changes

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode-Enabled ABAP Programs

Program attribute bdquoUnicode checks activeldquoRequired to run on a Unicode system

If attribute is set additional restrictionsapply at compile and at run time

apply in Unicode systems and in non-Unicode systemsensure that program will run on non-Unicode and Unicode systems with

(almost) identical behavior

not allowedokAtrribute not set

(not Unicodeenabled)

okokAttribute set(Unicode enabled)

Unicodesystem

Non-Unicodesystem

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Program Attribute bdquoUnicode checks activeldquo

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 11: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

noSAP NetWeavertrade

Com

posi

te A

pplic

atio

n Fr

amew

ork

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

nono

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only solution for full integration Unicode

yes

yes

yes

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

E3 91 B979 3434 79U+3479

CE B1B1 0303 B1U+03B1

C3 A4E4 0000 E4U+00E4auml6161 0000 61U+0061a

UTF-8UTF-16little endian

UTF-16big endian

Unicodecodepoint

Character

Representation of Unicode Characters

UTF-16 ndash Unicode Transformation Format 16 bit encodingFixed length 1 character = 2 bytes (surrogate pairs = 2 + 2 bytes)Platform dependent byte order2 byte alignment restriction

UTF-8 ndash Unicode Transformation Format 8 bit encodingVariable length 1 character = 14 bytesPlatform independentno alignment restriction7 bit US ASCII compatible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

Character Expansion ModelSeparate Unicode and non-Unicode versions of R3

No explicit Unicode data type in ABAPSingle ABAP source for Unicode and non-Unicode systems

1 character = 2 bytes (UTF16)(types C N D T STRING)Unicode kernelUnicode database

1 character = 1 byte(types C N D T STRING)Non-Unicode kernelNon-Unicode database

ABAPsource

Non-Unicode

R3

UnicodeR3

ABAPsourceABAPsource

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

ImplicationsMajor part of ABAP coding is ready for Unicode without any changes

Minor part of ABAP coding written before release SAP_BASIS 610 hasto be adapted to comply with Unicode restrictions

Syntactical restrictionsAdditional runtime checksRuntime tests for semantic changes

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode-Enabled ABAP Programs

Program attribute bdquoUnicode checks activeldquoRequired to run on a Unicode system

If attribute is set additional restrictionsapply at compile and at run time

apply in Unicode systems and in non-Unicode systemsensure that program will run on non-Unicode and Unicode systems with

(almost) identical behavior

not allowedokAtrribute not set

(not Unicodeenabled)

okokAttribute set(Unicode enabled)

Unicodesystem

Non-Unicodesystem

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Program Attribute bdquoUnicode checks activeldquo

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 12: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SAP NetWeavertrade with non-Unicode ABAP stack

no

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

nono

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

non-Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only solution for full integration Unicode

yes

yes

yes

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

E3 91 B979 3434 79U+3479

CE B1B1 0303 B1U+03B1

C3 A4E4 0000 E4U+00E4auml6161 0000 61U+0061a

UTF-8UTF-16little endian

UTF-16big endian

Unicodecodepoint

Character

Representation of Unicode Characters

UTF-16 ndash Unicode Transformation Format 16 bit encodingFixed length 1 character = 2 bytes (surrogate pairs = 2 + 2 bytes)Platform dependent byte order2 byte alignment restriction

UTF-8 ndash Unicode Transformation Format 8 bit encodingVariable length 1 character = 14 bytesPlatform independentno alignment restriction7 bit US ASCII compatible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

Character Expansion ModelSeparate Unicode and non-Unicode versions of R3

No explicit Unicode data type in ABAPSingle ABAP source for Unicode and non-Unicode systems

1 character = 2 bytes (UTF16)(types C N D T STRING)Unicode kernelUnicode database

1 character = 1 byte(types C N D T STRING)Non-Unicode kernelNon-Unicode database

ABAPsource

Non-Unicode

R3

UnicodeR3

ABAPsourceABAPsource

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

ImplicationsMajor part of ABAP coding is ready for Unicode without any changes

Minor part of ABAP coding written before release SAP_BASIS 610 hasto be adapted to comply with Unicode restrictions

Syntactical restrictionsAdditional runtime checksRuntime tests for semantic changes

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode-Enabled ABAP Programs

Program attribute bdquoUnicode checks activeldquoRequired to run on a Unicode system

If attribute is set additional restrictionsapply at compile and at run time

apply in Unicode systems and in non-Unicode systemsensure that program will run on non-Unicode and Unicode systems with

(almost) identical behavior

not allowedokAtrribute not set

(not Unicodeenabled)

okokAttribute set(Unicode enabled)

Unicodesystem

Non-Unicodesystem

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Program Attribute bdquoUnicode checks activeldquo

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 13: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Only solution for full integration Unicode

yes

yes

yes

Evolution of mySAP Technology

Unifies and aligns peopleinformation and business processes

Integrates across technologies andorganizational boundaries

A safe choice with full NET and J2EEinteroperability

The business foundation for SAPand partners

Powers business-ready solutionsthat reduce custom integration

Its Enterprise Services Architectureincreases business process flexibility

SAP NetWeavertradeC

ompo

site

App

licat

ion

Fram

ewor

k

PEOPLE INTEGRATION

Multi channel access

Portal Collaboration

INFORMATION INTEGRATION

Bus Intelligence

Master Data Mgmt

Knowledge Mgmt

PROCESS INTEGRATION

IntegrationBroker

BusinessProcess Mgmt

APPLICATION PLATFORM

J2EE

DB and OS Abstraction

Unicode ABAPLife-C

acleM

gmt

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

E3 91 B979 3434 79U+3479

CE B1B1 0303 B1U+03B1

C3 A4E4 0000 E4U+00E4auml6161 0000 61U+0061a

UTF-8UTF-16little endian

UTF-16big endian

Unicodecodepoint

Character

Representation of Unicode Characters

UTF-16 ndash Unicode Transformation Format 16 bit encodingFixed length 1 character = 2 bytes (surrogate pairs = 2 + 2 bytes)Platform dependent byte order2 byte alignment restriction

UTF-8 ndash Unicode Transformation Format 8 bit encodingVariable length 1 character = 14 bytesPlatform independentno alignment restriction7 bit US ASCII compatible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

Character Expansion ModelSeparate Unicode and non-Unicode versions of R3

No explicit Unicode data type in ABAPSingle ABAP source for Unicode and non-Unicode systems

1 character = 2 bytes (UTF16)(types C N D T STRING)Unicode kernelUnicode database

1 character = 1 byte(types C N D T STRING)Non-Unicode kernelNon-Unicode database

ABAPsource

Non-Unicode

R3

UnicodeR3

ABAPsourceABAPsource

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

ImplicationsMajor part of ABAP coding is ready for Unicode without any changes

Minor part of ABAP coding written before release SAP_BASIS 610 hasto be adapted to comply with Unicode restrictions

Syntactical restrictionsAdditional runtime checksRuntime tests for semantic changes

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode-Enabled ABAP Programs

Program attribute bdquoUnicode checks activeldquoRequired to run on a Unicode system

If attribute is set additional restrictionsapply at compile and at run time

apply in Unicode systems and in non-Unicode systemsensure that program will run on non-Unicode and Unicode systems with

(almost) identical behavior

not allowedokAtrribute not set

(not Unicodeenabled)

okokAttribute set(Unicode enabled)

Unicodesystem

Non-Unicodesystem

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Program Attribute bdquoUnicode checks activeldquo

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 14: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

E3 91 B979 3434 79U+3479

CE B1B1 0303 B1U+03B1

C3 A4E4 0000 E4U+00E4auml6161 0000 61U+0061a

UTF-8UTF-16little endian

UTF-16big endian

Unicodecodepoint

Character

Representation of Unicode Characters

UTF-16 ndash Unicode Transformation Format 16 bit encodingFixed length 1 character = 2 bytes (surrogate pairs = 2 + 2 bytes)Platform dependent byte order2 byte alignment restriction

UTF-8 ndash Unicode Transformation Format 8 bit encodingVariable length 1 character = 14 bytesPlatform independentno alignment restriction7 bit US ASCII compatible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

Character Expansion ModelSeparate Unicode and non-Unicode versions of R3

No explicit Unicode data type in ABAPSingle ABAP source for Unicode and non-Unicode systems

1 character = 2 bytes (UTF16)(types C N D T STRING)Unicode kernelUnicode database

1 character = 1 byte(types C N D T STRING)Non-Unicode kernelNon-Unicode database

ABAPsource

Non-Unicode

R3

UnicodeR3

ABAPsourceABAPsource

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

ImplicationsMajor part of ABAP coding is ready for Unicode without any changes

Minor part of ABAP coding written before release SAP_BASIS 610 hasto be adapted to comply with Unicode restrictions

Syntactical restrictionsAdditional runtime checksRuntime tests for semantic changes

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode-Enabled ABAP Programs

Program attribute bdquoUnicode checks activeldquoRequired to run on a Unicode system

If attribute is set additional restrictionsapply at compile and at run time

apply in Unicode systems and in non-Unicode systemsensure that program will run on non-Unicode and Unicode systems with

(almost) identical behavior

not allowedokAtrribute not set

(not Unicodeenabled)

okokAttribute set(Unicode enabled)

Unicodesystem

Non-Unicodesystem

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Program Attribute bdquoUnicode checks activeldquo

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 15: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

Character Expansion ModelSeparate Unicode and non-Unicode versions of R3

No explicit Unicode data type in ABAPSingle ABAP source for Unicode and non-Unicode systems

1 character = 2 bytes (UTF16)(types C N D T STRING)Unicode kernelUnicode database

1 character = 1 byte(types C N D T STRING)Non-Unicode kernelNon-Unicode database

ABAPsource

Non-Unicode

R3

UnicodeR3

ABAPsourceABAPsource

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

ImplicationsMajor part of ABAP coding is ready for Unicode without any changes

Minor part of ABAP coding written before release SAP_BASIS 610 hasto be adapted to comply with Unicode restrictions

Syntactical restrictionsAdditional runtime checksRuntime tests for semantic changes

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode-Enabled ABAP Programs

Program attribute bdquoUnicode checks activeldquoRequired to run on a Unicode system

If attribute is set additional restrictionsapply at compile and at run time

apply in Unicode systems and in non-Unicode systemsensure that program will run on non-Unicode and Unicode systems with

(almost) identical behavior

not allowedokAtrribute not set

(not Unicodeenabled)

okokAttribute set(Unicode enabled)

Unicodesystem

Non-Unicodesystem

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Program Attribute bdquoUnicode checks activeldquo

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 16: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transparent Unicode Enabling of R3

ImplicationsMajor part of ABAP coding is ready for Unicode without any changes

Minor part of ABAP coding written before release SAP_BASIS 610 hasto be adapted to comply with Unicode restrictions

Syntactical restrictionsAdditional runtime checksRuntime tests for semantic changes

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode-Enabled ABAP Programs

Program attribute bdquoUnicode checks activeldquoRequired to run on a Unicode system

If attribute is set additional restrictionsapply at compile and at run time

apply in Unicode systems and in non-Unicode systemsensure that program will run on non-Unicode and Unicode systems with

(almost) identical behavior

not allowedokAtrribute not set

(not Unicodeenabled)

okokAttribute set(Unicode enabled)

Unicodesystem

Non-Unicodesystem

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Program Attribute bdquoUnicode checks activeldquo

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 17: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode-Enabled ABAP Programs

Program attribute bdquoUnicode checks activeldquoRequired to run on a Unicode system

If attribute is set additional restrictionsapply at compile and at run time

apply in Unicode systems and in non-Unicode systemsensure that program will run on non-Unicode and Unicode systems with

(almost) identical behavior

not allowedokAtrribute not set

(not Unicodeenabled)

okokAttribute set(Unicode enabled)

Unicodesystem

Non-Unicodesystem

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Program Attribute bdquoUnicode checks activeldquo

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 18: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Program Attribute bdquoUnicode checks activeldquo

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 19: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 20: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Enabled ABAP - Overview

Design GoalsPlatform independence

Identical behavior on Unicode and non-Unicode systems

Highest level of compatibility to the pre-Unicode worldMinimize costs for Unicode enabling of ABAP Programs

Improved security maintainability and readability of ABAP programs

Main FeaturesClear distinction between character and byte processing

1 Character 1 ByteEnhanced checks prevent programming based on memory layoutassumptionsImproved conversion facilitiesImproved dataset interfaceImproved support for dynamic programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 21: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

CONCATENATE cf1 cf2 TO cf3IF cf1 CS cf2

CONCATENATE xf1 xf2 TO xf3 IN BYTE MODEIF xf1 BYTE-CS xf2

Unicode Restrictions ndash String Processing

Character Processing

String operations are only allowed for character-like operandsABAP types C N D and T STRINGStructures 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 processingAddition bdquoIN BYTE MODEldquo for statementsPrefix bdquoBYTE-ldquo for comparison operations

Only operands of type X or XSTRING allowed

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 22: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Length and Distance

Determining the Length and DistanceCounted in bytes or in characters Specify

DESCRIBE FIELDLENGTH IN (BYTE | CHARACTER) MODE

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

Example

FORM write3 USING fld TYPE cDATA fldlen TYPE iDESCRIBE FIELD fld LENGTH fldlen IN CHARACTER MODEIF fldlen gt= 3

WRITE fld(3)ENDIF

ENDFORM

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 23: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions - MOVE

MOVE Between Incompatible StructuresMatching data layout (bdquofragment viewsldquo) 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

DATABEGIN OF cstrufirst(10) TYPE ctab(1) TYPE clast(10) TYPE c

END OF cstru

DATABEGIN OF xstrufirst(10) TYPE ctab(1) TYPE x VALUE 09last(10) TYPE c

END OF xstru

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 24: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Unicode Restrictions ndash Access with Offset or Length

Access To Structures With OffsetLengthStructure must begin with charactersOffsetlength counted in charactersAccess only allowed within the character type prefix of a structure

ASSIGN fld+off(len) TO Access must not exceed field boundariesIf ASSIGN fails field-symbol is set to bdquounassignedldquoNew RANGE addition allows the permissible boundariesto be expanded

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

+off(len)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 25: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Character Utilities

Class CL_ABAP_CHAR_UTILITIESConstant attributes with system specific values

charsize length of 1 character in bytesnewlinecr_lfform_feedhorizontal_tabvertical_tabbackspaceminchar Xrsquo00lsquo in non-Unicode systems U+0000 in Unicode systemsmaxchar XlsquoFFlsquo 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=gthorizontal_tabWITH space INTO text

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 26: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Extended File Interface

Reading Writing Different Text Formats

Only character-like fields allowed for reading writing text filesExplicit open required in Unicode enabled programs

Reading Writing Legacy Formats

Reading or writing data in a format compatible to non-Unicode systemsNot character-like structures allowed

OPEN DATASET dsn IN TEXT MODEENCODING (DEFAULT | UTF-8 | NON-UNICODE)

TRANSFER text TO dsnREAD DATASET dsn INTO text

OPEN DATASET dsn IN LEGACY (TEXT | BINARY) MODE (LITTLE | BIG) ENDIAN CODEPAGE cp

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 27: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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

ConversionABAP Class

New ABAP Features ndash Conversion Classes

Conversion classesCode page conversion

Unicode non-Unicode code pages

Endian conversionlittle endian big endian byte order

Character conversionUnicode codepoint ABAP character

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 28: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Includes with Group Names

Symbolic Access to Includes of Structures

skey = stru-keysrest = stru-restWRITE stru-r2

skey = stru(4)srest = stru+4(20)WRITE stru-r2

Pre-Unicode Unicode enabled with group names

DATA BEGIN OF struINCLUDE TYPE t_key as keyINCLUDE TYPE t_rest as rest

DATA END OF struDATA skey TYPE t_key

srest TYPE t_rest

TYPES BEGIN OF t_keyk1(2) TYPE xk2(2) TYPE c

END OF t_key

TYPES BEGIN OF t_restr1(10) TYPE cr2(10) TYPE c

END OF t_rest

stru

k1 k2 r1 r2

key rest

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 29: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

DATA my_buffer TYPE xstringdata1 TYPE some_type

EXPORT id = data1 TO DATA BUFFER my_buffer

FORM read_buffer USING buffer TYPE xstringDATA fld2 TYPE some_typeIMPORT id = fld2 FROM DATA BUFFER buffer

ENDFORM

New ABAP Features ndash ImportExport Data Buffer

Using fields of type xstring as data containersWriting data to an xstring

Data is stored in a platform-independent formatContents of xstring can be exchanged with any other 610-system (Unicodeand non-Unicode)

Reading data from an xstring

Automatic conversion of data during import

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 30: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Dynamic Programming Support

Creating Data Objects DynamicallyCreating and accessing data objects on the heap

Casting to User Defined TypesLook 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 sometypeCREATE DATA dref TYPE (typename)CREATE DATA dref TYPE c LENGTH lenCREATE DATA dref TYPE STANDARD TABLE OF (typename)

ASSIGN dref-gt TO ltfgt access data object

FIELD-SYMBOLS ltfgt TYPE any

ASSIGN fld TO ltfgt CASTING TYPE sometypeASSIGN fld TO ltfgt CASTING TYPE (typename)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 31: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

SIMPLESIMPLE

CLIKECLIKE

XSEQUENCEXSEQUENCECSEQUENCECSEQUENCE NUMERICNUMERIC

II FF PPXX XSTRINGXSTRINGCC STRINGSTRING NN DD TT character-likestructures(CNDT)

character-likestructures(CNDT)

New ABAP Features - Generic Types

New generic types for parameters and field-symbolsEliminate untyped parameters or field-symbols for improved securityand performance

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 32: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Enhancement categorization

If you are writing software for others you may have the following

ProblemEnhancements on structures or tables may affect your coding

Syntax-runtime errorsChanged behavior (eg damaged or changed data)

SolutionMaintaining the enhancement category in the DDIC SE11 (Extras -gtEnhancement Category)

Can not be enhancedCan be enhanced - character likeCan be enhanced ndash character and numerical typeCan be arbitrarily enhanced

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 33: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

ABAP lists Difference between memory and display length

1 Character 1 Display Column

rsquo rsquoCharacter unitsin the memory

Display columns

Non-Unicode 2 2Unicode 1 2

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 34: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Handling for character fields

Truncation may be done during display to synchronize memory lengthand display length at the field boundaries

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 35: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Padding is done in the list table (here for the first field S1) to synchronizememory length and display length at the field boundaries

Handling for strings

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 36: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash Different list types

DynamicHalf width (Default) Full width

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 37: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

New ABAP statementsSETGET CURSOR MEMORY OFFSETDynamic output length WRITE () fieldMaximum output length WRITE () field

Utility Class CL_ABAP_LIST_UTILITIESCalculating display lengthsConversions display length memory length inside fieldsHandling of implicit field boundaries

See note 541299 for details

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 38: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 39: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

New ABAP Features ndash ABAP list programming

Golden rules for ABAP list programming

a) Donrsquot mix up display length and memory length

b) Donrsquot smudge field boundaries

c) Donrsquot overwrite parts of fields

d) Donrsquot do self programmed right-justified or centered

e) Donrsquot do self programmed scrolling (memory based)

f) Donrsquot forget to specify suficcient output length if alldata needs always to be visible

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 40: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Agenda

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 41: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Migrating to Unicode Enabled ABAP

Step 1

In non-Unicode system

Adapt all ABAP programs to Unicode syntax and runtime restrictions

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 42: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 1 ndash Unicode Enabling with UCCHECK

Use UCCHECK to analyze your applicationsRemove errorsInspect statically not analyzable places (optional)

Untyped field symbolsOffset with variable lengthGeneric access to database tables

Set unicode program attributeusing UCCHECK or SE38 SE24 Do additional checks with SLIN (eg matching of actual and formalparameters in function modules)

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 43: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Transaction UCCHECK

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 44: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Setting Unicode Flag

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 45: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

UCCHECK ndash Statically Non-Analyzable Places

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

Reduce their numberIn many cases you can specify the type of parameters and field-symbolsUse generic ABAP types where neccessaryMark those places that really need untyped parameters due to some kind ofgeneric programming with ldquoEC as OK after you did revise them

Do Runtime tests

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 46: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Step 2 ndash 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 maybe very large you cannot type everything In this case you have to rely on run-time testsSome semantic problems may be seen only in the Unicodesystem (eg byte or character length)ABAP list layout can be checked only manually

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

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 47: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

ABAP Coverage Analyzer

Coverage Analyzer (Transaction SCOV)persistently traces the execution of all program objects within onesystemtraces all processing blocks

ie FORMS Methods Modules and ABAP events

collects InformationNumber of callsNumber of runtime errorsNumber of program changes

Two Different Target GroupsDevelopers

Help to see in detail which parts of your programs are used and which are not

Quality ManagersDetermine the overall system coverage during a test phase

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 48: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Details View for Developers

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 49: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Coverage Analyzer ndash Global View for QM

1

23

4

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 50: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Part I ndash SAPs approach to UnicodeDemo ndash Unicode vs Non-Unicode R3

Unicode Essentials

Transparent Unicode Enabling for R3

Part II ndash Unicode Enabled ABAPUnicode Restrictions

New ABAP Features

Part III ndash Tools for Unicode EnablingMigration to Unicode

Unicode Scan UCCHECK

Coverage Analyzer SCOV

Exercises

Agenda

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 51: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Public WebhttpwwwservicesapcomUnicodesap TechnologyhttpwwwservicesapcomUnicode Customer contactNetWeaver Developerlsquos Guide wwwsdnsapcomsdndevelopersguidesdn

Related WorkshopsLectures at SAP TechEd 2005SPC202 Conversion of SAP Systems to Unicode lectureSPC204 Performance Techniques for Unicode Conversion of Single Code

Page Systems lecture (Teched Boston only)SPC250 Making ABAP Programs Unicode Enabled hands onSPC251 Unicode Interfaces ndash Data Exchange Between Unicode and non-

Unicode Systems hands onLCM207 SAP Upgrade and Unicode Methodology (Teched Boston only)IM101 Dealing with Multi-Language Garbage Data ndash Lessons Learned

lecture (Teched Boston only)

Related SAP Education Training Opportunitieshttpwwwservicesapcomrkt-unicode

Further information

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 52: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

QampA

Questions

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 53: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

Please complete your session evaluation

Be courteous mdash deposit your trashand do not take the handouts for the following session

Feedback

Thank You

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved

Page 54: Session ID: SPC250 Making ABAP Programs Unicode Enabled › kmuuid2 › 30781270-bc11-2a10-2a8d-f890e… · Evolution of mySAP Technology Unifies and aligns people, information and

SAP AG 2005 SAP TechEd rsquo05 Session ID SPC250

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 informationcontained herein may be changed without prior noticeSome software products marketed by SAP AG and its distributors contain proprietary software components of other software vendorsMicrosoft Windows Outlook and PowerPoint are registered trademarks of Microsoft CorporationIBM DB2 DB2 Universal Database OS2 Parallel Sysplex MVSESA AIX S390 AS400 OS390 OS400 iSeries pSeries xSeries zSeries zOS AFPIntelligent Miner WebSphere Netfinity Tivoli and Informix are trademarks or registered trademarks of IBM CorporationOracle is a registered trademark of Oracle CorporationUNIX XOpen OSF1 and Motif are registered trademarks of the Open GroupCitrix ICA Program Neighborhood MetaFrame WinFrame VideoFrame and MultiWin are trademarks or registered trademarks of Citrix Systems IncHTML XML XHTML and W3C are trademarks or registered trademarks of W3Creg World Wide Web Consortium Massachusetts Institute of TechnologyJava is a registered trademark of Sun Microsystems IncJavaScript is a registered trademark of Sun Microsystems Inc used under license for technology invented and implemented by NetscapeMaxDB is a trademark of MySQL AB SwedenSAP R3 mySAP mySAPcom xApps xApp SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos aretrademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world All other product and service names mentionedare 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 purposewithout the express prior written permission of SAP AGThis document is a preliminary version and not subject to your license agreement or any other agreement with SAP This document contains only intendedstrategies developments and functionalities of the SAPreg product and is not intended to be binding upon SAP to any particular course of business productstrategy andor development Please note that this document is subject to change and may be changed by SAP at any time without noticeSAP assumes no responsibility for errors or omissions in this document SAP does not warrant the accuracy or completeness of the information text graphicslinks or other items contained within this material This document is provided without a warranty of any kind either express or implied including but not limitedto the implied warranties of merchantability fitness for a particular purpose or non-infringementSAP shall have no liability for damages of any kind including without limitation direct special indirect or consequential damages that may result from the use ofthese materials This limitation shall not apply in cases of intent or gross negligenceThe 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 ofhot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Webpages

Copyright 2005 SAP AG All Rights Reserved