Differences Between Unicode and Non-Unicode Programs

download Differences Between Unicode and Non-Unicode Programs

of 13

Transcript of Differences Between Unicode and Non-Unicode Programs

  • 8/9/2019 Differences Between Unicode and Non-Unicode Programs

    1/13

    ABAP Keyword DocumentationSAP NetWeaver AS ABAP Release 731, ©Copyright 2015 SAP AG All rights reserve!

      •  Differences between Unicode and Non-Unicode Programs 

    Comments and Literals in Non-Unicode Programs  Names in Unicode Programs 

    Program Structure of Unicode Programs 

    Operand Types in Unicode Programs 

    lignment in Unicode Systems 

    Offset and Lengt! Specifications in Unicode Programs 

    ccess to "emory Se#uences in Unicode Programs 

    Con$ersion of Structures in Unicode Programs 

    Structure Typing in Unicode Programs 

    Structure %n!ancements and Unicode Programs 

    C!aracter String and &yte String Processing in Unicode Programs 

    'unction "odule Calls in Unicode Programs 

    Open S(L in Unicode Programs 

    T!e 'ile )nterface in Unicode Programs 

    Lists in Unicode Systems 

    Differences between Unicode and Non-Unicode Programs"he ABAP #ey $or! !o%&'e(tatio( !es%ri)es the ABAP state'e(ts *or )oth +(i%o!e a(! (o(+(i%o!esyste's -(ly +(i%o!e progra's %a( )e %o'pile! a(! e.e%&te! i( +(i%o!e syste's /( (o(+(i%o!e syste's,

    this is also possi)le *or (o(+(i%o!e progra's o$ever, +(i%o!e progra's sho&l! also )e &se! i( (o(+(i%o!e syste's, *or the *ollo$i(g reaso(s

    • Static type c!ec*s are e+ecuted in Unicode programs,

    • &yte processing and string processing is separated in Unicode programs,

    • Structures are always !andled as structures in Unicode programs,

    • Uncontrolled access to segments of t!e wor*ing memory is not possible in Unicode programs,

    "his 'a#es +(i%o!e progra's easier to &(!ersta(!, 'ore ro)&st, a(! easier to 'ai(tai( tha( (o(+(i%o!eprogra's

    "he *ollo$i(g se%tio( lists the la(g&age %o(str&%ts a(! state'e(ts *or $hi%h there are !i**ere(%es )et$ee(+(i%o!e a(! (o(+(i%o!e progra's

    • Comments and Literals in Non-Unicode Programs

    •  Names in Unicode Programs

    • Program Structure of Unicode Programs

    • Operand Types in Unicode Programs

    • lignment in Unicode Systems

    http://change%28%27i1%27%29/http://change%28%27i1%27%29/

  • 8/9/2019 Differences Between Unicode and Non-Unicode Programs

    2/13

    • Offset and Lengt! Specifications in Unicode Programs

    • ccess to "emory Se#uences in Unicode Programs

    • Con$ersion of Structures in Unicode Programs

    • Structure Typing in Unicode Programs

    • Structure %n!ancements and Unicode Programs

    • String and &yte String Processing in Unicode Programs

    • 'unction "odule Calls in Unicode Programs

    • Open S(L in Unicode Programs

    • 'ile )nterface in Unicode Programs

    • Lists in Unicode Systems

    Comments and Literals in Non-Unicode Programs/( (o(+(i%o!e syste's, (o %hara%ters sho&l! )e &se! i( %o''e(ts &(less they are availa)le i( all %o!epages s&pporte! )y SAP /( the $orst %ase, a progra' %a( (o lo(ger )e e.e%&te! $he( a %o!e page othertha( the o(e i( $hi%h it $as %reate! is &se! We re%o''e(! the &sage o* 7BitASC//%hara%ters o(ly

    Note

    /( a +(i%o!e syste', all so&r%e %o!es are store! i( +(i%o!e a(! this is $hy this pro)le' !oes (ot o%%&r thereo$ever, eve( i( +(i%o!e progra's, !o (ot &se %hara%ters *or %o''e(ts a(! literals i* they %a((ot )e!isplaye! i( (o(+(i%o!e progra's, so that progra's %a( )e tra(sporte! *ro' a +(i%o!e syste' to a (o(+(i%o!e syste' $itho&t losses !&ri(g %o(versio(

    Names in Unicode Programs-(ly the *ollo$i(g %hara%ters are allo$e! i( (a'es i( +(i%o!e progra's

    1. T!e letters t!roug! .

    2.T!e digits / t!roug! 0

    3. Underscores 123

    or %o'pati)ility reaso(s, yo& %a( also &se the %hara%ters 4, , 6, , , a(! 8 )&t these sho&l! )e&se! o(ly i( e.%eptio( %ases 9*or e.a'ple, *or e.isti(g progra' ge(eratio(s: a(! $ith goo! ;&sti*i%atio(

  • 8/9/2019 Differences Between Unicode and Non-Unicode Programs

    3/13

    • )f c!aracters are used t!at are not a$ailable in all code page supported by SP4 it mig!t not be possible to run

    certain programs w!en using a different code page to t!e one in w!ic! t!ey were created,

    •  No string templates can be used in a non-Unicode program,

    Program Structure of Unicode ProgramsNo(a%%essi)le state'e(ts 9state'e(ts that are (ot assig(e! to a pro%essi(g )lo%#: lea! to a sy(ta. error i(+(i%o!e progra's /( (o(+(i%o!e progra's, at prese(t o(ly a sy(ta. $ar(i(g is iss&e!

    Oerand !yes in Unicode Programs-(e o* the 'ost i'porta(t !i**ere(%es )et$ee( +(i%o!e a(! (o(+(i%o!e progra's is the %lear !isti(%tio()et$ee( %hara%tertype !ata o);e%ts a(! )ytetype !ata o);e%ts, a(! the restri%tio( o* !ata types $hose o);e%ts%a( )e vie$e! as %hara%tertype "his has a( i(*l&e(%e o( all state'e(ts i( $hi%h %hara%tertype opera(!s aree.pe%te!, a(! i( parti%&lar o( %hara%ter stri(g a(! )yte stri(g pro%essi(g

    C"aracter-tye data ob#ects/( +(i%o!e progra's, o(ly the *ollo$i(g ele'e(tary !ata o);e%ts are (o$ %hara%tertype

    Data type Meaning

    c Te+t field

    d Date fieldn  Numerical te+t

    t Time field

    string Te+t string

    /( a!!itio(, str&%t&res are %hara%tertype i* they %o(tai( o(ly *lat %hara%tertype %o'po(e(ts 9o(ly %o'po(e(ts*ro' the a)ove ta)le $ith the e.%eptio( o* te.t stri(gs:

    /( +(i%o!e progra's, a str&%t&re %a( (o$ esse(tially o(ly )e &se! at a( opera(! positio( that e.pe%ts a si(gle*iel! i* the str&%t&re is %hara%tertype /t is the( ha(!le! i( the sa'e $ay as a !ata o);e%t o* type c

    /( (o(+(i%o!e progra's, all *lat str&%t&res a(! )ytetype !ata o);e%ts are also still ha(!le! as %hara%tertype!ata o);e%ts 9i'pli%it %asti(g:

    Note

    "he i(%orre%t &se o* str&%t&res at opera(! positio(s is greatly restri%te! i( +(i%o!e progra's or e.a'ple, astr&%t&re that %o(tai(s a (&'eri% %o'po(e(t %a( (o lo(ger )e &se! at a (&'eri% opera(! positio(

    Byte-tye data ob#ects/( +(i%o!e progra's, ele'e(tary !ata o);e%ts o* types x a(! xstring are )ytetype /( (o(+(i%o!eprogra's, !ata o);e%ts o* this type are ge(erally ha(!le! as %hara%tertype Co(versely, i( (o(+(i%o!eprogra's, at positio(s i( $hi%h )yte pro%essi(g ta#es pla%e 9SET BIT, GET BIT a(! the logi%al operators O,

  • 8/9/2019 Differences Between Unicode and Non-Unicode Programs

    4/13

    Z, M :, %hara%tertype !ata o);e%ts are still e.pe%te!, $hile i( +(i%o!e progra's o(ly )ytetype !ata o);e%ts areper'itte!

    Note

    /( +(i%o!e progra's, the storage o* )yte stri(gs i( %hara%tertype %o(tai(ers %a&ses pro)le's, as the )yteor!er  o* %hara%tertype !ata o);e%ts i( +(i%o!e syste's is plat*or' !epe(!e(t /( (o(+(i%o!e syste's, thiso(ly applies *or !ata o);e%ts o* (&'eri% !ata types "he %o(te(t o* the !ata o);e%ts is i(terprete! i(%orre%tly i* a

    %o(tai(er o* this type is store! persiste(tly a(! is the( i'porte! to a( appli%atio( server $ith a !i**ere(t )ytese>&e(%e

    Alignment in Unicode Systems/( +(i%o!e syste's, i( a!!itio( to alig('e(t re>&ire'e(ts *or (&'eri% !ata o);e%ts o* types i, decfloat16,

    decfloat34, f, s, a(! o* !eep !ata o);e%ts, all %hara%terli#e !ata types are also a**e%te! "he alig('e(t is!eter'i(e! )y the le(gth re>&ire'e(t o* a %hara%ter i( the 'e'ory

     As a %o(se>&e(%e, i( str&%t&res $ith %o'po(e(ts o* !i**ere(t !ata types, the alig('e(t gaps i( +(i%o!esyste's 'ay )e !i**ere(t to those i( (o( +(i%o!e syste's or e(ha(%e'e(ts )et$ee( str&%t&res, the+(i%o!e *rag'e(t vie$ %o(%ept has )ee( i(tro!&%e!, $hi%h !ivi!es a str&%t&re i(to *rag'e(ts a%%or!i(g to itsalig('e(t gaps

    Note

     Alig('e(t gaps %a( also o%%&r at the e(! o* str&%t&res, as the overall le(gth o* the str&%t&re is !eter'i(e! )ythe %o'po(e(t $ith the largest alig('e(t re>&ire'e(t

    $%amle

    /( the *ollo$i(g str&%t&re, alig('e(t gaps 9A: o%%&r i( +(i%o!e syste's that are (ot prese(t i( (o(+(i%o!esyste's "he *irst alig('e(t gap is *or'e! as a res&lt o* the alig('e(t o* the s&)str&%t&re struc2, the se%o(!!&e to the alig('e(t o* the %o'po(e(t c o* type c> , a(! the thir! is !&e to the %o'po(e(t d  o* type i

    !T!"BEGI# O$ struc1%a T&'E x (E#GT) 1%BEGI# O$ struc2% * T&'E x (E#GT) 1%c T&'E c (E#GT) 6%

    E# O$ struc2%d T&'E i%

    E# O$ struc1+

    Non-Unicode system [ a | b | cccccc | dddd ] 

    Unicode system [ a | A | b | A | cccccccccccc | AA | dddd ] 

    Offset and Lengt" Secifications in Unicode Programs-**set=le(gth spe%i*i%atio(s are 'a!e )y appe(!i(g ,-off.,/len0. to the (a'e o* a !ata o);e%t i( opera(!positio(, a(! the spe%i*i%atio(s are &se! to a%%ess s&)areas o* a !ata o);e%t "his type o* progra''i(g is (olo(ger %o'pletely possi)le i( +(i%o!e syste's )e%a&se, *or e.a'ple $he( a%%essi(g str&%t&res $ith

  • 8/9/2019 Differences Between Unicode and Non-Unicode Programs

    5/13

    %o'po(e(ts o* !i**ere(t !ata types, it is (ot possi)le to !e*i(e $hether o**set a(! le(gth sho&l! )e spe%i*ie! i(%hara%ters or )ytes &rther'ore, restri%tio(s have )ee( i(tro!&%e! that *or)i! a%%ess to 'e'ory areas o&tsi!eo* *lat !ata o);e%ts

    Offset&Lengt" Secifications for $lementary Data Ob#ects-**set=le(gth spe%i*i%atio(s are per'itte! *or %hara%terli#e !ata o);e%ts a(! )yteli#e !ata o);e%ts "he

    spe%i*i%atio( o* o**set a(! le(gth is i(terprete! either as a (&')er o* %hara%ters or as a (&')er o* )ytes "her&les that !eter'i(e $hi%h !ata o);e%ts i( +(i%o!e progra's %o&(t as %hara%terli#e or )yteli#e o);e%ts !o (otallo$ *or o**set=le(gth spe%i*i%atio(s *or !ata o);e%ts o* (&'eri% !ata types

    Note

    "he 'etho! o* &si(g !ata o);e%ts o* type c as %o(tai(ers *or stori(g str&%t&res o* !i**ere(t types, $hi%h areo*te( (ot #(o$( &(til r&(ti'e, i( $hi%h %o'po(e(ts are a%%esse! &si(g o**set=le(gth a%%ess, is (o lo(gerpossi)le i( +(i%o!e progra's /(stea! o* these %o(tai(ers, the state'e(t E!TE !T!  %a( )e &se! toge(erate !ata o);e%ts o* a(y str&%t&re "o e(a)le a%%ess to e.isti(g %o(tai(ers, these %a( )e assig(e! to a*iel! sy')ol &si(g the !STI#G a!!itio( o* the state'e(t !SSIG# "he OM'O#E#T a!!itio( %a( the( )e &se!to a%%ess %o'po(e(ts

    Offset&Lengt" Secifications for Structures A( o**set=le(gth spe%i*i%atio( *or a str&%t&re is o(ly per'itte! i( +(i%o!e syste's i* the str&%t&re is either

    • c!aracter-li*e 1meaning it only contains flat c!aracter-li*e components34 or it is

    • flat4 !as a c!aracter-li*e initial fragment according to t!e Unicode fragment $iew4 and t!e offset5lengt!

    specification accesses t!is initial fragment,

    /( )oth %ases, the spe%i*i%atio( o* o**set a(! le(gth is i(terprete! as a (&')er o* %hara%ters

    $%amle

    "he *ollo$i(g str&%t&re has )oth %hara%terli#e a(! (o(%hara%terli#e %o'po(e(ts

    !T!"BEGI# O$ struc%a T&'E c (E#GT) 3% (engt 3 caracters * T&'E n (E#GT) 4% (engt 4 caracters

    c T&'E d% (engt 5 caractersd T&'E t% (engt 6 caracterse T&'E decfloat16% (engt 5 *tesf T&'E c (E#GT) 25% (engt 25 caractersg T&'E x (E#GT) 2% (engt 2 *tes

    E# O$ struc+

    "he +(i%o!e *rag'e(t vie$ splits the str&%t&re i(to *ive areas, 1 5

    [ aaa | bbbb | cccccccc | ddd | AAA | eeee | fffffffffffff | gg ]

    [ F1 | F2 | F3 | F4 | F5 ] 

    -**set=le(gth a%%ess is o(ly possi)le *or the %hara%terli#e i(itial *rag'e(t F1 Spe%i*i%atio(s s&%h asstruc/210 or struc-7/140 are a%%epte! a(! are ha(!le! as a si(gle *iel! o* type c A( a%%ess s&%h asstruc-87/20, *or e.a'ple, is (ot per'itte! i( +(i%o!e syste's

    Offset&Lengt" Secifications for Actual Parametersor a%t&al para'eters spe%i*ie! i( 'E$OM , i( +(i%o!e progra's, it is (ot possi)le to spe%i*y a 'e'ory areao&tsi!e o* the a%t&al para'eter &si(g o**set=le(gth spe%i*i%atio(s /( parti%&lar, it is (o lo(ger possi)le to spe%i*ya( o**set $itho&t a le(gth, as this $o&l! i'pli%itly set the le(gth o* the a%t&al para'eter

    Offset&Lengt" Secification for 'ield Symbols

  • 8/9/2019 Differences Between Unicode and Non-Unicode Programs

    6/13

    Whe( assig(i(g a 'e'ory area to a *iel! sy')ol &si(g the !SSIG# state'e(t, i( +(i%o!e progra's it is (o$o(ly possi)le to &se o**set=le(gth spe%i*i%atio(s to a%%ess the 'e'ory $ithi( the !ata o);e%t "he a!!itio(!#GE !e*i(es the !ata o);e%t

    iel! sy')ols the'selves are also allo%ate! a( assig(a)le 'e'ory area "his is e**e%tive i* a *iel! sy')ol is&se! as a so&r%e i( the !SSIG# state'e(t

    /( (o(+(i%o!e progra's, the assig(a)le area is !e*i(e! )y the !ata area o* the %&rre(t progra', $hi%h %a(

    lea! to re*ere(%es )ei(g over$ritte(

    /* a !ata o);e%t is e(tere! as a so&r%e i( !SSIG#, (o o**set %a( )e spe%i*ie! $itho&t a le(gth &(less the e.pli%it!#GE a!!itio( is spe%i*ie! -ther$ise, this $o&l! i'pli%itly set the le(gth o* the !ata o);e%t /* the (a'e o* a*iel! sy')ol is spe%i*ie!, its !ata type i( +(i%o!e progra's '&st )e *lat a(! ele'e(tary i* a( o**set is spe%i*ie!$itho&t a le(gth

    Note

    Previo&sly, %ross*iel! o**set=le(gth a%%esses %o&l! )e &se*&lly i'ple'e(te! i( the !SSIG# state'e(t *orpro%essi(g repeati(g gro&ps i( str&%t&res /( or!er to e(a)le this i( +(i%o!e syste's, the !SSIG# state'e(thas )ee( e(ha(%e! $ith the a!!itio(s !#GE a(! I#EME#T

    Access to (emory Se)uences in Unicode Programs"he *ollo$i(g 9o)solete: state'e(ts a%%ess !ata o);e%ts that are store! i( the 'e'ory as a( e>&ally spa%e!se>&e(%e

    • DO ... VARYING

    • WHILE ... VARY

    • ADD ... THEN ... UNTIL

    • ADD ... FROM ... TO

    /( the O a(! 9)I(E loops i( +(i%o!e progra's, all !ata o);e%ts o* the se>&e(%e '&st )e %o'pati)le a(!either )e str&%t&re %o'po(e(ts that )elo(g to the sa'e str&%t&re, or s&)areas o* the sa'e !ata o);e%tspe%i*ie! &si(g o**set=le(gth spe%i*i%atio(s /( +(i%o!e progra's, a !#GE '&st also )e e(tere! i* it %a((ot )estati%ally re%og(i?e! that the !ata o);e%ts i(volve! are %o'po(e(ts o* the sa'e str&%t&re -ther$ise, theper'itte! 'e'ory area is !eter'i(e! *ro' the s'allest possi)le s&)str&%t&re

    Whe( 'e'ory se>&e(%es are a!!e! &si(g !, i( +(i%o!e progra's, all !ata o);e%ts o* the se>&e(%e '&st)e %o'po(e(ts o* a str&%t&re /* this %a((ot )e stati%ally re%og(i?e! i( the sy(ta. %he%#, a str&%t&re '&st )espe%i*ie! &si(g the a!!itio( !#GE

    Con*ersion of Structures in Unicode Programs"he 'ost i'porta(t !i**ere(%es )et$ee( the )ehaviors o* +(i%o!e progra's a(! (o(+(i%o!e progra's arethe %ha(ge! %o(versio( r&les *or str&%t&res *or assig('e(ts a(! *or %o'pariso(s

    Note

  • 8/9/2019 Differences Between Unicode and Non-Unicode Programs

    7/13

    "$o str&%t&res i( +(i%o!e progra's are o(ly %o'pati)le $he( all alig('e(t gaps are i!e(ti%al o( all plat*or's"his applies i( parti%&lar *or alig('e(t gaps that are %reate! )y i(%l&!e! str&%t&res 9I#(:E:

    Assignments Between 'lat Structures/( (o(+(i%o!e progra's, i(%o'pati)le *lat str&%t&res are treate! as !ata o);e%ts o* the type c, $hereas i(+(i%o!e progra's, %o(versio( r&les apply $hi%h assig( the 'ost i'porta(t role to the +(i%o!e *rag'e(t vie$ 

    o* the str&%t&res

    Assignments Between 'lat Structures and Single 'ieldsNo(+(i%o!e progra's al$ays ha(!le *lat str&%t&res as !ata o);e%ts o* the type c $he( assig(i(g *ro' a(! toele'e(tary !ata o);e%ts /( +(i%o!e progra's, ho$ever, a %o(versio( r&le applies, stati(g that the str&%t&re'&st )e %hara%terli#e 9at the very least i( its i(itial *rag'e(t:

    Comarisons Between +ncomatible 'lat Structures As is the %ase $ith assig('e(ts, the str&%t&res are (ot ha(!le! as c *iel!s, )&t i( a%%or!a(%e $ith their+(i%o!e *rag'e(t vie$ 9see Co'pariso( R&les Bet$ee( -pera(!s:

    Comarisons Between 'lat Structures and Single 'ields As is the %ase $ith assig('e(ts, the syste' %he%#s $hether the str&%t&re is %hara%terli#e, at the very least i(

    its i(itial *rag'e(t 9see Co'pariso( -perators *or All @ata "ypes:

    Structure !ying in Unicode Programsor !o$($ar! %o'pati)ility reaso(s, a str&%t&re %a( still )e %ast *or *iel! sy')ols a(! para'eters o* *&(%tio('o!&les a(! s&)ro&ti(es &si(g the o)solete a!!itio( ST:T:E

    Whe( assig(i(g a !ata o);e%t to s&%h a *iel! sy')ol or passi(g a( a%t&al para'eter to s&%h a *or'al

    para'eter, i( (o(+(i%o!e progra's, the syste' o(ly %he%#s $hether the le(gth o* the !ata o);e%t or a%t&alpara'eter has at least the le(gth o* the str&%t&re a(! $hether the alig('e(t is i!e(ti%al at r&(ti'e +(i%o!eprogra's 'a#e a !i**ere(%e )et$ee( str&%t&re! a(! ele'e(tary !ata o);e%ts or a%t&al para'eters or astr&%t&re! !ata o);e%t or a%t&al para'eter, its +(i%o!e *rag'e(t vie$ '&st 'at%h the %ast str&%t&re i(%l&!i(gall alig('e(t gaps 9i(%l&!i(g the %losi(g o(es: /( a!!itio(, a( ele'e(tary !ata o);e%t or a%t&al para'eter '&st)e %hara%terli#e a(! *lat

    Whe( a *or'al para'eter o* a *&(%tio( 'o!&le is type! $ith a *lat str&%t&re &si(g (I;E i(stea! o* T&'E, (I;E has the sa'e e**e%t as ST:T:E o$ever, the syste' %he%#s the e.a%t le(gth $he( passi(g thepara'eters i( (o(+(i%o!e progra's

    Note

    "he %he%# o* the +(i%o!e *rag'e(t vie$ %a( avoi! pro)le's that o%%&r i( (o(+(i%o!e syste's !&e to %losi(galig('e(t gaps "his %a( i(%l&!e the (o(type%o'plia(t *illi(g o* a%t&al para'eters $ith the %o(te(t o* a(

    alig('e(t gap

    Structure $n"ancements and Unicode Programs

  • 8/9/2019 Differences Between Unicode and Non-Unicode Programs

    8/13

     ABAP @i%tio(ary str&%t&res a(! !ata)ase ta)les that are !elivere! )y SAP %a( )e e(ha(%e! &si(g %&sto'i?i(gi(%l&!es or appe(! str&%t&res "hese types o* %ha(ges %a&se pro)le's i( +(i%o!e progra's i* thee(ha(%e'e(ts %ha(ge the +(i%o!e *rag'e(t vie$

    or this reaso(, the optio( to %lassi*y str&%t&res a(! !ata)ase ta)les $as i(tro!&%e!, $hi%h 'a#es it possi)leto re%og(i?e a(! ha(!le pro)le's relate! to str&%t&re e(ha(%e'e(ts "his %lassi*i%atio( is &se! !&ri(g i( theprogra' %he%# to %reate a $ar(i(g at all poi(ts $here the progra' $or#s $ith str&%t&res, a(! $here later

    str&%t&re e(ha(%e'e(ts %a( %a&se sy(ta. errors or %ha(ges i( progra' )ehavior Whe( yo& !e*i(e a str&%t&reor a !ata)ase ta)le i( ABAP @i%tio(ary, yo& %a( spe%i*y the e(ha(%e'e(t %ategories that are !isplaye! i( the*ollo$i(g ta)le as %lassi*i%atio(

    Lee! "ateg#ry Meaning

    6 Unclassified T!e structure does not !a$e an en!ancement category,

    7 Cannot be en!anced T!e structure must not be en!anced,

    8 Can be en!anced and c!aracter-li*ell structure components and t!eir en!ancements must be c!aracter-li*e

    and flat,

    9Can be en!anced and c!aracter-li*e or

    numericll structure components and t!eir en!ancements must be flat,

    : Can be en!anced in any wayll structure components and t!eir en!ancements can !a$e any data

    type,

    "he $ar(i(gs !isplaye! a*ter the progra' %he%# are %lassi*ie! i(to three levels *ro' the *ollo$i(g ta)le,!epe(!i(g o( the %o(se>&e(%es o* the per'itte! str&%t&re e(ha%e'e(ts

    Lee! Type #$ "%ec& Meaning

    Synta+ c!ec*  n en!ancement t!at fully utili;es t!e en!ancement category of t!e structure in #uestion leads to a

    synta+ error,

    & %+tended c!ec* Permitted en!ancements can lead to a synta+ errors4 but not always,

    C %+tended c!ec*  Permitted en!ancements cannot lead to synta+ errors4 alt!oug! c!anges to program be!a$ior do

    result in semantic problems,

    $%amle

    /* the str&%t&re ddic

  • 8/9/2019 Differences Between Unicode and Non-Unicode Programs

    9/13

    /( +(i%o!e progra's, %hara%ter stri(g a(! )yte stri(g pro%essi(g are stri%tly separate! "he opera(!s o*%hara%ter stri(g pro%essi(g '&st )e %hara%terli#e !ata o);e%ts, a(! opera(!s i( )yte stri(g pro%essi(g '&st)e )yteli#e !ata o);e%ts /( (o(+(i%o!e progra's, )yte stri(gs are (or'ally ha(!le! i( the sa'e $ay as%hara%ter stri(gs

    Syntactic Searation

    Statements for C"aracter String and Byte String Processing/( the state'e(ts *or %hara%ter stri(g a(! )yte stri(g pro%essi(g, i( +(i%o!e progra's, the !isti(%tio( is 'a!ei( the state'e(ts that are i(te(!e! *or )oth types o* pro%essi(g )y the optio(al a!!itio( I# )!!TE=B&TE MOE /( this %ase, I# )!!TE MOE is the !e*a&lt

    Note

    "he a!!itio( I# )!!TE=B&TE MOE is also &se! i( the state'e(ts *or !eter'i(i(g le(gth a(! o**set

    • DE1"RI2E FIELD ... LENGTH

    • DE1"RI2E DI1TAN"E

    /( this %ase, the spe%i*i%atio(s are 'a(!atory

    ,elational Oerators for C"aracter Strings and Byte StringsRelatio(al operators e.ist )oth *or %hara%ter stri(gs a(! *or )yte stri(gs /( +(i%o!e progra's, the latter %a( (olo(ger )e &se! *or )yte stri(gs

    'unctions for C"aracter Strings and Byte Strings"he !es%riptio( *&(%tio(s are !ivi!e! i(to !es%riptio( *&(%tio(s *or %hara%ter stri(gs a(! !es%riptio( *&(%tio(s*or )yte stri(gs /( parti%&lar, i( +(i%o!e progra's, strlen %a( (o$ o(ly )e &se! *or %hara%terli#e arg&'e(ts,$hile xstrlen is availa)le *or )yteli#e arg&'e(ts

    'unction (odule Calls in Unicode Programs/( +(i%o!e progra's, a ha(!lea)le e.%eptio( is raise! i( a ge(eral *&(%tio( 'o!&le %all i* a( i(%orre%t *or'alpara'eter is spe%i*ie! a(! the (a'e o* the *&(%tio( 'o!&le is spe%i*ie! &si(g a %o(sta(t or as a literal /* the(a'e o* the *&(%tio( 'o!&le is spe%i*ie! )y a varia)le, a(! i( (o(+(i%o!e progra's, the spe%i*i%atio( o* a(i(%orre%t *or'al para'eter is ig(ore!

    Oen SL in Unicode ProgramsWhe( $or# areas are &se! i( -pe( S state'e(ts, i( (o(+(i%o!e progra's, their str&%t&re is (ot ta#e( i(toa%%o&(t -(ly the le(gth a(! the alig('e(t are %he%#e!

    /( +(i%o!e progra's, *or str&%t&re! $or# areas the +(i%o!e *rag'e(t vie$ '&st )e %orre%t, a(! ele'e(tary$or# areas '&st )e %hara%tertype

  • 8/9/2019 Differences Between Unicode and Non-Unicode Programs

    10/13

    !"e 'ile +nterface in Unicode ProgramsSi(%e the %o(te(t o* *iles *re>&e(tly re*le%ts the str&%t&re o* !ata i( the $or#i(g 'e'ory, the *ile i(ter*a%e i( a

    +(i%o!e syste' '&st *&l*ill the *ollo$i(g re>&ire'e(ts

    • )t must be possible to e+c!ange data between Unicode and non-Unicode systems,

    • )t must be possible to e+c!ange data between different Unicode systems,

    • )t must be possible to e+c!ange data between different non-Unicode systems t!at use different code pages,

    or this reaso(, i( +(i%o!e progra's, yo& '&st al$ays !e*i(e the %o!e page &se! to e(%o!e the %hara%tertype !ata that is $ritte( i( te.t *iles or that is rea! *ro' te.t *iles

    additions=

    o IN+UT3OUT+UT3A++ENDING3U+DATE

    o >L%?C@A &)NB@T%T "OD%

    must be specified,

    )n non-Unicode programs4 if not!ing is entered4 a file is opened wit! implicit standard settings,

    • )f a file is opened for reading4 t!e content can only be read, )n non-Unicode programs4 it is also possible to gain

    write access to t!ese files,

    • )f a file is opened as a te+t file4 only t!e content of c!aracter-type data obEects can be read or written, )n non-

    Unicode programs4 byte-type and numeric data obEects are also allowed,

    Note

    /( +(i%o!e progra's, *ile (a'es %a( also %o(tai( )la(# %hara%ters

    Lists in Unicode Systems

    +ntroduction A 9ITE state'e(t $rites the %o(te(t o* !ata o);e%ts to a list Whe( !ata is $ritte( $ith a 9ITE state'e(t,the o&tp&t is store! i( the list )&**er  a(! a%%esse! *ro' there *or !isplay $he( the list is %alle!

  • 8/9/2019 Differences Between Unicode and Non-Unicode Programs

    11/13

    a%h ti'e a !ata o);e%t is pro!&%e! )y 9ITE, the syste' !e*i(es a( o&tp&t le(gth either i'pli%itly or e.pli%itlyDthe i'pli%it o&tp&t le(gth !epe(!s o( the !ata type "he o&tp&t le(gth !e*i(es the *ollo$i(g t$o attri)&tes

    •  Number of positions or memory spaces a$ailable for c!aracters in t!e list buffer 

    •  Number of columns or cells a$ailable in t!e actual list

    /* the o&tp&t le(gth is shorter tha( the le(gth o* the !ata o);e%t, the syste' shorte(s its %o(te(t a%%or!i(g to%ertai( r&les $he( $riti(g the !ata to the list )&**er A(y val&es lost i( (&'eri% *iel!s are i(!i%ate! )y a

    Whe( !isplayi(g or pri(ti(g a list, the %o(te(t store! i( the list )&**er is tra(s*erre! to the list as *ollo$s

    • )n non-Unicode systems4 eac! c!aracter occupies t!e same amount of space in t!e list buffer as it re#uires

    columns in t!e list, )n single-byte systems4 a c!aracter occupies one byte in t!e list buffer and one column in t!e

    list4 w!ile a c!aracter t!at occupies se$eral bytes in t!e list buffer in multi-byte systems also occupies t!e same

    number of columns in t!e list, 'or t!is reason4 all t!e c!aracters stored in t!e list buffer are displayed in t!e list in

    non-Unicode systems,

    • )n Unicode systems4 e$ery c!aracter usually occupies one place in t!e list buffer, Fowe$er4 a c!aracter can also

    occupy more t!an one column4 as is t!e case for %astern sian c!aracters, Fowe$er4 since t!e list only contains

    t!e same number of columns as t!ere are positions in t!e list buffer4 t!e number of c!aracters t!at can be

    displayed in t!e list is smaller t!an t!e number of c!aracters stored in t!e list buffer in t!is case, List output is

    s!ortened accordingly4 wit! t!e page formatted according to t!e specified alignment and mar*ed wit! t!ec!aracters G or H, @ou can t!en only display t!e entire content of t!e list by c!oosing t!e menu pat! System →

     List → Unicode Display,

    or this reaso(, the hori?o(tal positio( o* the list %&rsor  o(ly has the sa'e 'ea(i(g as the o&tp&t %ol&'( i( alist !isplaye! or pri(te! i( (o(+(i%o!e syste's /( +(i%o!e syste's, this is o(ly g&ara(tee! *or the top a(!)otto' o&tp&t li'its

    ,ules for .,+!$ Statements"o avoi! %&tti(g o** val&es &(i(te(tio(ally as *ar as possi)le, the r&les *or 9ITE state'e(ts i( +(i%o!eprogra's have )ee( 'o!i*ie! a(! e.te(!e!

    Oerands in t"e .,+!$ Statement/* the !ata o);e%t spe%i*ie! i( 9ITE is a *lat str&%t&re4 this '&st )e p&rely %hara%terli#e i( +(i%o!e progra's

    Note

    "his also applies *or the state'e(t 9ITE TO, i( $hi%h the target *iel! '&st also )e %hara%terli#e

    .,+!$ Statements wit" +mlicit Outut Lengt"/( +(i%o!e progra's, 9ITE state'e(ts $itho&t a( e.pli%itly spe%i*ie! o&tp&t le(gth *or all !ata o);e%ts e.%eptte.t *iel! literals a(! !ata o);e%ts o* the type string )ehave i( the sa'e $ay as i( (o(+(i%o!e progra's"his 'ea(s *e$er %hara%ters 'ay )e !isplaye! i( the list tha( are store! i( the list )&**er

    /( the %ase o* te.t *iel! literals a(! !ata o);e%ts o* the type string, the syste' ass&'es that all %hara%ters areto )e !isplaye! or this reaso( the i'pli%it o&tp&t le(gth is %al%&late! &si(g the %hara%ters %o(tai(e! i( the!ata o);e%t so that it %orrespo(!s to the (&')er o* %ol&'(s (ee!e! i( the list /* this o&tp&t le(gth is greatertha( the le(gth o* the !ata o);e%t, s&rpl&s positio(s are *ille! $ith )la(#s $he( the !ata is $ritte( to the list

    )&**er Whe( !isplayi(g the !ata i( the list, the syste' re'oves these )la(#s, si(%e the %hara%terreprese(tatio( *ills the o&tp&t le(gth e.a%tly

    .,+!$ Statements wit" $%licit Outut Lengt"/* a (&'eri% !ata o);e%t is spe%i*ie! as a( e.pli%it o&tp&t le(gth a*ter the !T a!!itio( *or a 9ITE state'e(t, theval&e o* this (&')er is &se! as the o&tp&t le(gth, )oth i( +(i%o!e a(! (o(+(i%o!e syste's /( +(i%o!esyste's, the (&')er o* %hara%ters !isplaye! i( the list %a( !i**er *ro' the (&')er o* %hara%ters store! i( thelist )&**er

  • 8/9/2019 Differences Between Unicode and Non-Unicode Programs

    12/13

    2.

    1. )n data obEects of t!e types c and string4 t!e output lengt! is set to t!e number of columns re#uired to

    display t!e entire content in t!e listI closing blan*s are ignored for type c, )n t!e case of data obEects of t!e

    type string4 t!is !as t!e same meaning as t!e implicit lengt!,

    2. )n data obEects of t!e types d and t4 t!e output lengt! is set to 6/ and J,

    3. )n data obEects of t!e numeric types i4 $ 4 and p4 t!e output lengt! is set to t!e $alue re#uired to display t!ecurrent $alue including t!ousand separators, T!is rule is applied to t!e $alue after any "URREN"Y4

    DE"IMAL14 NO61IGN4 ROUND4 or UNIT !a$e been used,

    4. T!e implicit output lengt! is used for data obEects of t!e types n4 74 and 7string,

    3. WRITE AT /550 ... 

    4.

    1. )n data obEects of t!e type c4 t!e output lengt! is set to twice t!e lengt! of t!e data obEect4 and in data obEects

    of t!e type string4 to twice t!e number of c!aracters contained in t!e obEect,

    2. )n data obEects of t!e types d and t4 t!e output lengt! is set to 6/ and J,

    3. )n data obEects of t!e numeric types i4 $ 4 and p4 t!e output lengt! is set to t!e $alue re#uired in order todisplay t!e ma+imum possible $alues for t!ese types4 including plus and minus signs and t!ousands

    separators, T!is rule is applied to t!e $alue after any "URREN"Y4 DE"IMAL14 NO61IGN4 ROUND4 or

    UNIT additions !a$e been used,

    4. T!e implicit output lengt! is used for data obEects of t!e types n4 74 and 7string,

    "he )ehavior o* the o&tp&t le(gths /0 a(! /0 $he( &si(g the a!!itio( :SI#G EIT M!S;  a(! thete'plates *or !ate *iel!s is !es%ri)e! i( or'atti(g -ptio(s

    Additions for /$!&S$! CU,SO, '+$LD&L+N$"he a!!itio(s IS'(!& O$$SET a(! MEMO& O$$SET ta#e a%%o&(t o* the *a%t that !ata o);e%ts %a( o%%&py!i**ere(t le(gths $he( !isplaye! i( a list a(! $he( store! te'porarily i( the list )&**er

    /( a%%or!a(%e $ith this *a%t, the a!!itio( IS'(!& O$$SET off positio(s the %&rsor i( the %ol&'( i( the

    o&tp&t area spe%i*ie! i( off *or the SET :SO ? $IE( f = (I#E l @ state'e(t "he a!!itio( MEMO&O$$SET off positio(s the %&rsor o( the %hara%ter i( the o&tp&t area that is lo%ate! i( the positio( 9o* the !atao);e%t i( f: i( the list )&**er spe%i*ie! i( off

    /( the sa'e $ay, a GET :SO ? $IE( f = (I#E l @ state'e(t &se! $ith the a!!itio( IS'(!&O$$SET off pla%es the %&rsor positio( i( the o&tp&t area i( the !ata o);e%t off Whe( yo& &se the a!!itio( MEMO& O$$SET off, the %&rsor positio( i( the list )&**er that is assig(e! to the %hara%ter !isplaye! is pla%e!

    i( the !ata o);e%t off "he IS'(!& a!!itio( is the !e*a&lt a(! %a( )e le*t o&t

    Class for 'ormatting ListsClass CEABAPE/S"E+"//"/S has )ee( i(tro!&%e! to %al%&late o&tp&t le(gths, %o(vert val&es *ro' the list)&**er, a(! !e*i(e *iel! li'its "he ret&r( %o!es o* the 'etho!s o* this %lass %a( )e &se! to progra' a %orre%t%ol&'( alig('e(t i( ABAP lists, eve( *or o&tp&t o* aster( Asia( %hara%ters

    List Settings"he o);e%ts i( a list %a( )e !isplaye! i( !i**ere(t o&tp&t le(gths )y spe%i*yi(g the !esire! le(gth i( the 'e(&&(!er System → List → Unicode Display  "his is parti%&larly a!va(tageo&s *or s%ree( lists i( +(i%o!e syste's $here the o&tp&t is %&t o** as i(!i%ate! )y the %hara%ters F or

    ,ecommendationsWe re%o''e(! that yo& a!here to the *ollo$i(g r&les $he( progra''i(g lists, to e(s&re that they have thesa'e appeara(%e a(! *&(%tio(s )oth i( +(i%o!e a(! (o(+(i%o!e syste's

  • 8/9/2019 Differences Between Unicode and Non-Unicode Programs

    13/13

    • Specify an ade#uate output lengt!

    • Do not o$erwrite parts of a field

    • Do not use t!e additions RIGHT68U1TIFIED or "ENTERED for WRITE TO if t!is statement is followed by

    list output wit! WRITE,

    • )n customer-programmed !ori;ontal scrolling wit! a 1"ROLL statement4 you s!ould only specify t!e upper orlower limit of data obEects displayed4 since t!e positions in t!e list buffer and in t!e list displayed are only certain

    to matc! for t!ese field limits in Unicode systems,