Cl_xml_document and type RAW on Unicode systems?

Cheers guys,
I'm using a cl_xml_document for exporting data from but000 to an XML file. Works fine, except for the PARTNER_GUID which seems to be interpreted as chars (it's raw bytes), eg. the GUID "0E1E1FFCF746D14CADEF2D3EBEAEB21B" becomes "Dh4f/PdG0Uyt7y0+vq6yGw==". This is a very serious prob for us because it also occurs with other fields/tables and makes the whole XML thing pretty much useless.
Is there any known workaround for this?
Thx in advance!

i tried to simulate your case and the finding is that if the source field data type is RAW (type BU_PARTNER_GUID) it behaves the way as you had explained.
however if you change the source field type(temporarily store them in a string field) to type string, it retains the format.
check this sample program.
data: l_xml  type ref to cl_xml_document  ,
     if_xml type ref to if_ixml_document ,
     node type ref to if_ixml_node  .
data: myguid type standard table of BU_PARTNER_GUID ,
      wa_guid type BU_PARTNER_GUID .
data: smyguid type standard table of string ,
      swa_guid type string .
data: xml_out type string ,
      xxml_out type xstring .
     wa_guid = '0E1E1FFCF746D14CADEF2D3EBEAEB21B' .
    append wa_guid to myguid .
swa_guid = '0E1E1FFCF746D14CADEF2D3EBEAEB21B' .
    append swa_guid to smyguid .
