UTF-8 String Conversion

I have a UTF-8 string that contains some Chinese characters (result from an LDAP search on a Windows 2000 directory user who has a Chinese name). The attribute.get() returns a string that encodes each Chinese character as three characters. I believe a Chinese character is 3 bytes long in UTF-8. How can I recover the proper Unicode character for Chinese? I tried the following. But it doesn't work.
byte[] arBytes = strName.getBytes( "US-ASCII" );
strName = new String( arBytes, "UTF-8" );
Thanks,
Frank

The encoding used in <String>.getBytes(java.lang.String encodingName1) and that used in the constructor String(byte[], encodingName2) ought to be the same, i.e.,
"encodigName1.equals(encodingName2)" must be true.
And if you obtain a byte array through the getBytes("US-ASCII") the correct information of Unicode characters is lost there.

Similar Messages

  • \0D and \0A after array to spreadsheet string conversion

    Hi guys, i currently have a VI that manipulates a couple of arrays and writes them to a config file through the config VI.
    Now, i notice 1 problem whereby after my array is comma delimited and converted into a spreadsheet string, a tab and carriage return automatically appears at the end of the string. This causes my resulting config file to have \0D and \0A to appear with my keys in the config file.
    I know it's got to be the array to spreadsheet string conversion that's causing the problem because i don't have such \0D and \0A problem with keys without the conversion.
    How do i solve this?

    The OD and OA are the carriage return and line feed and yes the functona always appends these characters at the end of each line. Probably because this function is normally used to create files that a spreadsheet can read. There are several ways to remove the extra characters. Shown below is the string reversed and the String Subset function uses an offset of two. The output of that is reversed to get a string without the CR and LF. Also shown is getting the string length, subtracting 2 and wiring that to the length input of the String Subset function.
    Message Edited by Dennis Knutson on 07-26-2007 10:57 PM
    Attachments:
    Strip Last Two Characters.PNG ‏6 KB

  • JNI -- Native String Conversion

    I have a question about this tutorial
    http://java.sun.com/docs/books/tutorial/native1.1/implementing/string.html
    which is on accessing Java Strings in native methods.
    In particular, the tutorial states:
    "Your native method needs to call GetStringUTFChars to correctly print the string passed to it from a Java application. GetStringUTFChars converts the built-in Unicode representation of a Java string into a UTF-8 string. "
    and also notes then when converting from a java String to a C string:
    "If the original string contained non-ASCII characters, some library functions may not behave as expected if passed the converted, UTF-8 string. For example, the result of passing such a UTF-8 string to the strlen function will not be the number of Unicode characters in the string."
    I am programming in C++, not C. I handle most of my string manipulations using the STL std::string class. Do I still need to worry about the unexpected behaviour mentioned in the paragraph above?
    Also, what is the relevant difference here between UTF and Unicode? Which does std::string work with?
    Thanks for any info,
    John

    Do I still need to worry ...1) yes; but if you have a C++ compiler that implements std::basic_string<wchar_t> (as known as wstring in Microsoft Visual C++), you can work with pure Unicode.
    Which does std::string work with...2) std::string is a typedef for std::basic_string<char>, and char is not UTF-8 neither Unicode: it's a signed 8-bit quantity that maps exactly to the byte type in Java.
    std::string can be used with UTF-8 (actually, the modified UTF-8 version that is used by Java).
    The only problem with std::string is if you have characters in Java that are represented as several bytes in UTF-8, std::string.size() (or std::string.length()) will report you the number of bytes in the UTF-8 representation of your string, not the length of your Java string in characters.
    To get the length of the Java string that you've stored in a std::string in characters, you'll need to use some C library function that understands UTF-8 encoding, or simply ask the JNI functions.

  • Implicit character or charactered structure -- to String  Conversion

    Hi everybody,
    that sounds trivial but i am struggeling.... which is the most elegant way to do a implicit "To-String" Conversion in ABAP Objects...
    I have e.g.
        data lok_string type string.
        lok_string = wa.
        m_object->addline( lok_string ).
    which is working fine but is not elegant comaring with java.
    i want
        m_object->addline( wa ).
    but this don't go when "wa" is a structured workarea with many "type c"s in it (and only these).
    but since the explicit assignment "lok_string = wa." is working well, there could be a elegant  implicit  one?
    (m_object->addline expects a string variable.)
    Thank is aprreciated.
    Regards
    Hartmut

    Hi Sandra,
    this is the right direction.... but i would like to have it as an nested expression... (since implicit conversion seams to be impossible)
    like...
    m_object->addline( lcl_xxx=>tostring( wa_head ) )
    but this line above is not an valid abap objects syntax, unfortunatelly
    ... having:
    class lcl_xxx definition.
      public section.
        class-methods tostring importing charlike type clike returning value(string) type string.
    endclass.                   
    class lcl_xxx implementation.
      method tostring.
        string = charlike.
      endmethod.                   
    endclass.                   
    Best regards
    Hartmut

  • BINDING.JCA-11804 Unimplemented string conversion. in OSB

    Hi,
    Can any body tell me why the following exception is coming or give me the solution. When running procedure from business service in oracle service bus.
    <Error> <JCA_FRAMEWORK_AND_ADAPTER> <BEA-000000> <servicebus:/WSDL/IBPORTALDOMAPP/adapters/OSB/CustomerCreditCardsServiceCTLDB/CustomerCreditCardsService [ CustomerCreditCardsService_ptt::CustomerCreditCardsService(InputParameters,OutputParameters) ] - Could not invoke operation 'CustomerCreditCardsService' due to:
    BINDING.JCA-11804
    Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    Use a data type with a supported JDBC type.
            at oracle.tip.adapter.db.sp.oracle.TypeConverter.toString(TypeConverter.java:292)
            at oracle.tip.adapter.db.sp.oracle.XMLBuilder.XML(XMLBuilder.java:302)
            at oracle.tip.adapter.db.sp.AbstractXMLBuilder.weakRowSet(AbstractXMLBuilder.java:218)
            at oracle.tip.adapter.db.sp.AbstractXMLBuilder.DOMRowSet(AbstractXMLBuilder.java:160)
            at oracle.tip.adapter.db.sp.oracle.XMLBuilder.DOM(XMLBuilder.java:191)
            at oracle.tip.adapter.db.sp.AbstractXMLBuilder.buildDOM(AbstractXMLBuilder.java:274)
            at oracle.tip.adapter.db.sp.SPInteraction.executeStoredProcedure(SPInteraction.java:148)
            at oracle.tip.adapter.db.DBInteraction.executeStoredProcedure(DBInteraction.java:1148)
            at oracle.tip.adapter.db.DBInteraction.execute(DBInteraction.java:252)
            at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.performOperation(WSIFOperation_JCA.java:498)
            at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeOperation(WSIFOperation_JCA.java:365)
            at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeRequestResponseOperation(WSIFOperation_JCA.java:324)
            at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.invokeWsifProvider(JCABindingReferenceImpl.java:344)
            at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.request(JCABindingReferenceImpl.java:256)
            at com.bea.wli.sb.transports.jca.binding.JCATransportOutboundOperationBindingServiceImpl.invoke(JCATransportOutboundOperationBindingServiceImpl.java:150)
            at com.bea.wli.sb.transports.jca.JCATransportEndpoint.sendRequestResponse(JCATransportEndpoint.java:209)
            at com.bea.wli.sb.transports.jca.JCATransportEndpoint.send(JCATransportEndpoint.java:170)
            at com.bea.wli.sb.transports.jca.JCATransportProvider.sendMessageAsync(JCATransportProvider.java:574)
            at sun.reflect.GeneratedMethodAccessor1473.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at com.bea.wli.sb.transports.Util$1.invoke(Util.java:83)
            at $Proxy132.sendMessageAsync(Unknown Source)
            at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageAsync(LoadBalanceFailoverListener.java:148)
            at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToServiceAsync(LoadBalanceFailoverListener.java:603)
            at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToService(LoadBalanceFailoverListener.java:538)
            at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageToService(TransportManagerImpl.java:566)
            at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageAsync(TransportManagerImpl.java:434)
            at com.bea.wli.sb.pipeline.PipelineContextImpl.doDispatch(PipelineContextImpl.java:670)
            at com.bea.wli.sb.pipeline.PipelineContextImpl.dispatch(PipelineContextImpl.java:585)
            at stages.routing.runtime.RouteRuntimeStep.processMessage(RouteRuntimeStep.java:128)
            at com.bea.wli.sb.stages.StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
            at com.bea.wli.sb.pipeline.RouteNode.doRequest(RouteNode.java:106)
            at com.bea.wli.sb.pipeline.Node.processMessage(Node.java:67)
            at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:1055)
            at com.bea.wli.sb.pipeline.Router.processMessage(Router.java:214)
            at com.bea.wli.sb.pipeline.MessageProcessor.processRequest(MessageProcessor.java:96)
            at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:593)
            at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:591)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
            at com.bea.wli.sb.pipeline.RouterManager.processMessage(RouterManager.java:590)
            at com.bea.wli.sb.transports.TransportManagerImpl.receiveMessage(TransportManagerImpl.java:383)
            at com.bea.wli.sb.transports.local.LocalMessageContext$1.run(LocalMessageContext.java:179)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at weblogic.security.Security.runAs(Security.java:61)
            at com.bea.wli.sb.transports.local.LocalMessageContext.send(LocalMessageContext.java:174)
            at com.bea.wli.sb.transports.local.LocalTransportProvider.sendMessageAsync(LocalTransportProvider.java:322)
            at sun.reflect.GeneratedMethodAccessor1473.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at com.bea.wli.sb.transports.Util$1.invoke(Util.java:83)
            at $Proxy116.sendMessageAsync(Unknown Source)
            at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageAsync(LoadBalanceFailoverListener.java:148)
            at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToServiceAsync(LoadBalanceFailoverListener.java:603)
            at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToService(LoadBalanceFailoverListener.java:538)
            at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageToService(TransportManagerImpl.java:566)
            at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageAsync(TransportManagerImpl.java:434)
            at com.bea.wli.sb.pipeline.PipelineContextImpl.doDispatch(PipelineContextImpl.java:670)
            at com.bea.wli.sb.pipeline.PipelineContextImpl.dispatch(PipelineContextImpl.java:585)
            at stages.routing.runtime.RouteRuntimeStep.processMessage(RouteRuntimeStep.java:128)
            at com.bea.wli.sb.stages.StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
            at stages.routing.runtime.RouteTableRuntimeStep.processMessage(RouteTableRuntimeStep.java:129)
            at com.bea.wli.sb.stages.StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
            at com.bea.wli.sb.pipeline.RouteNode.doRequest(RouteNode.java:106)
            at com.bea.wli.sb.pipeline.Node.processMessage(Node.java:67)
            at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:1055)
            at com.bea.wli.sb.pipeline.Router.processMessage(Router.java:214)
            at com.bea.wli.sb.pipeline.MessageProcessor.processRequest(MessageProcessor.java:96)
            at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:593)
            at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:591)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
            at com.bea.wli.sb.pipeline.RouterManager.processMessage(RouterManager.java:590)
            at com.bea.wli.sb.test.service.ServiceMessageSender.send0(ServiceMessageSender.java:332)
            at com.bea.wli.sb.test.service.ServiceMessageSender.access$000(ServiceMessageSender.java:79)
            at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:137)
            at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:135)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
            at com.bea.wli.sb.test.service.ServiceMessageSender.send(ServiceMessageSender.java:140)
            at com.bea.wli.sb.test.service.ServiceProcessor.invoke(ServiceProcessor.java:454)
            at com.bea.wli.sb.test.TestServiceImpl.invoke(TestServiceImpl.java:172)
            at com.bea.wli.sb.test.client.ejb.TestServiceEJBBean.invoke(TestServiceEJBBean.java:167)
            at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.__WL_invoke(Unknown Source)
            at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
            at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.invoke(Unknown Source)
            at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
            at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
            at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    >
    <Feb 25, 2015 6:58:23 PM GMT+05:00> <Error> <JCA_FRAMEWORK_AND_ADAPTER> <BEA-000000> <servicebus:/WSDL/IBPORTALDOMAPP/adapters/OSB/CustomerCreditCardsServiceCTLDB/CustomerCreditCardsService [ CustomerCreditCardsService_ptt::CustomerCreditCardsService(InputParameters,OutputParameters) ] - Rolling back JCA LocalTransaction>
    <Feb 25, 2015 6:58:23 PM GMT+05:00> <Error> <JCATransport> <BEA-381967> <Invoke JCA outbound service failed with application error, exception: com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/IBPORTALDOMAPP/adapters/OSB/CustomerCreditCardsServiceCTLDB/CustomerCreditCardsService [ CustomerCreditCardsService_ptt::CustomerCreditCardsService(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'CustomerCreditCardsService' failed due to: Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    ; nested exception is:
            BINDING.JCA-11804
    Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    Use a data type with a supported JDBC type.
    com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/IBPORTALDOMAPP/adapters/OSB/CustomerCreditCardsServiceCTLDB/CustomerCreditCardsService [ CustomerCreditCardsService_ptt::CustomerCreditCardsService(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'CustomerCreditCardsService' failed due to: Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    ; nested exception is:
            BINDING.JCA-11804
    Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    Use a data type with a supported JDBC type.
            at com.bea.wli.sb.transports.jca.binding.JCATransportOutboundOperationBindingServiceImpl.invoke(JCATransportOutboundOperationBindingServiceImpl.java:155)
            at com.bea.wli.sb.transports.jca.JCATransportEndpoint.sendRequestResponse(JCATransportEndpoint.java:209)
            at com.bea.wli.sb.transports.jca.JCATransportEndpoint.send(JCATransportEndpoint.java:170)
            at com.bea.wli.sb.transports.jca.JCATransportProvider.sendMessageAsync(JCATransportProvider.java:574)
            at sun.reflect.GeneratedMethodAccessor1473.invoke(Unknown Source)
            Truncated. see log file for complete stacktrace
    Caused By: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/IBPORTALDOMAPP/adapters/OSB/CustomerCreditCardsServiceCTLDB/CustomerCreditCardsService [ CustomerCreditCardsService_ptt::CustomerCreditCardsService(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'CustomerCreditCardsService' failed due to: Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    ; nested exception is:
            BINDING.JCA-11804
    Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    Use a data type with a supported JDBC type.
            at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.request(JCABindingReferenceImpl.java:258)
            at com.bea.wli.sb.transports.jca.binding.JCATransportOutboundOperationBindingServiceImpl.invoke(JCATransportOutboundOperationBindingServiceImpl.java:150)
            at com.bea.wli.sb.transports.jca.JCATransportEndpoint.sendRequestResponse(JCATransportEndpoint.java:209)
            at com.bea.wli.sb.transports.jca.JCATransportEndpoint.send(JCATransportEndpoint.java:170)
            at com.bea.wli.sb.transports.jca.JCATransportProvider.sendMessageAsync(JCATransportProvider.java:574)
            Truncated. see log file for complete stacktrace
    Caused By: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/IBPORTALDOMAPP/adapters/OSB/CustomerCreditCardsServiceCTLDB/CustomerCreditCardsService [ CustomerCreditCardsService_ptt::CustomerCreditCardsService(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'CustomerCreditCardsService' failed due to: Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    ; nested exception is:
            BINDING.JCA-11804
    Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    Use a data type with a supported JDBC type.
            at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.performOperation(WSIFOperation_JCA.java:603)
            at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeOperation(WSIFOperation_JCA.java:365)
            at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeRequestResponseOperation(WSIFOperation_JCA.java:324)
            at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.invokeWsifProvider(JCABindingReferenceImpl.java:344)
            at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.request(JCABindingReferenceImpl.java:256)
            Truncated. see log file for complete stacktrace
    Caused By: BINDING.JCA-11804
    Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    Use a data type with a supported JDBC type.
            at oracle.tip.adapter.db.sp.oracle.TypeConverter.toString(TypeConverter.java:292)
            at oracle.tip.adapter.db.sp.oracle.XMLBuilder.XML(XMLBuilder.java:302)
            at oracle.tip.adapter.db.sp.AbstractXMLBuilder.weakRowSet(AbstractXMLBuilder.java:218)
            at oracle.tip.adapter.db.sp.AbstractXMLBuilder.DOMRowSet(AbstractXMLBuilder.java:160)
            at oracle.tip.adapter.db.sp.oracle.XMLBuilder.DOM(XMLBuilder.java:191)
            Truncated. see log file for complete stacktrace
    >
    <Feb 25, 2015 6:58:23 PM GMT+05:00> <Warning> <ALSB Logging> <BEA-000000> < [CustomerCreditCards_RN, _onErrorHandler-2229530737635136699-5d7bbea6.14955308f67.-7ccb, errStage1, ERROR] [IBPORTALDOMAPP][12431234123413241][Invoke JCA outbound service failed with application error, exception: com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/IBPORTALDOMAPP/adapters/OSB/CustomerCreditCardsServiceCTLDB/CustomerCreditCardsService [ CustomerCreditCardsService_ptt::CustomerCreditCardsService(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'CustomerCreditCardsService' failed due to: Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    ; nested exception is:
            BINDING.JCA-11804
    Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    Use a data type with a supported JDBC type.
    com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/IBPORTALDOMAPP/adapters/OSB/CustomerCreditCardsServiceCTLDB/CustomerCreditCardsService [ CustomerCreditCardsService_ptt::CustomerCreditCardsService(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'CustomerCreditCardsService' failed due to: Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    ; nested exception is:
            BINDING.JCA-11804
    Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    Use a data type with a supported JDBC type.
            at com.bea.wli.sb.transports.jca.binding.JCATransportOutboundOperationBindingServiceImpl.invoke(JCATransportOutboundOperationBindingServiceImpl.java:155)
            at com.bea.wli.sb.transports.jca.JCATransportEndpoint.sendRequestResponse(JCATransportEndpoint.java:209)
            at com.bea.wli.sb.transports.jca.JCATransportEndpoint.send(JCATransportEndpoint.java:170)
            at com.bea.wli.sb.transports.jca.JCATransportProvider.sendMessageAsync(JCATransportProvider.java:574)
            at sun.reflect.GeneratedMethodAccessor1473.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at com.bea.wli.sb.transports.Util$1.invoke(Util.java:83)
            at $Proxy132.sendMessageAsync(Unknown Source)
            at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageAsync(LoadBalanceFailoverListener.java:148)
            at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToServiceAsync(LoadBalanceFailoverListener.java:603)
            at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToService(LoadBalanceFailoverListener.java:538)
            at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageToService(TransportManagerImpl.java:566)
            at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageAsync(TransportManagerImpl.java:434)
            at com.bea.wli.sb.pipeline.PipelineContextImpl.doDispatch(PipelineContextImpl.java:670)
            at com.bea.wli.sb.pipeline.PipelineContextImpl.dispatch(PipelineContextImpl.java:585)
            at stages.routing.runtime.RouteRuntimeStep.processMessage(RouteRuntimeStep.java:128)
            at com.bea.wli.sb.stages.StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
            at com.bea.wli.sb.pipeline.RouteNode.doRequest(RouteNode.java:106)
            at com.bea.wli.sb.pipeline.Node.processMessage(Node.java:67)
            at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:1055)
            at com.bea.wli.sb.pipeline.Router.processMessage(Router.java:214)
            at com.bea.wli.sb.pipeline.MessageProcessor.processRequest(MessageProcessor.java:96)
            at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:593)
            at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:591)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
            at com.bea.wli.sb.pipeline.RouterManager.processMessage(RouterManager.java:590)
            at com.bea.wli.sb.transports.TransportManagerImpl.receiveMessage(TransportManagerImpl.java:383)
            at com.bea.wli.sb.transports.local.LocalMessageContext$1.run(LocalMessageContext.java:179)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at weblogic.security.Security.runAs(Security.java:61)
            at com.bea.wli.sb.transports.local.LocalMessageContext.send(LocalMessageContext.java:174)
            at com.bea.wli.sb.transports.local.LocalTransportProvider.sendMessageAsync(LocalTransportProvider.java:322)
            at sun.reflect.GeneratedMethodAccessor1473.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at com.bea.wli.sb.transports.Util$1.invoke(Util.java:83)
            at $Proxy116.sendMessageAsync(Unknown Source)
            at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageAsync(LoadBalanceFailoverListener.java:148)
            at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToServiceAsync(LoadBalanceFailoverListener.java:603)
            at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToService(LoadBalanceFailoverListener.java:538)
            at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageToService(TransportManagerImpl.java:566)
            at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageAsync(TransportManagerImpl.java:434)
            at com.bea.wli.sb.pipeline.PipelineContextImpl.doDispatch(PipelineContextImpl.java:670)
            at com.bea.wli.sb.pipeline.PipelineContextImpl.dispatch(PipelineContextImpl.java:585)
            at stages.routing.runtime.RouteRuntimeStep.processMessage(RouteRuntimeStep.java:128)
            at com.bea.wli.sb.stages.StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
            at stages.routing.runtime.RouteTableRuntimeStep.processMessage(RouteTableRuntimeStep.java:129)
            at com.bea.wli.sb.stages.StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
            at com.bea.wli.sb.pipeline.RouteNode.doRequest(RouteNode.java:106)
            at com.bea.wli.sb.pipeline.Node.processMessage(Node.java:67)
            at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:1055)
            at com.bea.wli.sb.pipeline.Router.processMessage(Router.java:214)
            at com.bea.wli.sb.pipeline.MessageProcessor.processRequest(MessageProcessor.java:96)
            at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:593)
            at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:591)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
            at com.bea.wli.sb.pipeline.RouterManager.processMessage(RouterManager.java:590)
            at com.bea.wli.sb.test.service.ServiceMessageSender.send0(ServiceMessageSender.java:332)
            at com.bea.wli.sb.test.service.ServiceMessageSender.access$000(ServiceMessageSender.java:79)
            at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:137)
            at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:135)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
            at com.bea.wli.sb.test.service.ServiceMessageSender.send(ServiceMessageSender.java:140)
            at com.bea.wli.sb.test.service.ServiceProcessor.invoke(ServiceProcessor.java:454)
            at com.bea.wli.sb.test.TestServiceImpl.invoke(TestServiceImpl.java:172)
            at com.bea.wli.sb.test.client.ejb.TestServiceEJBBean.invoke(TestServiceEJBBean.java:167)
            at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.__WL_invoke(Unknown Source)
            at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
            at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.invoke(Unknown Source)
            at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
            at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
            at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    Caused by: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/IBPORTALDOMAPP/adapters/OSB/CustomerCreditCardsServiceCTLDB/CustomerCreditCardsService [ CustomerCreditCardsService_ptt::CustomerCreditCardsService(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'CustomerCreditCardsService' failed due to: Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    ; nested exception is:
            BINDING.JCA-11804
    Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    Use a data type with a supported JDBC type.
            at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.request(JCABindingReferenceImpl.java:258)
            at com.bea.wli.sb.transports.jca.binding.JCATransportOutboundOperationBindingServiceImpl.invoke(JCATransportOutboundOperationBindingServiceImpl.java:150)
            ... 86 more
    Caused by: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/IBPORTALDOMAPP/adapters/OSB/CustomerCreditCardsServiceCTLDB/CustomerCreditCardsService [ CustomerCreditCardsService_ptt::CustomerCreditCardsService(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'CustomerCreditCardsService' failed due to: Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    ; nested exception is:
            BINDING.JCA-11804
    Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    Use a data type with a supported JDBC type.
            at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.performOperation(WSIFOperation_JCA.java:603)
            at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeOperation(WSIFOperation_JCA.java:365)
            at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeRequestResponseOperation(WSIFOperation_JCA.java:324)
            at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.invokeWsifProvider(JCABindingReferenceImpl.java:344)
            at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.request(JCABindingReferenceImpl.java:256)
    Caused by: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/IBPORTALDOMAPP/adapters/OSB/CustomerCreditCardsServiceCTLDB/CustomerCreditCardsService [ CustomerCreditCardsService_ptt::CustomerCreditCardsService(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'CustomerCreditCardsService' failed due to: Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    ; nested exception is:
            BINDING.JCA-11804
    Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    Use a data type with a supported JDBC type.
            at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.performOperation(WSIFOperation_JCA.java:603)
            at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeOperation(WSIFOperation_JCA.java:365)
            at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeRequestResponseOperation(WSIFOperation_JCA.java:324)
            at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.invokeWsifProvider(JCABindingReferenceImpl.java:344)
            at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.request(JCABindingReferenceImpl.java:256)
            ... 87 more
    Caused by: BINDING.JCA-11804
    Unimplemented string conversion.
    Conversion of JDBC type  to String is not supported.
    An attempt was made to convert a Java object to String using an unsupported JDBC type: .
    Use a data type with a supported JDBC type.
            at oracle.tip.adapter.db.sp.oracle.TypeConverter.toString(TypeConverter.java:292)
            at oracle.tip.adapter.db.sp.oracle.XMLBuilder.XML(XMLBuilder.java:302)
            at oracle.tip.adapter.db.sp.AbstractXMLBuilder.weakRowSet(AbstractXMLBuilder.java:218)
            at oracle.tip.adapter.db.sp.AbstractXMLBuilder.DOMRowSet(AbstractXMLBuilder.java:160)
            at oracle.tip.adapter.db.sp.oracle.XMLBuilder.DOM(XMLBuilder.java:191)
            at oracle.tip.adapter.db.sp.AbstractXMLBuilder.buildDOM(AbstractXMLBuilder.java:274)
            at oracle.tip.adapter.db.sp.SPInteraction.executeStoredProcedure(SPInteraction.java:148)
            at oracle.tip.adapter.db.DBInteraction.executeStoredProcedure(DBInteraction.java:1148)
            at oracle.tip.adapter.db.DBInteraction.execute(DBInteraction.java:252)
            at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.performOperation(WSIFOperation_JCA.java:498)
            ... 91 more
    ] :: Transaction has been timed out as no response was received from host.>
    <Feb 25, 2015 6:58:24 PM GMT+05:00> <Warning> <ALSB Statistics Manager> <BEA-473007> <Aggregator did not receive statistics from [osb_server2] for the aggregation performed for tick 39553080.>

    Maybe this can help - http://www.javamonamour.org/2011/11/osb-and-rejectedmessagehandlers-in-jca.html

  • String Conversion

    In Word if I run "StrConv(FeeMemo.Addr.Text, 3)" on a test of "this is a test of string conversion" this function will convert this text to "This Is A Test Of String Conversion".
    I wonder if such functionality exist on JaveScript for PDF? and if there is where would you put it?
    Thanks in advance for your help...
    Regards
    Jeff

    You can write a JavaScript function and place it in the document level JavaScript or as a folder level script.
    You will have to split the text sting by the space character and then go through each element of the array and then force the first character of each element to an upper case value. You can then reassemble the elements with the spaces between them.

  • String Conversion into Quantity field ----------Sales Orders

    Hi Experts,
    Can any of you give an standard function module or conversion routine for String conversion to Quantity field.
    The problem is I pass on 5 value as a string and while the system creates any sales orders, now in the quantity filed
    it shows me as 0.005 and for value 7 it gives me as 0.007.
    So, Now I want a conversion in such a way that if I pass 5 then the system should 5.000 and if I pass 10 it should show
    as 10.00 likewise for 100 or above also.
    Thank you,
    KishoreJ.

    Hi,
    You have check , what is user format configure in each user then reply the forum.
    Thanks
    With Regards
    I.Muthukumar

  • Loading UTF-8 String into CLOB column

    Hello!
    I am trying to load UTF-8 encoded strings into a CLOB column in an Oracle 9i database from VB.Net using ODP.Net (9.2.0.414).
    The strings are XML snippets (Microsoft WordML to be precise). Each corresponds to a record which already exists in the database, therefore I do an update to add the UTF-8 string.
    Some of the XML snippets contain characters which once inserted look like upside down question marks (characters represented by 0x92 and 0x96 for example end up as 0xBF once in the database).
    Setting breakpoints in Visual Studio, I can watch the string values in the 'Locals' window and they appear correct (in fact I can copy from the 'Locals' window and using a tool such as TOAD can paste the strings into the database successfully). Pasting through TOAD, the characters are properly represented in the database (ie 0x92 is 0x92).
    I've tried a number of approaches with no luck.
    Any advice/suggestion are most welcome. Thanks!
    Here is my code:
    strConnectionString = ConfigurationSettings.AppSettings.Item("ConnectionString")
    strComponentsTable = ConfigurationSettings.AppSettings.Item("ComponentsTable")
    objConnection = New OracleConnection(strConnectionString)
    objCommand = objConnection.CreateCommand()
    objCommand.CommandType = CommandType.Text
    objCommand.CommandText = "UPDATE " & strComponentsTable & " SET TEMPLATE_COMPONENT_CONTENT = :p_content WHERE TEMPLATE_COMPONENT_ID = :p_id"
    objConnection.Open()
    For Each strId In objComponents.Keys
    strContent = objComponents.Item(strId)
    objCommand.Parameters.Clear()
    objParameter = objCommand.CreateParameter()
    objParameter.ParameterName = "p_content"
    objParameter.OracleDbType = OracleDbType.Clob
    objParameter.Direction = ParameterDirection.Input
    objParameter.Value = strContent
    objCommand.Parameters.Add(objParameter)
    objParameter = objCommand.CreateParameter()
    objParameter.ParameterName = "p_id"
    objParameter.OracleDbType = OracleDbType.Int32
    objParameter.Direction = ParameterDirection.Input
    objParameter.Value = CInt(strId)
    objCommand.Parameters.Add(objParameter)
    intResult = objCommand.ExecuteNonQuery()
    Next

    Some further research has revealed the following:
    Two of the characters I provided as examples of not being stored properly in the database are (in Unicode) U+2013 and U=2019. These characters, encoded as UTF-8 should each be three bytes (0xE2 80 93 and 0xE2 80 99 respectively). Sent via VB.Net and ODP.Net they both end up in the database as one byte each (0xBF). Copy and Pasted via TOAD they end up as one byte each (0x92 and 0x96 respectively).
    The NLS settings on the server side are:
    NLS_CHARACTERSET = WE8ISO8859P1
    NLS_NCHAR_CHARACTERSET = AL16UTF16
    I have tried using both CLOB and NCLOB column with the results being identical.
    Not sure what else to try...

  • Convert a UTF-8 string to ISO-8859-1 string

    Hello. As you can see from my other post, I am working on internationalization. I could not find an appropriate entry in the forum already.
    I want to convert form data (submitted from an HTML UTF-8 charset page) from the UTF-8 format to ISO-8859-1 format. How do I do that?
    I.e.
    String utfFormat="&#35222;&#32884;&#32773;";
    String isoFormat="";
    // Do magic here
    System.out.println(isoFormat); // out: "&#12375;&#12390;&#12398;" (or whatever it is)
    Can you help?
    Dailysun
    null

    As I said in the other thread (did you read that, BTW?), you shouldn't have to bother with actual character-set conversions. You just tell the InputStream what the Charset is when you read it in, and the OutputStream what Charset to use when you write it out.
    What you're doing is escaping characters by replacing them with numeric entity references--the opposite of what you asked in the other thread. The process is just as simple: cast the char to an int, convert that to a string with String.valueOf(int), and add the "&#" and ";". You can use a regex-based approach like I did over there, but going in this direction, it will be just as easy without them.
    Hiwa, check out that other thread; I think you'll find it amusing (in light of that second link you posted).

  • German Special Characters in XSTRING to STRING conversion

    Hi Experts,
    I have a CSV file (created from a Windows Excel file) with German Special Characters (e.g. 'ä', 'Ä') and I am trying to read this into ABAP internal tables. By using the THTMLB tag 'thtmlb:fileUpload' I get an XSTRING and I am trying to convert this into STRING. However, wheny trying to do this I get an exception 'CX_SY_CONVERSION_CODEPAGE'.
    This is my coding:
      data: conv   type ref to cl_abap_conv_in_ce.
      conv = cl_abap_conv_in_ce=>create( input = lr_upload->file_content ).
      conv->read( importing data = lv_content ).
    Note: lr_upload is my XSTRING object from the file upload, lv_content is a STRING.
    In the CSV file the German special characters look fine and the SAP system is a Unicode system, but it seems like there are some problems with the conversions somehow. Any ideas from the experts?
    Thanks a lot and Regards,
    Jens

    As you mention a csv file I'm wondering if your encoding is wrong: I.e. when you create your instance of cl_abap_conv_in_ce you don't specify the encoding of your source hex string, so that means the default encoding is used, which should be UTF-8 in your case. So if your csv file is not encoded in UTF-8, specify the correct encoding in the create method and see if that helps.
    Depending on how you get the file contents you might actually be able to combine the file retrieval with the conversion in one step. E.g. if the file is read from the application server you could specify the used code page via [open dataset ... in legacy text mode ... code page|http://help.sap.com/abapdocu_70/en/ABAPOPEN_DATASET_MODE.htm#&ABAP_ALTERNATIVE_4@4@]. Similarly method gui_upload of class cl_gui_frontend_services also allows you to specify a code page.
    If all of this doesn't help, post some further details on your file (e.g. sample content & encoding) and possibly add some further details from the exception you're getting. As you mention a Unicode system it basically means that we should be able to convert all characters without any problem as long as we specify the correct source code page.
    Cheers, harald

  • Int4 to String conversion in DS ABAP Stage

    Hi Gurus,
    I need help how to convert int4 field to String in ABAP Stage in DataStage. we are joining IMPH table Coumn SubId with other string column. Code is generated  automatically in ABAP Stage. If any one can give me idea ,like how to approach.
    Writing a routine or FM? That how I am thinking to convert and put in a ZIMPH table and join the two tables in ABAP Stage.What I am thinking is there must be easier way,what I am missing here.
                                 Any help would be appreciated.
    Mili c

    As you mention a csv file I'm wondering if your encoding is wrong: I.e. when you create your instance of cl_abap_conv_in_ce you don't specify the encoding of your source hex string, so that means the default encoding is used, which should be UTF-8 in your case. So if your csv file is not encoded in UTF-8, specify the correct encoding in the create method and see if that helps.
    Depending on how you get the file contents you might actually be able to combine the file retrieval with the conversion in one step. E.g. if the file is read from the application server you could specify the used code page via [open dataset ... in legacy text mode ... code page|http://help.sap.com/abapdocu_70/en/ABAPOPEN_DATASET_MODE.htm#&ABAP_ALTERNATIVE_4@4@]. Similarly method gui_upload of class cl_gui_frontend_services also allows you to specify a code page.
    If all of this doesn't help, post some further details on your file (e.g. sample content & encoding) and possibly add some further details from the exception you're getting. As you mention a Unicode system it basically means that we should be able to convert all characters without any problem as long as we specify the correct source code page.
    Cheers, harald

  • Unicode to String Conversion

    Dear all,
    I'm trying to get the String from unicode, previously i'm converting the String to Unicode like below,
    String s = "\\u"+Integer.toHexString(s.charAt(0));
    Which is giving me the same what i appended above even after Conversion using UTF-8.
    If i do String s ="\u30f3"
    It is giving me correct character. But my problem is i'm getting the latter part i.e hexString latter in the run time...through Integer.toHexString..
    i can't add this as a character.. so it is taking as a two different strings..
    How to handle this situation..
    Hope i can find the answer,
    Thanks in advance,
    Srinivas N

    Below is my IOUtils class. In particular, see the loadTextFile method for an example of how to read a UTF file, and the isUTF method to detect if a file is Unicode
    You will not be able to compile this class unless you have my InfoFetcher class. You should be able to find a reference to this class by searching google for "InfoFetcher tjacobs01"
    You are welcome to use and modify this class, but please don't change the package or take credit for it as your own work
    package tjacobs.io;
    import java.awt.Component;
    import java.io.*;
    import java.net.URL;
    import java.net.URLConnection;
    import java.text.MessageFormat;
    import java.util.ArrayList;
    import java.util.List;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import javax.swing.JOptionPane;
    import javax.swing.JTable;
    import javax.swing.table.TableModel;
    import tjacobs.io.InfoFetcher.FetcherListener;
    * IOUtils class
    * This is an important class that I use a lot.<p>
    * has a lot of static utilities. Most should be fairly self-explanatory
    public class IOUtils {
         public static final int DEFAULT_BUFFER_SIZE = (int) Math.pow(2, 20); //1 MByte
         public static final int DEFAULT_WAIT_TIME = 30000;
         public static final boolean ALWAYS_BACKUP = false;
         public static String loadTextFile(File f) throws IOException {
              return loadTextFile(f, isUTF16(f));
         public static String loadTextFile(File f, boolean UTF16) throws IOException {
              BufferedReader br = !UTF16 ?
                        new BufferedReader(new FileReader(f)) :
                        new BufferedReader(
                             new InputStreamReader(new FileInputStream(f),
                                                   "UTF-16"));
              int length = (int) f.length();
              char data[] = new char[!UTF16?(int)length : ((int)length) / 2 - 1];
              int got = 0;
              do {
                   got += br.read(data, got, data.length - got);
              while (got < data.length);
              return new String(data);
         public static InfoFetcher loadData(InputStream in) {
              byte buf[] = new byte[DEFAULT_BUFFER_SIZE]; // 1 MByte
              return loadData(in, buf);
         public static InfoFetcher loadData(InputStream in, byte buf[]) {
              return loadData(in, buf, TimeOut.DEFAULT_WAIT_TIME);
         public static InfoFetcher loadData(InputStream in, byte buf[], int waitTime) {
              return new InfoFetcher(in, buf, waitTime);
         public static InfoFetcher loadData(InputStream in, int initBufLength, int waitTime) {
              return loadData(in, new byte[initBufLength], waitTime);
         public static InfoFetcher loadData(File f) throws FileNotFoundException{
              //if (!f.exists()) throw new FileNotFoundException(f.getAbsolutePath());
              //create the inputstream first so that we can generate the FileNotFoundException right away
              InputStream in = new BufferedInputStream(new FileInputStream(f));
              long len = f.length();
              if (len > Integer.MAX_VALUE) {
                   throw new RuntimeException("File size exceeds maximum size for a byte buffer");
              return loadData(in, (int) len, TimeOut.NO_TIMEOUT);
         public static InfoFetcher loadData(URL url) throws IOException{
              return loadData(url.openConnection());
         public static InfoFetcher loadData(URLConnection conn) throws IOException {
              int size = conn.getContentLength();
              if (size < 0) return loadData(conn.getInputStream(), 2000, DEFAULT_WAIT_TIME);
              return loadData(conn.getInputStream(), size, DEFAULT_WAIT_TIME);
          * Note: There is no guarentee that this method will
          * ever return. For instance, if you call loadAll on
          * an open socket connection it won't return until the
          * socket has closed
         public static String loadAllString(InputStream in) {
              InfoFetcher fetcher = loadData(in);
              fetcher.run();
              return new String(fetcher.buf, 0, fetcher.got);
          * Note: There is no guarentee that this method will
          * ever return. For instance, if you call loadAll on
          * an open socket connection it won't return until the
          * socket has closed
         public static byte[] loadAll(InputStream in) {
              InfoFetcher fetcher = loadData(in);
              return fetcher.readCompletely();
         public static void copyBufs(byte src[], byte target[]) {
              int length = Math.min(src.length, target.length);
              for (int i = 0; i < length; i++) {
                   target[i] = src;
         * Not threaded by default. If you need this to run
         * in a separate, create a new thread or runnable class
         * @param in
         * @param out
         public static void pipe (InputStream in, OutputStream out) {
              pipe (in, out, TimeOut.NO_TIMEOUT);
         * Not threaded by default. If you need this to run
         * in a separate, create a new thread or runnable class
         * @param in
         * @param out
         public static void pipe (InputStream in, final OutputStream out, int timeout) {
              pipe (in, out, timeout, false);
         private static class PipeFetcher implements FetcherListener {
              OutputStream out;
              InputStream in;
              public IOException ex;
              boolean closeWhenDone;
              public PipeFetcher (InputStream in, OutputStream out, boolean closeWhenDone) {
                   this.out = out;
                   this.closeWhenDone = closeWhenDone;
              public void fetchedMore(byte[] buf, int start, int end) {
                   try {
                        out.write(buf, start, end - start);
                   catch (IOException iox) {
                        ex = iox;
                        try {
                             in.close();
                             out.close();
                        catch (IOException iox2) {
                             iox2.printStackTrace();
              public void fetchedAll(byte[] buf) {
                   if (closeWhenDone) {
                        try {
                             out.close();
                        catch (IOException iox) {
                             iox.printStackTrace();
         * Not threaded by default. If you need this to run
         * in a separate, create a new thread or runnable class
         * @param in
         * @param out
         public static IOException pipe (final InputStream in, final OutputStream out, int timeout, final boolean closeWhenDone) {
              InfoFetcher info = new InfoFetcher (in, new byte[DEFAULT_BUFFER_SIZE], timeout);
              PipeFetcher pf = new PipeFetcher(in, out, closeWhenDone);
              info.addFetcherListener(pf);
              info.run();
              return pf.ex;
              info.addInputStreamListener(new InputStreamListener() {
                   public void gotMore(InputStreamEvent ev) {
                        try {
                             out.write(ev.getBytes(), ev.getStart(), ev.getBytesRetrieved() - ev.getStart());
                        catch (IOException iox) {
                             System.err.println ("Pipe closing");
                   public void gotAll(InputStreamEvent ev) {}
              Thread t= new Thread (info);
              t.start();
         public static byte[] expandBuf(byte array[]) {
              return expandBuf(array, array.length * 2);
         public static byte[] expandBuf(byte array[], int newlength) {
              byte newbuf[] = new byte[newlength];
              copyBufs(array, newbuf);
              return newbuf;
         public static byte[] trimBuf(byte[] array, int size) {
              byte[] newbuf = new byte[size];
              for (int i = 0; i < size; i++) {
                   newbuf[i] = array[i];
              return newbuf;
         * @see getFileOutputStream(File, boolean)
         public static OutputStream getFileOutputStream(File file) throws IOException {
              return getFileOutputStream(file, true);
         * Convienience method for opening a FileOutputStream w/wo a buffer
         * makes sure that the file directory exists so this should always succeed.
         public static OutputStream getFileOutputStream(File file, boolean buffered) throws IOException {
              if (!file.exists() && !file.isDirectory()) {
                   confirmDirectoryExists(file.getParentFile());
              if (file.exists()) {
                   if (ALWAYS_BACKUP) {
                        file.renameTo(new File(file.getAbsolutePath() + "~"));
                   } else {
                        file.delete();
              file.createNewFile();
              OutputStream out = new FileOutputStream(file);
              if (buffered) {
                   out = new BufferedOutputStream(out);
              return out;
         * Confirms that a directory exists and makes it if it doesn't
         public static void confirmDirectoryExists(File dir) {
              if (!dir.exists()) {
                   confirmDirectoryExists(dir.getParentFile());
                   dir.mkdir();
              if (!dir.isDirectory()) {
                   confirmDirectoryExists(dir.getParentFile());
         public static OutputStream getFileOutputStream(String name) throws IOException {
              return getFileOutputStream(name, true);
         public static PrintStream getFilePrintStream(String file) throws IOException {
              return new PrintStream(getFileOutputStream(file));
         public static PrintStream getFilePrintStream(File file) throws IOException {
              return new PrintStream(getFileOutputStream(file));
         public static OutputStream getFileOutputStream(String name, boolean buffered) throws IOException {
              return getFileOutputStream(new File(name), buffered);
         * @param f if f is a directory it returns the absolue path to f otherwise it returns the absolute path to the directory f is in
         public static String getDirectory(File f) {
              if (f.isDirectory()) {
                   return f.getAbsolutePath();
              else {
                   return f.getParentFile().getAbsolutePath();
         * Get the file without the extension.
         * @see getFileNoExtension(String);
         public static String getFilenameNoExtension(File f) {
              return getFilenameNoExtension(f.getName());
         * Gets the file name without the extension
         * returns the whole file name if no '.' is found<br>
         * otherwise returns whatever's before the last .
         public static String getFilenameNoExtension(String s) {
              int idx = s.indexOf('.');
              if (idx == -1) {
                   return s;
              else {
                   return s.substring(0, idx);
         * gets the file extension
         * if a '.' character is found it returns what's after the last .
         * if not, it returns the empty string
         public static String getFileExtension(String s) {
              int idx = s.lastIndexOf('.');
              if (idx == -1) {
                   return "";
              else {
                   return s.substring(idx + 1);
         * @see getFileExtension(String)
         public static String getFileExtension(File f) {
              return getFileExtension(f.getName());
         * Delete everything in a directory. Recursively deletes all sub-directories
         public static void deleteDirectory (File f, Component parent) {
              if (!f.isDirectory()) {
                   throw new RuntimeException("File " + f.getAbsolutePath() + " is not a directory!");
              int val = JOptionPane.showConfirmDialog(parent, "Confirm Delete " + f.getAbsolutePath(), "Confirm Delete " + f.getAbsolutePath(), JOptionPane.OK_CANCEL_OPTION);
              if (val == JOptionPane.OK_OPTION) {
                   deleteAllFiles(f);
         private static void deleteAllFiles (File f) {
              //recursively delete all its contents
              if (!f.isDirectory()) {
                   //throw new RuntimeException("File " + f.getAbsolutePath() + " is not a directory!");
                   f.delete();
              else {
                   File[] files = f.listFiles();
                   for (int i = 0; i < files.length; i++) {
                        if (files[i].equals(f) || files[i].equals(f.getParent())) {
                             continue;
                        deleteAllFiles(files[i]);
                   f.delete();
         * static utility method for copying a file to another location
         public static void copyFile (File src, File newParent) throws FileNotFoundException {
              if (!src.exists()) {
                   return;
              if (!newParent.exists()) {
                   newParent.mkdirs();
                   //throw new RuntimeException("Parent folder must exist");
              if (newParent.isDirectory()) {
                   File newFile = new File(newParent, src.getName());
                   if (src.isDirectory()) {
                        newFile.mkdir();
                        File children[] = src.listFiles();
                        for (int i = 0; i < children.length; i++) {
                             copyFile(children[i], newFile);
                   else {
                        //loadFile
                        InfoFetcher info = loadData(new FileInputStream(src));
                        final BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(newFile));
                        info.addInputStreamListener(new InputStreamListener() {
                             int lastbytes = 0;
                             public void gotMore(InputStreamEvent ev1) {
                                  try {
                                       out.write(ev1.getBytes(), lastbytes, ev1.getBytesRetrieved() - lastbytes);
                                       lastbytes = ev1.getBytesRetrieved();
                                  catch (IOException iox) {
                                       iox.printStackTrace();
                             public void gotAll(InputStreamEvent ev2) {
         * @deprecated use the Find class
         public static File find(Pattern p, File start) {
              return recursiveFind(start, null, p, true);
         * @deprecated use the Find class
         public static File find(Pattern p) {
              return find(p, new File("."));
         * @deprecated use the Find class
         private static File recursiveFind(File current, File cameFrom, Pattern p, boolean startDescending) {
              Matcher m = p.matcher(current.getName());
              if (m.matches()) {
                   return current;
              File[] files = current.listFiles();
              if (startDescending) {
                   File value = descend(current, cameFrom, p, startDescending);
                   if (value != null) return value;
                   return ascend(current, cameFrom, p, startDescending);
              else {
                   File value = ascend(current, cameFrom, p, startDescending);
                   if (value != null) return value;
                   return descend(current, cameFrom, p, startDescending);               
         * @deprecated use the Find class
         private static File ascend(File current, File cameFrom, Pattern p, boolean startDescending) {
              File par = current.getParentFile();
              if (par == null) {
                   return null;
              par = par.getAbsoluteFile();
              if (par.equals(cameFrom)) {
                   return null;
              return recursiveFind(par, current, p, false);
         * @deprecated use the Find class
         private static File descend(File current, File cameFrom, Pattern p, boolean startDescending) {
              File files[] = current.listFiles();
              if (files == null) {
                   return null;
              for (int i = 0; i < files.length; i++) {
                   File child = files[i];
                   if (child.equals(cameFrom)) {
                        continue;
                   File f = recursiveFind(child, current, p, true);
                   if (f != null) {
                        return f;
              return null;
         * Utility for saving a string to a file. Rather than have to set
         * up all the writers etc and trap exceptions, just returns a boolean
         * if it worked
         * <p>
         * @see saveData(File, byte[])
         public static boolean saveData(File f, String s) {
              return saveData(f, s.getBytes());
         * Utility for saving a string to a file. Rather than have to set
         * up all the writers etc and trap exceptions, just returns a boolean
         * if it worked
         public static boolean saveData(File f, byte[] data) {
              try {
                   OutputStream out = new BufferedOutputStream(new FileOutputStream(f));
                   out.write(data);
                   out.close();
              catch(IOException iox) {
                   iox.printStackTrace();
                   return false;
              return true;
         * Way to save a stream to a file. Not multithreaded.
         * Will block until the save is done
         * @param f
         * @param in
         * @return
         public static boolean saveData(File f, InputStream in) throws FileNotFoundException {
              return pipe(in, new FileOutputStream(f), TimeOut.NO_TIMEOUT, true) == null;
              //InfoFetcher fetcher = loadData(in);
    //          try {
    //               FileOutputStream out = new FileOutputStream(f);
    //               fetcher.addFetcherListener(new FetcherListener() {
    //                    public void fetchedMore(byte[] buf, int start, int end) {
    //                    public void fetchedAll(byte[] buf) {
    //          } catch (IOException iox) {
    //               iox.printStackTrace();
    //               return false;
    //          return true;
         * @deprecated use Find
         public static List<File> findAllFiles(Pattern p) {
              ArrayList<File> l = new ArrayList<File>();
              //File start = File.listRoots()[0];
              File start = new File("C:\\");
              return recursiveFindAll(start, null, p, true, l, 0);
              //l;
         * @deprecated use Find
         private static List recursiveFindAll(File current, File cameFrom, Pattern p, boolean startDescending, ArrayList<File> list, int level) {
              //System.out.println("" + level + " Scanning: " + current + "par: " + cameFrom);
              System.out.println("Scanning: " + current);
              Matcher m = p.matcher(current.getName());
              if (current.getName().equals("C:\\")) {
                   System.out.println("root");
                   try {
                        System.in.read();
                   catch (IOException iox) {}
              if (m.matches()) {
                   //return current;
                   list.add(current);
                   System.out.println("Adding " + current);
              File[] files = current.listFiles();
              if (startDescending) {
                   //File value = descend(current, cameFrom, p, startDescending);
                   descendAll(current, cameFrom, p, startDescending, list, level + 1);
                   //ascendAll(current, cameFrom, p, startDescending, list, level + 1);
                   //if (value != null) return value;
                   //return ascend(current, cameFrom, p, startDescending);
              else {
                   //ascendAll(current, cameFrom, p, startDescending, list, level + 1);
                   descendAll(current, cameFrom, p, startDescending, list, level + 1);
                   //File value = ascend(current, cameFrom, p, startDescending);
                   //if (value != null) return value;
                   //return descend(current, cameFrom, p, startDescending);               
              return list;
         * @deprecated use Find
         private static List ascendAll(File current, File cameFrom, Pattern p, boolean startDescending, ArrayList<File> list, int level) {
              File par = current.getParentFile();
              if (par == null) {
                   return list;
              par = par.getAbsoluteFile();
              if (par.equals(cameFrom)) {
                   return list;
              recursiveFindAll(par, current, p, false, list, level);
              return list;
         * @deprecated use Find
         private static File descendAll(File current, File cameFrom, Pattern p, boolean startDescending, ArrayList<File> list, int level) {
              File files[] = current.listFiles();
              if (files == null) {
                   return null;
              for (int i = 0; i < files.length; i++) {
                   File child = files[i];
                   if (child.equals(cameFrom)) {
                        continue;
                   recursiveFindAll(child, current, p, true, list, level);
              return null;
         public File getUniqueName(File f) {
              return getUniqueName (f, new MessageFormat("~{0,number,integer}"));
         public String getNameWOExtension(File f, boolean useAbsolute) {
              int idx = f.getName().indexOf(".");
              return (idx == -1) ? (useAbsolute ? f.getAbsolutePath() : f.getName()) : (useAbsolute ? f.getAbsolutePath() : f.getName()).substring(0, (useAbsolute ? f.getAbsolutePath().lastIndexOf(".") : f.getName().lastIndexOf(".")));
         public String getFileType (File f, boolean includeDot) {
              int idx = f.getName().lastIndexOf(".");
              return idx == -1 ? "" : f.getName().substring(idx + (includeDot ? 0 : 1));
         public File getUniqueName(File f, MessageFormat format) {
              String base = getNameWOExtension(f, true);
              String extension = getFileType(f, true);
              int count = 0;
              while (f.exists()) {
                   count++;
                   f = new File (base + format.format(new Object[] {Integer.valueOf(count)}) + extension);
              return f;
         public static boolean isUTF16 (File f) throws IOException {
              FileInputStream in = null;
              try {
                   if (!f.exists() || f.length() < 2) return false;
                   in = new FileInputStream(f);
                   byte b = (byte)in.read();
                   if (!(b == -1)) return false;
                   b = (byte) in.read();
                   return b == -2;
              finally {
                   if (in != null) in.close();
         public static boolean isUTF16(PushbackInputStream in) {
              boolean got1 = false, got2 = false;
              byte b = 0, b2 = 0;
              try {
                   b = (byte)in.read();
                   got1 = true;
                   if (!(b == -1 || b== -2)) {
                        return false;
                   b2 = (byte) in.read();
                   got2 = true;
                   return b == -1 ? b2 == -2 : b2 == -1;
              catch (IOException iox) {
                   iox.printStackTrace();
              finally {
                   try {
                        if (got1) {
                             in.unread(b);
                        if (got2) {
                             in.unread(b2);
                   } catch (IOException iox) {
                        iox.printStackTrace();
              return false;
         public void saveJTableToCSV(JTable table, File f) throws IOException {
              if (table == null || f == null) return;
              TableModel model = table.getModel();
              if (model == null) return;
              int rows = model.getRowCount();
              int columns = model.getColumnCount();
              PrintWriter pw = new PrintWriter(new FileWriter(f));
              for (int i = 0; i < rows; i++) {
                   for (int j = 0; j < columns; j++) {
                        Object o = model.getValueAt(i, j);
                        pw.print(o.toString());
                        if (j != columns - 1) {
                             pw.print(",");
                   pw.println();
         public static String getPathRelativeTo(File path, File relativeTo) {
              return getPathRelativeTo(path.getAbsolutePath(), relativeTo.getAbsolutePath());
         public static String getPathRelativeTo(String path, String relativeTo) {
              if (!path.startsWith(relativeTo)) return null;
              path = path.substring(relativeTo.length());
              if (path.startsWith(File.separator)) path = path.substring(File.separator.length());
              return path;

  • XML Element to string conversion returning null

    Hi,
    When i try to convert XML Element to string using toString() API, it returns something like [device: null] where device is element tag.
    Code is as follows -
    Document xmlDoc;
    DOMParser parser = (DOMParser)Class.forName("org.apache.xerces.parsers.DOMParser").newInstance();
    parser.setFeature( "http://apache.org/xml/features/dom/defer-node-expansion", true );
    parser.parse(new InputSource(new StringReader(tableStr)));
    xmlDoc = parser.getDocument();
    Element root = xmlDoc.getDocumentElement();
    NodeList nodeList = root.getElementsByTagName("device");
    Element deviceNode = (Element)nodeList.item(nodeList.getLength()-1);
    System.out.println(deviceNode.toString()); //prints [device: null] ????
    System.out.println(deviceNode.getAttribute("ipAddress")); //prints correct ip address
    Any idea why i am getting [device: null] when trying to convert Element to String though attribute value is retrieved.
    Thanks,
    Deepak

    Hello ,
    I want to get the root node (<ZTOP60_XML_TAG_STRUCTURE>
    ) of the following xml file .
    <?xml version="1.0" encoding="utf-8"?>
    <ZTOP60_XML_TAG_STRUCTURE>
         <MSGTYPE>NAPOBACK</MSGTYPE>
         <SNDPRN>657393485</SNDPRN>
         <RECEIVER/>
         <RCVPRN>GSOHUBDM1</RCVPRN>
         <PONUM/>
         <VENDCODE>0020040266</VENDCODE>
         <VENDUNS>002601768</VENDUNS>
         <PARTNERFUNC_WE>WE</PARTNERFUNC_WE>
         <PARTNERNUM_WE>C240</PARTNERNUM_WE>
         <LINE_ITEMS>
              <item>
                   <ITEMNUM>00687</ITEMNUM>
                   <POQTY>999999999.000</POQTY>
                   <BOQTY>1.000</BOQTY>
                   <GRQTY>7.000</GRQTY>
                   <NETVAL>339.65</NETVAL>
                   <PLANT>C240</PLANT>
                   <MATNUM>FE-26865-01</MATNUM>
                   <MATDESC>PTR, T632, LEXMARK 5-BIN MAILBOX</MATDESC>
                   <PONUMBER>6500022388</PONUMBER>
                   <EKGRP>U17</EKGRP>
                   <DISPO>N07</DISPO>
              </item>
              <item>
                   <ITEMNUM>00178</ITEMNUM>
                   <POQTY>999999999.000</POQTY>
                   <BOQTY>1.000</BOQTY>
                   <GRQTY>303.000</GRQTY>
                   <NETVAL>18.62</NETVAL>
                   <PLANT>C240</PLANT>
                   <MATNUM>FE-ZZYRG-01</MATNUM>
                   <MATDESC>FDD,FDI-PC,1.44MB,3.5 ,HH</MATDESC>
                   <PONUMBER>6500022388</PONUMBER>
                   <EKGRP>U17</EKGRP>
                   <DISPO>N07</DISPO>
              </item>
              <item>
                   <ITEMNUM>00157</ITEMNUM>
                   <POQTY>999999998.000</POQTY>
                   <BOQTY>24.000</BOQTY>
                   <GRQTY>303.000</GRQTY>
                   <NETVAL>26.25</NETVAL>
                   <PLANT>C240</PLANT>
                   <MATNUM>FE-25094-01</MATNUM>
                   <MATDESC>MOUSE,PC,3BUT,,INTELLIMOUSE,PS2</MATDESC>
                   <PONUMBER>6500022388</PONUMBER>
                   <EKGRP>U17</EKGRP>
                   <DISPO>N07</DISPO>
              </item>
              <item>
                   <ITEMNUM>00881</ITEMNUM>
                   <POQTY>999999999.000</POQTY>
                   <BOQTY>1.000</BOQTY>
                   <GRQTY>62.000</GRQTY>
                   <NETVAL>368.80</NETVAL>
                   <PLANT>C240</PLANT>
                   <MATNUM>FD-66515-01</MATNUM>
                   <MATDESC>ITU MODULE ASM</MATDESC>
                   <PONUMBER>6500022388</PONUMBER>
                   <EKGRP>U17</EKGRP>
                   <DISPO>N07</DISPO>
              </item>
              <item>
                   <ITEMNUM>00223</ITEMNUM>
                   <POQTY>999999999.000</POQTY>
                   <BOQTY>1.000</BOQTY>
                   <GRQTY>377.000</GRQTY>
                   <NETVAL>459.28</NETVAL>
                   <PLANT>C240</PLANT>
                   <MATNUM>FD-65336-01</MATNUM>
                   <MATDESC>MAIN SYSTEM BOARD T23 (2647)</MATDESC>
                   <PONUMBER>6500022388</PONUMBER>
                   <EKGRP>U17</EKGRP>
                   <DISPO>N07</DISPO>
              </item>
              <item>
                   <ITEMNUM>00081</ITEMNUM>
                   <POQTY>999999999.000</POQTY>
                   <BOQTY>19.000</BOQTY>
                   <GRQTY>810.000</GRQTY>
                   <NETVAL>217.21</NETVAL>
                   <PLANT>C240</PLANT>
                   <MATNUM>FD-64199-01</MATNUM>
                   <MATDESC>QST- CADET 100</MATDESC>
                   <PONUMBER>6500022388</PONUMBER>
                   <EKGRP>U17</EKGRP>
                   <DISPO>N07</DISPO>
              </item>
              <item>
                   <ITEMNUM>00271</ITEMNUM>
                   <POQTY>999999999.000</POQTY>
                   <BOQTY>1.000</BOQTY>
                   <GRQTY>136.000</GRQTY>
                   <NETVAL>813.76</NETVAL>
                   <PLANT>C240</PLANT>
                   <MATNUM>FD-60065-01</MATNUM>
                   <MATDESC>SMART UPS 3000VA RM</MATDESC>
                   <PONUMBER>6500022388</PONUMBER>
                   <EKGRP>U17</EKGRP>
                   <DISPO>N07</DISPO>
              </item>
              <item>
                   <ITEMNUM>00791</ITEMNUM>
                   <POQTY>999999999.000</POQTY>
                   <BOQTY>1.000</BOQTY>
                   <GRQTY>3.000</GRQTY>
                   <NETVAL>201.73</NETVAL>
                   <PLANT>C240</PLANT>
                   <MATNUM>3X-PBXGG-AA</MATNUM>
                   <MATDESC>ATI 7500 PCI GRAPHICS</MATDESC>
                   <PONUMBER>6500022388</PONUMBER>
                   <EKGRP>U17</EKGRP>
                   <DISPO>N07</DISPO>
              </item>
              <item>
                   <ITEMNUM>00173</ITEMNUM>
                   <POQTY>999999999.000</POQTY>
                   <BOQTY>1.000</BOQTY>
                   <GRQTY>32.000</GRQTY>
                   <NETVAL>7.50</NETVAL>
                   <PLANT>C240</PLANT>
                   <MATNUM>12-56178-01</MATNUM>
                   <MATDESC>CARD GUIDE,SNAP-IN,LOW PROFILE,2.5 INCHE</MATDESC>
                   <PONUMBER>6500022388</PONUMBER>
                   <EKGRP>U17</EKGRP>
                   <DISPO>N07</DISPO>
              </item>
              <item>
                   <ITEMNUM>00309</ITEMNUM>
                   <POQTY>999999998.000</POQTY>
                   <BOQTY>15.000</BOQTY>
                   <GRQTY>71.000</GRQTY>
                   <NETVAL>51.23</NETVAL>
                   <PLANT>C240</PLANT>
                   <MATNUM>30-51476-01</MATNUM>
                   <MATDESC>VHDI-CABLE WIDE 12 FT. DT-AB001-TQ</MATDESC>
                   <PONUMBER>6500022388</PONUMBER>
                   <EKGRP>U17</EKGRP>
                   <DISPO>N07</DISPO>
              </item>
              <item>
                   <ITEMNUM>00194</ITEMNUM>
                   <POQTY>999999999.000</POQTY>
                   <BOQTY>1.000</BOQTY>
                   <GRQTY>147.000</GRQTY>
                   <NETVAL>345.48</NETVAL>
                   <PLANT>C240</PLANT>
                   <MATNUM>29-33689-01</MATNUM>
                   <MATDESC>PTR,IMP9,B/W,PAR/SER,110/240,R</MATDESC>
                   <PONUMBER>6500022388</PONUMBER>
                   <EKGRP>U17</EKGRP>
                   <DISPO>N07</DISPO>
              </item>
         </LINE_ITEMS>
    </ZTOP60_XML_TAG_STRUCTURE>
    I wrote the following lines of code ..
    FTI .. >> String strMsg =((javax.jms.TextMessage)msg).getText();
    StrMsg is a string that represents an xml file .
    DocumentBuilderFactory docfactory = DocumentBuilderFactory.newInstance();
                   DocumentBuilder builder = docfactory.newDocumentBuilder();
                   Document doc = builder.parse(new InputSource(new StringReader(strMsg)));
                   Element root = doc.getDocumentElement();
                   System.out.println("The root is " + root);
                   String strFileName = root+".xml" ;
                   System.out.println("The file name is " + strFileName);
                   File f = new File (strFileName);
                   FileOutputStream fos = new FileOutputStream( f );
                   for ( int j =0 ; j < strMsg.length(); j++)
                        char c = strMsg.charAt(j);
                        fos.write((int)c);
    I am getting the following error ...
    The root is [ZTOP60_XML_TAG_STRUCTURE: null]
    The file name is [ZTOP60_XML_TAG_STRUCTURE: null].xml
    Whey the file name or root is with special character [ ] and null ..
    I want just ZTOP60_XML_TAG_STRUCTURE.xml .
    Can anyone help me .
    thanks
    mahesh

  • Convert UTF-16 string  to UTF-8 or Hexadecimal

    we are working on SMS Application .we are sending UTF-8 bit it's working fine but we are try to send UTF-18 then we got unknow string. any body help me how to convet UTF-16 to UTF-8 or Hexadecimal.

    It is not clear to me what you are asking. I will assume that you have a String object and you want to get the utf-8 equivalent bytes so you can write them out to SMS. In Java, all String objects internally store the characters as UTF-18 and you can get the utf-8 equivalent using
    String s = ...
    byte[] utf8BytesOfS = s.getBytes("utf-8");
    Edited by: sabre150 on Aug 21, 2008 6:12 AM

  • Change db2 encoding to utf in String field

    Hi Gurus,
    We need to retrieve a field from db2 and send it to Siebel via Web Service in order to insert that data. We are having trouble with the encoding and we were wondering if there is any function to change encoding from db2 to utf so we can add it to our xml.
    We believe that changing the encoding will insert it propperly in Siebel.
    Thank you very much,
    Alvaro

    Hi Alvaro,
    What is the technology of your staging area ?
    In Oracle, you have a function to do that kind of change : http://docs.oracle.com/cd/B28359_01/server.111/b28286/functions027.htm .
    If your staging is not Oracle, you can probably find something similar.
    You can apply it to all your string mappings. If you always use that function for string data with these technology, you can also edit your KM and put the function in it.
    Regards,
    JeromeFr

Maybe you are looking for

  • How to default a check box?

    Hi,   How to default a check box? Regards, Jaya

  • Lot Size Check at Good Receipt in MIGO

    How can I check lot sizes at the point of GR within MIGO? (as oppose to qty tolerances). Example, if my lot size is 100 and I raise a PO for 100 at the GR is for qty 80 (i.e not a complete lot size, which could mean a split pack) how can I get the sy

  • Callback problem

    hi! can any onr help me with a callback problem. Pc dialing into router via ISDN doesnt work with callback but works without it.

  • Creating User with identical attributes

    How do I create a New User who has the same Preferences and Permissions as an already existing user? iMac Intel   Mac OS X (10.4.9)  

  • Moving Catalog PSE8

    I am going to move my catalog (15K) from one internal drive to another on my PC.  I recently moved from PSE6 to 8 and my question is, after I convert my catalog from 6 to 8 do I simply do a full back up and restore it to the new drive?  If that is th