Example: marketing

MAKING ABAP PROGRAMS UNICODE ENABLED - …

SAP TECHED 05 MAKING abap PROGRAMS UNICODEENABLEDSPC250 EXERCISES / ,NETWEAVERDEVELOPMENTTOOLSINTERNATIONALI ZATION,SAPAGSAP TECHED 051 ContentsExercise Description : MAKING your own abap PROGRAMS UNICODE ENABLED .. 2 Part I : Using UCCHECK to remove static UNICODE syntax errors .. 2 Part II: Find critical places with 2 Part III: Using SCOV to screen runtime 2 Part IV: Look at the abap list layout .. 2 Listings: Exercises .. 4 Exercise 1 .. 4 Exercise 2 .. 5 Exercise 3 .. 6 Exercise 4 .. 7 Exercise 5 .. 9 Exercise 6 .. 10 Exercise 7 .. 15 Exercise 8 .. 20 Exercise 9 .. 22 Exercise 10 .. 23 Listings: 24 Solution - Exercise 1 .. 24 Solution - Exercise 2 .. 25 Solution - Exercise 3 .. 26 Solution - Exercise 4 .. 27 Solution - Exercise 5.

SAP TECHED ’05 SEPTEMBER 2005 2 EXERCISE DESCRIPTION: MAKING YOUR OWNABAPPROGRAMSUNICODEENABLED The programs you have to inspect are ZTECHED_UNICODE_EXERCISE_n_XX where n are the numbers 1 to 10 …

Tags:

  Programs, Making, Abap, Enabled, Unicode, Making abap programs unicode enabled

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of MAKING ABAP PROGRAMS UNICODE ENABLED - …

1 SAP TECHED 05 MAKING abap PROGRAMS UNICODEENABLEDSPC250 EXERCISES / ,NETWEAVERDEVELOPMENTTOOLSINTERNATIONALI ZATION,SAPAGSAP TECHED 051 ContentsExercise Description : MAKING your own abap PROGRAMS UNICODE ENABLED .. 2 Part I : Using UCCHECK to remove static UNICODE syntax errors .. 2 Part II: Find critical places with 2 Part III: Using SCOV to screen runtime 2 Part IV: Look at the abap list layout .. 2 Listings: Exercises .. 4 Exercise 1 .. 4 Exercise 2 .. 5 Exercise 3 .. 6 Exercise 4 .. 7 Exercise 5 .. 9 Exercise 6 .. 10 Exercise 7 .. 15 Exercise 8 .. 20 Exercise 9 .. 22 Exercise 10 .. 23 Listings: 24 Solution - Exercise 1 .. 24 Solution - Exercise 2 .. 25 Solution - Exercise 3 .. 26 Solution - Exercise 4 .. 27 Solution - Exercise 5.

2 29 Alternative Solution - Exercise 5 .. 31 Solution - Exercise 6 .. 32 Solution - Exercise 7 .. 37 Solution - Exercise 8 .. 42 Solution a) - Exercise 9 .. 44 Solution b) - Exercise 9 .. 45 Solution Exercise 47 SAP TECHED 05 SEPTEMBER20052 EXERCISEDESCRIPTION : MAKING YOUR OWNABAPPROGRAMSUNICODEENABLEDThe PROGRAMS you have to inspect are ZTECHED_UNICODE_EXERCISE_n_XX where n are the numbers 1 to 10 and XX indicatesthe two digit group number. Please don t touch the original exercise patterns solutions are found in the PROGRAMS TECHED_UNICODE_SOLUTION_n.(You may find the exercises and solutions in any SAP system based on release SAP_BASIS or higher).Part I : Using UCCHECK to remove static UNICODE syntax errorsxLogon to the non- UNICODE systemxInspect the PROGRAMS ZTECHED_UNICODE_EXERCISE_1/2/3/4/5_XX using the transaction all static UNICODE errors and set the UNICODE for the exercise:9In the object selection uncheck the option Exclude $* Packages Part II: Find critical places with UCCHECKxLogon to the non- UNICODE systemxRun the program ZTECHED_UNICODE_EXERCISE_6_XX, check for static errors with UCCHECK and set the to rerun the the program with the UCCHECK option statically not analyzable places.

3 XRemove warnings by properly typing parameters and UNICODE runtime for the exercise:9 Use #EC * to hide warnings from places that cannot be removed by proper generic types for the subroutine III: Using SCOV to screen runtime testsxLogon to the UNICODE systemxLook in the Coverage Analyzer (transaction SCOV) for the list of processing blocks of programZTECHED_UNICODE_EXERCISE_7_XXxExe cute the program several times and look in the Coverage Analyzer for the coverage of the different processing the errors in form F100 and for the exercise:9If you want to cover all subroutines, you should look at the program coding with the debugger. It is just a simple you don t want to spend too much time, try the following number combinationso0/0; 0/1; 1/0/1/0; 1/0/1/1; 1/19 Finally, try the following paths:o1/0/42 ( UNICODE error, visible only in a UNICODE system)o1/13 (Data dependent error, not UNICODE specific)Part IV: Look at the abap list layoutxLogon to the UNICODE systemxExecute the PROGRAMS ZTECHED_UNICODE_EXERCISE_8/9/10_XX.