create object l_xml.
l_xml->set_data(
*    NAME        = 'DATA'
*    ALIAS       = ALIAS
    dataobject  = smyguid
*    PARENT_NODE = PARENT_NODE
*    CONTROL     = CONTROL
clear xml_out .
l_xml->render_2_xstring(
  EXPORTING
    PRETTY_PRINT = 'X'
  IMPORTING
*    RETCODE      = RETCODE
    STREAM       = xxml_out
*    SIZE         = SIZE
l_xml->render_2_string(
  EXPORTING
    PRETTY_PRINT = 'X'
  IMPORTING
*    RETCODE      = RETCODE
    STREAM       = xml_out
*    SIZE         = SIZE
call method l_xml->parse_string
  exporting
    stream = xml_out.
call method l_xml->display.

Similar Messages

  • Line incomaptibilty betwwen RAW and CHAR data types in SAP Unicode System.

    Hi Gurus,
    I am working in SAP Unicode system.
    We have transferred the standard programs for Non-Unicode to Unicode system.
    In one standard function module, <table name> is defined in TABLES parameter as a type of TLINE structure, which has two fields - one is 132 length CHAR and other is 2 length CHAR.
    In the same function module , one subroutine is being called, for which <table name>  is passed.
    But in the FORM of subroutine, this table is defined as a type of HLINE, which has only one field - 134 length RAW data type.
    So due to confilct in data types ( CHAR and RAW ) , I am getting an error that both data types are not line compatible.
    Do i need to use casting concept to remove the error.
    Please suggest me the way to handle this.

    hi,
    declare the table as same data type.
    dont go for any other types.
    if you still want the form table as HLINE, then before the form call declare a varibale with TLINE data type pass the values to HLINE.
    i think this will be little complex, because again it will be type incompatablity.
    we can forcefully pass the values to HLINE with a class.
    but i think no need, declaring with same data type might be easy.
    Thanks
    Vinod

  • Double byte language i.e Japanese or Chinese text in non Unicode System

    Hi,
    I have translated text into Chinese and Japanese in a Unicode system and want to move it into a non Unicode system. Would Chinese/Japanese characters display correctly in a non Unicode system when moved from Unicode system.  I am doing translation in ECC60 or SAP 4.7 Unicode system and moving to SAP 4.7 non Unicode system.
    Thanks
    Balakrishna

    Hi Balakrishna,
    in general the transport between Unicode and Non-Unicode systems is supported.
    However there are restrictions, which are outlined in SAP note 638357.
    In your case it is a prerequisite that the objects to be transported are language dependent (text lang. flag is set on the language key - see SAP note 480671) and the languages are properly setup in the target systems.
    For double byte data there is a specific issue when transferring data from Unicode to Non-Unicode:
    In a Non-Unicode system, one double-byte character needs two bytes, therefore e.g. in a 10 char field, 5 double byte chars are fitting. In a Unicode system, you can insert 10 double-byte chars in a 10 char field.  Hence there is a risk of truncating characters in case of Unicode --> Non-Unicode communication.
    Please also have a look at SAP notes 1322715 and 745030.
    Best regards,
    Nils

  • Integrating MDMP and Unicode systems with IDoc interfaces

    Hi,
    We are working on integrating SAP R/3 6.20 (MDMP) with SAP PI 7.0  SP10 (Unicode) system.  The source will send MATMAS or CLFMAS IDocs with Thai / Japanese characters and PI should transform and post it to SAP ECC 5.0 Target system [IDoc to IDoc scenario].
    ( SAP R/3 Legacy 620 - Non-Unicode / MDMP ) |---->  ( XI  - Unicode) ->  (ECC - Unicode)
    Had a look at few SAP notes (745030 ,656350 and 613389)  and it looks like there is no standard way/best practice to handle this scenario. 
    References:
    1.PDF of TECHED Session ID: IM101 Dealing with Multi-Language Garbage?Data – Lessons Learned
    2.SAP Note 745030 - MDMP - Unicode Interface_Solution Overview.pdf
    3.MDMP_Unicode_Transfer_final.doc from SAP Note 745030
    4.SAP Note 656350 - Master Data Transfer UNICODE to MDMP Systems with ALE.pdf
    5.SAP Note 613389 - ALE SAP system group with Unicode systems (Solution-2)
    My understanding per SAP Notes: (Please correct me if I'm wrong)
    a. For MDMP integraton we can't use Standard ALE Config instead we have to use Custom Configuration (IDoc collection setting in Partner profile &Scheduling  RSEOUT002/RSEOUT00_MDMP and use Function module :IDOC_INBOUND_ASYNCHRONOUS_2 ).
    b. The RFC Destinations should use proper logon langauage for correct MDMP IDoc transfer (For sending IDocs with Japanese character, the logon language should be JP).
    c. If we want to transfer IDocs in more than one language we need to create multiple Partner profiles/RFC destinations each with specific logon language.
    Please guide us in integrating these systems if you have done a similar integrations, following are my questions:
    1] Is there any configuration change required at PI layer?
    2] Do we need to install codepages in PI Unicode system for all languages used or Unicode system is capable of handling all the languages?
    3] Is it necessary to install any SAP Add-on package in R/3 MDMP system inorder to support MDMP to Unicode data transfer?
    3] If we want to send MATMAS/CLFMAS IDoc with Thai/Japanese characters from same system, what are the changes required at the Source system?
        (Source may send MATMAS/CLFMAS IDoc with either Thai/Japanese characters but not both of them in a single IDoc)
    4] Can we use regualr ALE & Partner profile settings for handling multi-byte characters or we need to use IDoc collection and RSEOUT002/RSEOUT00_MDMP report for transfer?
    5] Is there any restrictions on the IDoc types (MATMAS,CLFMAS etc) supported in MDMP-Unicode integration solution.
    5] Is there any best practice document available for this scenario?
    6] Do we need to involve SAP AG for MDMP to Unicode system integrations(As per SAP Note: 656350) ?
    Thanks and Regards,
    Ananth

    Hi Ananth,
    as you have already mentioned, you need differents RFC destinations for each language. So you have to make sure, that the IDocs use the right destination according to there content.
    If you have messages from PI to MDMP it is the same, you need different channels with different logon languages as well. You need an identifier in the message, that can be used for selecting the correct channel.
    It should not be a restricting to any IDoc type, but it is not possible to post a message with different languages (which require different codepages) in one IDoc.
    For correct conversion from a non unicode system to unicode, the codepages have to be installed in th OS of the PI server.
    Regards
    Stefan

  • Open dataset twice once for input and once for output in unicode system

    Hi All,
    In a program
    I used a open dataset to read the data from the file.
    OPEN DATASET cmp_file FOR INPUT IN TEXT MODE
          ENCODING NON-UNICODE.
    Then i closed the file.
    Again later in the program,
    I used a open dataset to transfer the data.
    OPEN DATASET cmp_file FOR OUTPUT IN TEXT MODE
          ENCODING NON-UNICODE.
    But this time I get sy-subrc = 8.
    Unable to open the file and subsequent TRANSFER is leading to the runtime error.
    Note : I am using a unicode system
    I could run the same program well in non-unicode system..
    ->
    Is it that if a file contains data already
    1.I need to delete the data and open it
    or
    2.I need to open in APPENDING mode manadatorily...
    in case of UNICODE system..
    Kindly suggest..

    Hi,
    IF you have write permission al S.O. Level you need to check your DATASET rigths using AUTHORITY_CHECK_DATASET, this validate your rigths with S_DATASET object.
    Example
    TYPE-POOLS SABC.
    CALL FUNCTION 'AUTHORITY_CHECK_DATASET'
    EXPORTING PROGRAM = 'ZDATASET'
    ACTIVITY = SABC_ACT_READ
    FILENAME = '/tmp/sapv01'
    EXCEPTIONS NO_AUTHORITY = 1
    ACTIVITY_UNKNOWN = 2.
    See SABC type pool to know wich activities are aviable.
    Hope this help.
    Regards

  • Convertion To type x  to char field in unicode system......

    Hi all
    please refer the following code .i need to assign type xstructure to single char field where data are .........
    SRTFDHIGH =  xsrtfdhigh
    unicode system gives error to convertion
    DATA: BEGIN OF xsrtfdhigh,
              pernr LIKE pc2b0-pernr,
              restkey1(16) TYPE x VALUE 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF',
              restkey2(16) TYPE x VALUE 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF',
            END OF xsrtfdhigh.
       DATA: SRTFDHIGH LIKE PCL2-SRTFD VALUE                   
             '9999999999999999999999999999999999999999'.
    PCL2-SRTFD type char 40.
    pc2b0-pernr  type numc 8.
    is there any solution to convert this .....
    Edited by: Vikram  shirole on Feb 23, 2008 8:52 AM
    Edited by: Vikram  shirole on Feb 23, 2008 8:54 AM

    Read first some documentation like [Character String Processing|http://help.sap.com/saphelp_nw2004s/helpdata/en/79/c554d9b3dc11d5993800508b6b8b11/frameset.htm], usually hexadecimal fields contain control characters (line feed, carriage return, tabulations and the like), so use constants of class [CL_ABAP_CHAR_UTILITIES|http://help.sap.com/abapdocu_70/en/ABENCL_ABAP_CHAR_UTILITIES.htm].
    Regards,
    Raymond

  • Convert TYPE string to TYPE p in a UNICODE system

    Hi-
    I've got a string that contains an amount and I want to convert it into a TYPE p in my program to store as a proper amount in the database.
    I can't do a simple move or use FMs like HMRC_AMOUNT_STRING_CONVERT as I am in a Unicode system and it errors if I try these.
    How can I do it.
    Example.
    parameters p_amount type string.
    start-of-selection.
    data l_amount TYPE p decimals 2.
    MOVE p_amount TO l_amount.
    =>compile error.

    Hi   Tristan.....
    IN PARAMETERS we ca have only have predefined data
    The data types valid for parameters include The built-in ABAP types c, d, i, n, p, t, and x
    You cannot use data type F, references and aggregate types.
    But you are using type STRING which is not allowed.
    so you are getting a compiler error.
    Suresh.....

  • Client Copy between unicode system and non-unicode system

    Hello,
    we have to build up a new system for japan. It is planned to install a new 4.7Ext200 unicode system and then make a client copy from a non-unicode 4.7Ext200 (language= german, english) system to the unicode system. I don't think that this is possible way, but I can't find information regarding client copies from non-unicode to unicode. I would advice the project to convert the existing non-unicode system to unicode, make a system copy for the new system and then install japan languages. Any information, which can help me.
    Regards,
    Alexander

    Hi,
    without conversion client copy is not possible
    look at following
    Re: Client copy between unicode and Non-unicode
    regards,
    kaushal

  • Compare system state (number and types of objects in memory)

    We have 2 exactly identical servers running our application talking to the same database.
    When some obejct from server 1 is deleted, a message is passed to server 2 to delete the object from its cache too.
    Forget the database, I want to design a testing system which compares the system-state (number and type of live-objects) in memory for server 1 and server 2 after the operation and the message, and reports any discrepancy.
    Any ideas ?

    Are you trying to debug a distributed cache implementation?
    If you want to inspect the state of your application on multiple servers creating a JMX bean might be a solution.
    http://java.sun.com/developer/technicalArticles/J2SE/jmx.html

  • Difference between Unicode systems and Nonunicode system

    HI  All ,
            Kindly let me know the difference between unicode and nonunicode systems , How do we find that ?
    Regards
    Selvan

    Unicode:In /usr/sap/<SID>/sys/exe you will find a UC folder...
    Non Unicode: this directory wont be there...
    Unicode allows global. access in multiple languages. Refer to http://www.sapdb.org/7.4/htmhelp/db/74d038d35e11d5994400508b6b8b11/content.htm for more details
    Another way to find whether a system is unicode or not, In Menu: System->Status->Unicode system: Yes or NO

  • System.InvalidCastException: Operator ' =' is not defined for type 'Byte()' and type 'Integer'.

    I'm getting the following error
    System.InvalidCastException: Operator '>=' is not defined for type 'Byte()' and type 'Integer'.
       at Microsoft.VisualBasic.CompilerServices.Operators.InvokeObjectUserDefinedOperator(UserDefinedOperator Op, Object[] Arguments)
       at Microsoft.VisualBasic.CompilerServices.Operators.InvokeUserDefinedOperator(UserDefinedOperator Op, Object[] Arguments)
       at Microsoft.VisualBasic.CompilerServices.Operators.CompareObjectGreaterEqual(Object Left, Object Right, Boolean TextCompare)
       at Customer_Fee_Calculator.Form1.GetCost2(Object dimension) in C:\Users\Chris\Documents\Visual Studio 2013\Projects\Customer Fee Calculator\Customer Fee Calculator\Form1.vb:line 259
       at Customer_Fee_Calculator.Form1.CustomerSelect_SelectedIndexChanged(Object sender, EventArgs e) in C:\Users\Chris\Documents\Visual Studio 2013\Projects\Customer Fee Calculator\Customer Fee Calculator\Form1.vb:line 72
                Dim inotes = rs1("INOTES").Value
      (Line 72)          If inotes.Length > 1 Then
                    cost = GetCost2(rs1("INOTES").Value)(0)
                    desc = GetCost2(rs1("INOTES").Value)(1)
                Else
                    PkgType = CInt(rs1("PKGTYPE").Value)
                    cost = GetCost(PkgType)(0)
                    desc = GetCost(PkgType)(1)
                End If
     Function GetCost2(dimension)
            Dim tempSql1, rs1
            Dim MyResult As New ArrayList
            Select Case dimension
    (line 259)            Case 1 To 24
                    tempSql1 = "SELECT * FROM PRODUCT WHERE PRODUCTID = 13"
                Case 25 To 43
                    tempSql1 = "SELECT * FROM PRODUCT WHERE PRODUCTID = 14"
                Case 44 To 71
                    tempSql1 = "SELECT * FROM PRODUCT WHERE PRODUCTID = 16"
                Case 72 To 120
                    tempSql1 = "SELECT * FROM PRODUCT WHERE PRODUCTID = 17"
                Case 121 To 499
                    tempSql1 = "SELECT * FROM PRODUCT WHERE PRODUCTID = 18"
                Case 500
                    tempSql1 = "SELECT * FROM PRODUCT WHERE PRODUCTID = 19"
                Case Else
                    tempSql1 = "SELECT * FROM PRODUCT WHERE PRODUCTID = 14"
            End Select
            rs1 = dbconnect(tempSql1, 1)
            MyResult.Add(rs1("RETAIL1").Value)
            MyResult.Add(rs1("DESCRIPTION").Value)
            MyResult.Add(rs1("PRODUCTID").Value)
            rs1 = Nothing
            tempSql1 = Nothing
            Return MyResult
        End Function

    Chris,
    I'm not a database guy - so in many ways, I'm not really qualified to answer this, but I'll make a suggestion anyway:
    At the very top of your code, put the following:
    Option Strict On
    Option Explicit On
    Option Infer Off
    With strict on and infer off, it will force you declare types - which I see missing in many places in the code.
    It's entirely possible that by you then going through and fixing those issues, you'll have corrected the problem.
    I don't know that, but it's possible -- and it should be done this way anyway, so there's certainly no harm to be done; in fact you'll actually speed up the program to a small degree because objects don't have to be inferred for the type that they actually
    are.
    ***** EDIT *****
    Also this: DON'T declare any of the types simply as "Object"; that's just trading off late binding for boxing, so you haven't really done much good. Declare them each as their correct actual type.
    Still lost in code, just at a little higher level.

  • Unicode and No-unicode system

    Hi ,
    Can i install a instace java unicode in a central instace abap no-unicode ?.
    Is compatible ?
    Thanks a lot

    Hi Kaushal,
    Kernel's are just executables, so their location makes no difference.
    It is recommended to convert systems to Unicode, but not for the reasons you are saying here.  When there is data communication between Unicode (sending) and non-Unicode (receiving) systems, there is always a possibility for data loss.  A system can only store data using the code page that is implemented...so a non-Unicode system can receive data that it can not store (it is put in as "#" in the database).  Whether Java is installed as an add-in or separate instance makes no difference whatsoever.
    Best Regards,
    Matt

  • Issue with Data flow between Unicode and Non Unicode systems

    Hello,
    I have scenario as below,
    We have  a Unicode – ECC 6.0 and a UTF 7 – Legacy system.
    A message flow between Legacy system to ECC 6.0 system and the data is of 700 KB size.
    Will there be any issue in this as one is Unicode and other is non Unicode?
    Kindly let me know.
    Thanks & Regards
    Vivek

    Hi,
    To add to Mike's post...
    You indicate that your legacy system is non-Unicode and the ERP system is Unicode.  You also said that the data flow is only <i>from</i> the legacy system <i>to</i> the ERP system.  In this case, you should have no data issues, since the Unicode system is the receiving system.  There <b>are</b> data issues when the data flow is in the other direction: <i>from</i> a Unicode system <i>to</i> a non-Unicode system.  Here, the non-Unicode system can only process characters that exist on its codepage and care must be taken from sending systems to ensure that they only send characters that are on the receiving system's codepage (as Mike says above).
    Best Regards,
    Matt

  • Obtaining system form id and type

    Hi all
    i would like to know how can i obtain a system form's id and type? (for activity form forinstance).
    appreciate the help
    Yoav

    Hi Yoav,
    Surely, you can get it.
    oapplication.Forms.ActiveForm.Type
    oapplication.Forms.ActiveForm.UniqueID
    they will return the type and uid of active form.
    Regards,
    Hyunil Choi.

  • SM30 and unicode systems

    After release upgrade to 5.0 I get dumps when I try to access the contents of a table in SM30.
    The new system is unicode. I have heard, that SM30 does not work in unicode systems. Is that true ?
    Which transaction should be used then ?

    Hi
    It's strange...for all tables? have you seen some note?
    I know there's a flag to be setted in the attribute of the program.
    Max

Maybe you are looking for

  • Idoc procces

    hi experts i have a problem, during an idoc procces i am updating z table using insert table and commit the commit statement causes to the idoc be on status 51, and the idoc is not posted how can i insert the table what i want without harming the ido

  • Labview XY graph with space between data and top/bottom of graph

    In Labview, how do I modify the properties of the XY Graph so that there is some empty space (of say 1 unit) between the top and bottom of my graph and the data points I'm plotting. For example, I have a sine wave and when its autoscaled, the top poi

  • Opening a 16-bit as a 12 or 8-bit?

    Why would you open a 16-bit photo in ACR or Photoshop as a 12-or 8-bit photo?  What is the point of doing that and what is it doing to the image? Thanks.

  • Everything has been wiped from iTunes..... Please help!!!

    After following some advice from another thread about how to connect my iPod touch, I went into task manager and ended the iTunes process. When I went back into iTunes all my music had gone... is there anyway to restore it? Not all of it is backed up

  • Reverse Proxy Server

    I would like to know whether your Sun Java System Web server (used as a reverse proxy) has scripting option so that it would redirect requests to a web server which is down due to some reason to another backup web server.