Skip to end of metadata
Go to start of metadata


Welcome to SAP WIKI SDN.

This WIKI is about how to migrate the Long texts for any Document(Can be any Order which is having Long texts) from one SAP system(Non-Unicode) to another SAP System(Unicode).
Generally when going for SAP Upgrades from SAP 4.6 or any older system to ECC we need to do some basic data migration handling via BDCs or BAPIs. In most of the scenarios when handling the Long Texts we use BDC to handle them in a custom way to achieve the requirement. In Order to Transfer the Long texts of the document we record this part also in the BDC Recording for Data Migration. In the Program we get the data from Tables of Long text based on Text ID and Text Object into a Work Area in a String Format and then the data is sent to Application Servers of Old System(Non-Unicode System). Later in the New System we take the data from the Application Server and upload into the New system via BDC recorded program or with BAPI. In case of BAPI the Text tables have FORMAT Option where the system will handle the texts alignments and all. For doing this you have lots of materials available on the internet and can do it without facing much problems. So, this WIKI tells more about migrating the data to Application Servers from Non-Unicode System to Unicode System.

When migrating Long Texts(Standard Texts) we may get some special character that needs to be migrated. For Example : In ' ¼E' the ¼ is a special Character where this cannot be moved into Application Server as it is in the Non-Unicode Systems. These Special characters are not even found in the Extended ASCII Codes. We need to do some operation before we move this kind of data to Application server. The below Steps tells us what operations need to be done and how they are handled in the data migrations.

1. Convert the Standard Texts into a Hexadecimal String by using the below mentioned Function Module.

'NLS_STRING_CONVERT_FROM_SYS'. This Function Module will convert the Standard Text that is extracted from Old System(Non-Unicode) to HEXA Decimal Format. Which is nothing but from STRING to XSTRING. By Passing the Following IMPORTING Parameters to the Function Module. LANG_USED = 'SY_LANGU'. SOURCE = 'A String'(Standard Text with Special Characters example mentioned in blue color) Example : Standard text passed to FM is "Use ¼E Of Vanilla Base Flavour with Carbon Water" the EXPORTING Parameter is a XSTRING which is in Hexa Decimal Format as shown in the below Screen shot.

The result(The Exporting Parameter RESULT) from the Function Module is mentioned in the blue color. '55736520BC45204F662056616E696C6C61204261736520466C61766F7572207769746820436172626F6E205761746572' Output of the Function Module is shown in the below screen shot.

Now this HEXA Decimal Data is moved into a 1000 CHAR Variable to transfer the data to AL11 (Since AL11 Transfers are accepted only in the CHARACTER Format { MOVE XSTRING TO TDLINE. Where XSTRING is of Type Hexadecimal ie., DATA : XSTRING Type XSTRING. TDLINE is of Type Character format i.e., DATA : TDLINE(1000) TYPE C.

In the New System (SAP ECC System/Unicode System) the data is read from AL11 file path and uses the Function Module NLS_STRING_CONVERT_TO_SYS to convert/decode the HEXA Decimal Data into actual Data(Standard Text with Special Characters/Symbols) as shown in the below function module screen.

As we all know there are Several Attributes available in the Class CL_ABAP_CHAR_UTILITIES which is used for Data conversions, Example: HORIZONTAL_TAB is for the values '#'/'TAB'/9/'11' to replace the Special Character/CHARValue /Decimal Value /OCT Values respectively. Similarly there are limited attributes to solve these kind of issues that are available in the Unicode system. By using these Function Modules we can achieve the migrations simple in case of handling special characters.

Hope this Documents helps when you do SAP Upgrades.

Thanks & Regards,

Venkat Sesha.

  • No labels