4 Find and understand the pitfalls of the shown listprogramming the TECHED 05 SEPTEMBER20053 Technical information:The exercises are based on the following Releases/Patchlevels Minimum: basis UNICODE system Support Package >=21, Kernel Patch level >= 401 Minimum: Basis non UNICODE system Support Package >=21, Kernel Patch level >= 401, Konfiguration as MDMP System (RSCPINST) with at leastGerman, Japanese, Korean and English Locale installed Minimum: SAPGUI Users were created with transaction BC_TOOLS_USER The coverage analyzer is switched on activate data collection at SCOV Administration On/Off, Status Switch Coverage Analyzer On/Off, Button On . Before the Data Collection: Bckgrd Server has been maintained at SCOV Administration Settings In order to show and experiment with multilangual data you may create a table with the fields COLOR,/SPRAS/NAME with the types CHAR 1 / LANG 1 /CHAR 6 and fill the table with report RSCPCOLORS.

5 This may be done in both a non UNICODE MDMP and a UNICODE system. To display the content use SE16 F6 ALV Grid Enter F7 F8. Exercises in the customer name space ZTECHED_UNICODE_EXERCISE_n_XX are prepared with the report TECHED_UNICODE_EXERCISE_COPYSAP TECHED 05 SEPTEMBER20054 Listings: ExercisesExercise 1*&------------------------------------- --------------------------------**& Report TECHED_UNICODE_EXERCISE_1 **&------------------------------------- --------------------------------*REPORT teched_unicode_exercise_1.** Exercise 1 (easy): Distinction between byte and character length** Hint: Use one of the additions** .. IN BYTE MODE or** .. IN CHARACTER MODE** for the DESCRIBE.

6 LENGTH statements.** before UNICODE enablingDATA: p1(4) TYPE p VALUE 1234, p2(8) TYPE p DECIMALS 3 VALUE ' '.PERFORM test1 USING 'abcdef'.PERFORM test2 USING test2 USING p2.*------------------------------------ ---------------------------------** FORM test1*---------------------------------- -----------------------------------*FORM test1 USING text TYPE c. DATA: len TYPE i, off TYPE i. DESCRIBE FIELD text LENGTH len. WHILE len > 0. WRITE: / text+off(1). len = len - 1. off = off + 1. "test1*--------------------------------- ------------------------------------** FORM test2*---------------------------------- -----------------------------------*FORM test2 USING val TYPE p.

7 DATA: len TYPE i, decs TYPE i. DESCRIBE FIELD val LENGTH len DECIMALS decs. ULINE. WRITE: / 'Value =', val. WRITE: / 'Length =', len. WRITE: / 'Decimals =', "test2 SAP TECHED 05 SEPTEMBER20055 Exercise 2*&------------------------------------- --------------------------------**& Report TECHED_UNICODE_EXERCISE_2 **&------------------------------------- --------------------------------*REPORT teched_unicode_exercise_2.** Exercise 2: String processing** Hint: Use attributes MINCHAR and CR_LF of class** CL_ABAP_CHAR_UTILITIES** before UNICODE enablingCONSTANTS: hex0(1) TYPE x VALUE '00', crlf(2) TYPE x VALUE '0D0A'.

8 DATA: BEGIN OF line1, text1(10) TYPE c VALUE 'system: ', mark1(1) TYPE x VALUE hex0, text2(10) TYPE c VALUE 'user: ', mark2(1) TYPE x VALUE hex0, text3(10) TYPE c VALUE 'client: ', mark3(1) TYPE x VALUE hex0, space(100) TYPE c, END OF line1, line2(133) TYPE : hex0 WITH sy-sysid INTO line1, hex0 WITH sy-uname INTO line1, hex0 WITH sy-mandt INTO line1 crlf INTO = : / TECHED 05 SEPTEMBER20056 Exercise 3*&------------------------------------- --------------------------------**& Report TECHED_UNICODE_EXERCISE_3 **&------------------------------------- --------------------------------*REPORT teched_unicode_exercise_3.

9 ** Exercise 3: Accessing structures with offset or length** Hint: Introduce an include with a group name in order to** avoid accessing the structure with offset/length.** before UNICODE enablingDATA: BEGIN OF struc1, f0 TYPE i, f1(10) TYPE c, f2(10) TYPE c, f3(10) TYPE c, f4(10) TYPE c, f5(10) TYPE c, f6 TYPE p, END OF struc1, cf(50) TYPE c, BEGIN OF struc2, f0 TYPE i VALUE 42, f1 TYPE i VALUE 12, f2 TYPE i VALUE 34, f3 TYPE i VALUE 56, f4 TYPE i VALUE 78, f5 TYPE i VALUE 90, END OF struc2 TO = struc1+4(50).CONDENSE : / TECHED 05 SEPTEMBER20057 Exercise 4 REPORT teched_unicode_exercise_4 .** Exercise 4: Move / Data container** Hint: Replace container-contents by an X-string** and use** EXPORT.

10 TO DATA BUFFER ..** IMPORT .. FROM DATA BUFFER ..** for storing and reading the contents of the container.** before UNICODE enablingTYPES: BEGIN OF person, firstname(20) TYPE c, lastname(20) TYPE c, age TYPE i, END OF person, BEGIN OF address, street(20) TYPE c, city(30) TYPE c, code(6) TYPE c, country(20) TYPE c, END OF address, BEGIN OF container, tag(1) TYPE c, contents(100) TYPE c, END OF : container_tab TYPE STANDARD TABLE OF fill_table CHANGING write_table USING container_tab.*------------------------- ---------------------------------------- ----** FORM fill_table*----------------------------- ---------------------------------------- *FORM fill_table CHANGING data_tab LIKE container_tab.


Related search queries