Binary to XMl Conversion

Hi All,
I am trying to convert data from internal table to Binary and then taking the same in the XML format for Display.
Steps 1 : from internal table to Binary conversion.
create & set encoding
lo_encoding = lo_ixml->create_encoding(
                   byte_order    = if_ixml_encoding=>co_none
                   character_set = 'UTF-8' ).
   CALL METHOD lo_xml_doc->m_document->set_encoding(
                 encoding = lo_encoding ).
create output stream...
   lo_stream_fact = lo_ixml->create_stream_factory( ).
   lo_ostream = lo_stream_fact->create_ostream_xstring(
                  string = e_xml ).
data : i_size like SY-TABIX .
CALL METHOD lo_xml_doc->RENDER_2_XSTRING(
IMPORTING
stream = e_xml
RETCODE = gd_rc
SIZE = i_size ).
   x_test-e_xml = e_xml.   
Step 2 : We are moving the same to application server using Legacy Binary mode 
Step 3 : Again by some another report we are reading the file.
  OPEN DATASET XYZ FOR INPUT IN LEGACY BINARY MODE.  
Step 4 : And finally converting the binary data in XML for display.
CLASS cl_ixml DEFINITION LOAD.
lp_ixml           = cl_ixml=>create( ).
  lp_xml_document   = lp_ixml->create_document( ).
  lp_stream_factory = lp_ixml->create_stream_factory( ).
create input stream from lt_data...
lp_istream = lp_stream_factory->create_istream_xstring(
                                    string = l_xdata ).
define parser...
lp_parser  = lp_ixml->create_parser(
                         document       = lp_xml_document
                         istream        = lp_istream
                         stream_factory = lp_stream_factory ).
parse input stream --> fills lp_xml_document...
  ld_rc = lp_parser->parse( ).
  IF ld_rc <> 0.
    MESSAGE e000(ydb0060) WITH 'lp_parser->parse( )'.
    EXIT.
  ENDIF.
  CALL METHOD lo_xml_doc->create_with_dom( document = lp_xml_document ).
  CALL METHOD lo_xml_doc->display( ).
My Problem is,
Say I got 2 field in internal table Desc and Value.
IT-DESC = 'Test' .
IT-VALUE = '' .
here the system should show me
<item>
  <DESC>Test</DESCR>
  <VALUE />
  </item>
but it is showing as
<item>
  <DESC>Test</DESCR>
  </item>
If the value field is blank then <VALUE /> is not getting displayed in XML
Please guide,
Thanks & Regards,
Swapnil

I've run into the same issue, and in response to why I would want to revert back to CLOB storage; it's because there seems to be a 32k limit on the content in the XMLType column when using binary storage.
Previously in 11.2.0.1 we have no issues with this length of xml data stored in clob format but since moving one db to 11.2.0.2 the database completely dies when trying to read that column with >32k data length.
DB dies with either:
ORA-00600: internal error code, arguments: [kpolcsc1], [0], [], [], [], [], [], [], [], [], [], []
or
ORA-00600: internal error code, arguments: [kpolcbLobRead1: invalid len & bufp], [], [], [], [], [], [], [], [], [], [], []
And I don't find any articles on MOS either searching the knowledge base or using the ora-600 lookup tool that aren't already fixed: kpolcsc1 was fixed in 11.1.0.6 according to ora-600 lookup tool.
I would prefer to keep binary storage, and not have to revert to clob, but if I can't found a solution to 32k limit then im going to have to revert storage type.

Similar Messages

  • Issue in Excel to XML Conversion

    Hi Gurus,
    I am creating a custom java module in sap nwds 7.3 for Excel to XML Conversion. But I am getting following error
    Classpath dependency validator message.
    Classpath entry  will not be exported or published. Runtime ClassNotFoundExceptions may result.
    I imported the Jars from a different PI system and i am using NWDS in local PC with creating a separate folder with all JARs and also imported them using build path option.
    This issue is occuring for all the jars imported.
    I am using following code.
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.AbstractTrace;
    import java.util.HashMap;
    import jxl.Cell;
    import jxl.Workbook;
    public class JavaMappingExcelToXML implements StreamTransformation{
    private Map map = null;
    private AbstractTrace trace = null;
    public void setParameter(Map arg0) {
    map = arg0; // Store reference to the mapping parameters
    if (map == null) {
    this.map = new HashMap();
    public static void main(String args[]) { //FOR EXTERNAL STANDALONE TESTING
    try {
    FileInputStream fin = new FileInputStream ("c:/ashu.xls"); //INPUT FILE (PAYLOAD)
    FileOutputStream fout = new FileOutputStream ("C:/Users/ashutosh.a.upadhyay/My Documents/ashuXML2.xml"); //OUTPUT FILE (PAYLOAD)
    JavaMappingXLStoXML mapping = new JavaMappingXLStoXML ();
    mapping.execute(fin, fout);
    catch (Exception e1) {
    e1.printStackTrace();
    public void execute(InputStream inputstream, OutputStream outputstream) {
    String msgType = "Message Type name will come here";
    String nameSpace = "Namespace Name will come here";
    String xmldata = "";
    try {
    Workbook wb = Workbook.getWorkbook(inputstream);
    xmldata ="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+ "<ns0:"+msgType+" "+"xmlns:ns0=\""+nameSpace+"\n">";
    Cell[] cells ;
    Cell[] cellNames ;
    cellNames = wb.getSheet(0).getRow(0);
    for(int j=1;j<wb.getSheet(0).getRows();j++){
    xmldata = xmldata+"\n<Record>\n";
    cells = wb.getSheet(0).getRow(j);
    for(int i=0;i<wb.getSheet(0).getColumns();i++){
    xmldata = xmldata+"\t<"+cellNames[i].getContents()+">"+cells[i].getContents()+"</"+cellNames[i].getContents()+">\n";
    xmldata = xmldata+"</Record>";
    xmldata = xmldata+"\n</ns0:"+msgType+">";
    System.out.print(xmldata);
    xmldata.getBytes();
    wb.close();
    byte by[] = xmldata.getBytes();
    outputstream.write(by);
    inputstream.close();
    outputstream.close();
    System.out.println("\n"+"File processed");
    catch (Exception e) {
    e.printStackTrace();
    Request you to guide how to resolve this issue.
    Thanks  in advance

    Thanks Anand,
    PDF shared by you was extremely helpful. Now I have successfully developed and deployed the adapter. But while using it in Communication Channel I am getting following error.
    Error: com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception during lookup operation of object with name localejbs/ExcelToXML, cannot resolve object reference. [Root exception is javax.naming.NamingException: Error occurs while the EJB Object Factory trying to resolve JNDI reference Reference Class Name: Type: clientAppName Content: sap.com/SAP_Exel_To_XMLEAR Type: interfaceType Content: local Type: ejb-link Content: Excel_To_XML Type: jndi-name Content: ExcelToXML Type: local-home Content: sap.com.excelToXML.Excel_To_XMLLocalHome Type: local Content: sap.com.excelToXML.Excel_To_XMLLocal com.sap.engine.services.ejb3.runtime.impl.refmatcher.EJBResolvingException: Cannot start applicationsap.com/SAP_Exel_To_XMLEAR; nested exception is: java.rmi.RemoteException: [ERROR CODE DPL.DS.6125] Error occurred while starting application locally and wait.; nested exception is: com.sap.engine.services.deploy.exceptions.ServerDeploymentException: [ERROR CODE DPL.DS.5029] Exception in operation [startApp] with application [sap.com/SAP_Exel_To_XMLEAR]. at com.sap.engine.services.ejb3.runtime.impl.DefaultContainerRepository.startApp(DefaultContainerRepository.java:398) at com.sap.engine.services.ejb3.runtime.impl.DefaultContainerRepository.getEnterpriseBeanContainer(DefaultContainerRepository.java:182) at com.sap.engine.services.ejb3.runtime.impl.DefaultRemoteObjectFactory.resolveReference(DefaultRemoteObjectFactory.java:55) at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:144) at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:63) at com.sap.engine.system.naming.provider.ObjectFactoryBuilderImpl._getObjectInstance(ObjectFactoryBuilderImpl.java:76) at com.sap.engine.system.naming.provider.ObjectFactoryBuilderImpl.access$100(ObjectFactoryBuilderImpl.java:33) at com.sap.engine.system.naming.provider.ObjectFactoryBuilderImpl$DispatchObjectFactory.getObjectInstance(ObjectFactoryBuilderImpl.java:226) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:283) at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:434) at com.sap.engine.services.jndi.implclient.OffsetClientContext.lookup(OffsetClientContext.java:223) at com.sap.engine.services.jndi.implclient.OffsetClientContext.lookup(OffsetClientContext.java:242) at javax.naming.InitialContext.lookup(InitialContext.java:351) at javax.naming.InitialContext.lookup(InitialContext.java:351) at com.sap.aii.af.lib.util.ejb.FastEjbFactory.createEjbInstance(FastEjbFactory.java:69) at com.sap.aii.af.lib.util.ejb.FastEjbFactory.createEjbInstance(FastEjbFactory.java:50) at com.sap.aii.af.app.mp.ejb.ModuleProcessorBean.getModuleLocal(ModuleProcessorBean.java:419) at com.sap.aii.af.app.mp.ejb.ModuleProcessorBean.process(ModuleProcessorBean.java:287) at sun.reflect.GeneratedMethodAccessor946.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:592) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:46) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:74) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:38) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:22) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:191) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:23) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:21) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179) at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:133) at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164) at com.sun.proxy.$Proxy3299.process(Unknown Source) at com.sap.aii.adapter.file.File2XI.send(File2XI.java:3605) at com.sap.aii.adapter.file.File2XI.processFileList(File2XI.java:1374) at com.sap.aii.adapter.file.File2XI.invoke(File2XI.java:669) at com.sap.aii.af.lib.scheduler.JobBroker$Worker.run(JobBroker.java:534) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:182) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:280) ]
    pl
    please help

  • Date format in XML conversion

    Hello,
    I am using oracle8i. The date format is not giving the proper date values in XML conversion..
    create table test(dt date);
    insert into test values(sysdate);
    insert into test values(sysdate);
    insert into test values(sysdate);
    TEST.WORLD> select * from test;
    DT
    28-NOV-04
    28-NOV-04
    28-NOV-04
    set autoprint on
    set long 100000
    set linesize 100000
    set longchunksize 100000
    var g_clob clob
    declare
    l_ctx dbms_xmlquery.ctxType;
    l_clob clob;
    begin
    l_ctx := dbms_xmlquery.newContext('select dt from test');
    dbms_lob.createtemporary(:g_clob,true,dbms_lob.session);
    dbms_xmlquery.setdateformat(l_ctx,'yyyy-mm-dd');
    :g_clob := dbms_xmlquery.getXml(l_ctx);
    end;
    Here is the output . It is dispalying the 03 For the month november.
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <DT>2004-03-28</DT>
    </ROW>
    <ROW num="2">
    <DT>2004-03-28</DT>
    </ROW>
    <ROW num="3">
    <DT>2004-03-28</DT>
    </ROW>
    </ROWSET>

    When you call DBMS_XMLQUERY.SETDATEFORMAT, you must supply the mask using the syntax defined by java.text.SimpleDateFormat.
    You need to use "yyyy-MM-dd".
    In your case, "yyyy-mm-dd", the lower case "mm" is the mask for minutes.

  • JAVA Mapping for XML conversion during runtime

    Dear SAP JAVA experts,
    For quite I have been struggling to keep the JAVA code in place for JSON to XML conversion being a newbie.
    Following is the code snippet.
    import java.io.InputStream;
    import net.sf.json.JSON;
    import net.sf.json.JSONSerializer;
    import net.sf.json.xml.XMLSerializer;
    import org.apache.commons.io.IOUtils;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    import com.sap.aii.utilxi.core.io.IOUtil;
    public class RuntimeJSONtoXML extends AbstractTransformation {
      public void transform(TransformationInput input, TransformationOutput output)
      throws StreamTransformationException {
      try
    //InputStream is = JSONtoXML.class.getResourceAsStream("JSON.txt");
       String strJSON = "";
       InputStream inputStream = input.getInputPayload().getInputStream();
       inputStream.close();
       String jsonData = IOUtils.toString(strJSON);
               XMLSerializer serializer = new XMLSerializer();
               JSON json = JSONSerializer.toJSON( jsonData );
               String xml = serializer.write( json );
               //System.out.println(xml);
               output.getOutputPayload().getOutputStream().write(strJSON.getBytes());
      catch(Exception ie) { }
    Caught unaware of 2 queries.
    1.I have added the com.sap.aii.utilxi.core.io.IOUtil jar files from the PI server even though its displays error "The com.sap.aii.utilxi can not be resolved". Also I added the XPI libraries in NWDS but nothing moving to solve the issue.
    2. I have commented the line of code where I have placed a test file in the path to test it i.e. JSON.text. But when it is deployed as Archived files, then this code has to be replaced.
    The Method toString(InputStream) in the type IOUtils is not applicable for the arguments (String)
    Regards
    Rebecca..

    1.I have added the com.sap.aii.utilxi.core.io.IOUtil jar files from the PI server even though its displays error "The com.sap.aii.utilxi can not be resolved". Also I added the XPI libraries in NWDS but nothing moving to solve the issue.
    Which jar file did you add?
    /usr/sap/<<SID>>/DVEBMGS<<SYSNO>>/j2ee/cluster/bin/ext/com.sap.xi.util.misc/lib
    jar file name : com.sap.aii.utilxi.core.jar
    2. I have commented the line of code where I have placed a test file in the path to test it i.e. JSON.text. But when it is deployed as Archived files, then this code has to be replaced.
    The Method toString(InputStream) in the type IOUtils is not applicable for the arguments (String)
    To read the input stream you should have
    InputStream inputstream = transformationInput.getInputPayload().getInputStream();
    Please refer to below blog just to get an idea on working with input stream and output stream.
    Dynamic file name for pass-through scenario - Process Integration - SCN Wiki

  • Mapping error in FCC to XML conversion

    hiii friends,
    im donig a simple fcc to xml conversion
    my Sender msg type is like
    TXT_mt
          records                             1.1   
                row                             1.n
                    id                             1
                    Name                       1
                    address                   1
    My receiver msg type like
    Xml_mt
          records                             1.1   
                row                             1.n
                    id                             1
                    Name                       1
                    address                   1
    msg mapping like
    records--->records
    id--->id
    Name-->Name
    address-->address
    **Im getting a mapping error like**
    <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>Application</SAP:Category>
      <SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
      <SAP:P1>com/sap/xi/tf/_pepsi_fcc_file_mm_</SAP:P1>
      <SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
      <SAP:P3>RuntimeException in Message-Mapping transformatio~</SAP:P3>
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>During the application mapping com/sap/xi/tf/_pepsi_fcc_file_mm_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformatio~</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    I ve checked my adapeters they r green.
    Could u tell me the problem here and how to solve it???
    Regards
    Balaji

    Hii Volker,
    I have tried to understand the trace msg,. i got one interesting error message i hope it will tell the exact problem im facing,,,
    <Trace level="1" type="T">RuntimeException during appliction Java mapping com/sap/xi/tf/_pepsi_fcc_file_mm_</Trace>
      <Trace level="1" type="T">com.sap.aii.utilxi.misc.api.BaseRuntimeException: RuntimeException in Message-Mapping transformation: Cannot produce target element /ns:xml_mt/record/row. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd at com.sap.aii.mappingtool.tf3.AMappingProgram
    My Sender CC  contains the following FCC parameters
    Document Name -
    > txt_mt
    Recordset Name -
    > records
    recordset Structure -
    >  row, *
    row.fieldNames -
    > id, Names,address
    row.fieldSeparator -
    > , (comma)
    row.endSeparator--- >  'nl'
    row.processConfiguration  -
    > FromConfiguration
    my TXT_in.txt contain
    100,balaji,chennai
    200,raj,orissa
    300,charakrat,bangalore
    Regards,
    Balaji
    Edited by: Balaji Pichaimuthu on Jul 1, 2009 3:44 PM

  • Creating a custom java module for excel to xml conversion.

    Hi Gurus,
    I am creating a custom java module in sap nwds 7.3 for Excel to XML Conversion. But I am getting following error
    Classpath dependency validator message.
    Classpath entry  will not be exported or published. Runtime ClassNotFoundExceptions may result. 
    I imported the Jars from a different PI system and i am using NWDS in local PC with creating a separate folder with all JARs and also imported them using build path option.
    This issue is occuring for all the jars imported.
    I am using following code.
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.AbstractTrace;
    import java.util.HashMap;
    import jxl.Cell;
    import jxl.Workbook;
    public class JavaMappingExcelToXML implements StreamTransformation{
    private Map map = null;
    private AbstractTrace trace = null;
    public void setParameter(Map arg0) {
    map = arg0; // Store reference to the mapping parameters
    if (map == null) {
    this.map = new HashMap();
    public static void main(String args[]) { //FOR EXTERNAL STANDALONE TESTING
    try {
    FileInputStream fin = new FileInputStream ("c:/ashu.xls"); //INPUT FILE (PAYLOAD)
    FileOutputStream fout = new FileOutputStream ("C:/Users/ashutosh.a.upadhyay/My Documents/ashuXML2.xml"); //OUTPUT FILE (PAYLOAD)
    JavaMappingXLStoXML mapping = new JavaMappingXLStoXML ();
    mapping.execute(fin, fout);
    catch (Exception e1) {
    e1.printStackTrace();
    public void execute(InputStream inputstream, OutputStream outputstream) {
    String msgType = "Message Type name will come here";
    String nameSpace = "Namespace Name will come here";
    String xmldata = "";
    try {
    Workbook wb = Workbook.getWorkbook(inputstream);
    xmldata ="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+ "<ns0:"+msgType+" "+"xmlns:ns0=\""+nameSpace+"\n">";
    Cell[] cells ;
    Cell[] cellNames ;
    cellNames = wb.getSheet(0).getRow(0);
    for(int j=1;j<wb.getSheet(0).getRows();j++){
    xmldata = xmldata+"\n<Record>\n";
    cells = wb.getSheet(0).getRow(j);
    for(int i=0;i<wb.getSheet(0).getColumns();i++){
    xmldata = xmldata+"\t<"+cellNames[i].getContents()+">"+cells[i].getContents()+"</"+cellNames[i].getContents()+">\n";
    xmldata = xmldata+"</Record>";
    xmldata = xmldata+"\n</ns0:"+msgType+">";
    System.out.print(xmldata);
    xmldata.getBytes();
    wb.close();
    byte by[] = xmldata.getBytes();
    outputstream.write(by);
    inputstream.close();
    outputstream.close();
    System.out.println("\n"+"File processed");
    catch (Exception e) {
    e.printStackTrace();
    Request you to guide how to resolve this issue.
    Thanks  in advance

    Hi Gurus,
    I am creating a custom java module in sap nwds 7.3 for Excel to XML Conversion. But I am getting following error
    Classpath dependency validator message.
    Classpath entry  will not be exported or published. Runtime ClassNotFoundExceptions may result. 
    I imported the Jars from a different PI system and i am using NWDS in local PC with creating a separate folder with all JARs and also imported them using build path option.
    This issue is occuring for all the jars imported.
    I am using following code.
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.AbstractTrace;
    import java.util.HashMap;
    import jxl.Cell;
    import jxl.Workbook;
    public class JavaMappingExcelToXML implements StreamTransformation{
    private Map map = null;
    private AbstractTrace trace = null;
    public void setParameter(Map arg0) {
    map = arg0; // Store reference to the mapping parameters
    if (map == null) {
    this.map = new HashMap();
    public static void main(String args[]) { //FOR EXTERNAL STANDALONE TESTING
    try {
    FileInputStream fin = new FileInputStream ("c:/ashu.xls"); //INPUT FILE (PAYLOAD)
    FileOutputStream fout = new FileOutputStream ("C:/Users/ashutosh.a.upadhyay/My Documents/ashuXML2.xml"); //OUTPUT FILE (PAYLOAD)
    JavaMappingXLStoXML mapping = new JavaMappingXLStoXML ();
    mapping.execute(fin, fout);
    catch (Exception e1) {
    e1.printStackTrace();
    public void execute(InputStream inputstream, OutputStream outputstream) {
    String msgType = "Message Type name will come here";
    String nameSpace = "Namespace Name will come here";
    String xmldata = "";
    try {
    Workbook wb = Workbook.getWorkbook(inputstream);
    xmldata ="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+ "<ns0:"+msgType+" "+"xmlns:ns0=\""+nameSpace+"\n">";
    Cell[] cells ;
    Cell[] cellNames ;
    cellNames = wb.getSheet(0).getRow(0);
    for(int j=1;j<wb.getSheet(0).getRows();j++){
    xmldata = xmldata+"\n<Record>\n";
    cells = wb.getSheet(0).getRow(j);
    for(int i=0;i<wb.getSheet(0).getColumns();i++){
    xmldata = xmldata+"\t<"+cellNames[i].getContents()+">"+cells[i].getContents()+"</"+cellNames[i].getContents()+">\n";
    xmldata = xmldata+"</Record>";
    xmldata = xmldata+"\n</ns0:"+msgType+">";
    System.out.print(xmldata);
    xmldata.getBytes();
    wb.close();
    byte by[] = xmldata.getBytes();
    outputstream.write(by);
    inputstream.close();
    outputstream.close();
    System.out.println("\n"+"File processed");
    catch (Exception e) {
    e.printStackTrace();
    Request you to guide how to resolve this issue.
    Thanks  in advance

  • Seeburger EDI Text to EDI XML conversion failure should throw an error

    Hi,
    I am expecting an error message to be thrown when EDI Text to EDI XML conversion fails at Message splitter of Seeburger module. I am getting the following error in the log.
    "2012-01-19T01:46:08.032-0800 ERROR [Error:ID=2150;LEVEL=3] counter value (41) of incoming field (UNB.UNH.UNT:0074) doesnt match the calculated value (39).
    DESCRIPTION: Either the counter value is not filled in the source file or the counter field value is wrong. "
    But my expectation is that the channel should show some error in Adapter Engine monitoring itself. As shown below, it is just showing some warning that because of above error, it is not creating the attachment. Now I am expecting the the following warning to be an error rather than just warning. Please let me know if any idea on the same.
    19.01.2012 01:46:08 Information SEEBURGER/MESSAGESPLITTER: Trying to establish CCI Connection to Message Splitter Adapter
    19.01.2012 01:46:08 Information SEEBURGER/MESSAGESPLITTER: Creating CCI Interaction
    19.01.2012 01:46:08 Warning SEEBURGER/MESSAGESPLITTER: There is no attachment to split. So there is nothing to do.
    19.01.2012 01:46:08 Information SEEBURGER/MESSAGESPLITTER: Finished splitting!
    BR,
    Aman

    Thanks you all for your inputs..
    I got the solution for the same.
    I need to set the mapping program name specifically rather than AUTO for bic mappingName parameter. This has turned my communication channel status in RWB into Red for errors.
    Closing this thread ...
    Regards,
    Aman

  • Flat files to XML conversion module?

    Hi Experts,
    I would like to know from where I can have free download for flat files to XML conversion module which I can test in development server. Your help will be well appreciated.
    Thanks and Regards,
    Praveen.

    u have file adapter with FCC which does the flat file to XML conversion. wat is ur requirement?
    refer the help or search on SDN for file content conversion.
    http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm
    few examples:-
    Introduction to simple(File-XI-File)scenario and complete walk through for starters(Part1)
    Key value:
    How to send a flat file with various field lengths and variable substructures to XI 3.0
    File Receiver with Content Conversion
    chirag

  • Error in Idoc to XML conversion

    Hi,
    I am doing Idoc to XML conversion using standard program RSEINB00. Can anyone plz tell me what are the pre-requisites to executing this program? I am getting an error message Port XXX segment defn YYYYY in IDoc type ZZZZZ CIM type do not exist.
    Why am i getting this error? and what is the slution for it?
    Regards,
    Mateen.

    Hi
    Delete the metadata in IDX2 for the corresponding IDOC type in PI.
    Also re-import the same in IDX2.
    Reimport the IDOC type into Integration Repository under your SWCV.
    Then check it..
    Refresh the cache also.

  • ResultSet XML Conversion Error

    Hi,
    BPEL, SOA 11g, DB2 Stored procedure,
    In a BPEL service I am getting this error while invoking a DB2 Stored procedure with Strong XSD. I am using assign to copy the input parameter to the input parameters of Stored procedure.
    not able to figure out why this error message is coming.
    java.lang.Exception: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'JDE_DBA' failed due to: ResultSet XML Conversion Error. An error occurred while converting from a ResultSet to XML. Unable to convert a ResultSet to XML. Cause: java.lang.NullPointerException ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeOperation(WSTestModel.java:575) at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:381) at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:298) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.el.parser.AstValue.invoke(AstValue.java:157) at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283) a
    ---------------- BPEL Code --------
    <?xml version = "1.0" encoding = "UTF-8" ?>
    <!--
    Oracle JDeveloper BPEL Designer
    Created: Fri Dec 10 10:24:23 PST 2010
    Author: chaitanyad
    Purpose: Synchronous BPEL Process
    -->
    <process name="UPCMatchOrder"
    targetNamespace="http://xmlns.oracle.com/CD_JDE_Application_jws/JDE_UPCMatchOrder/UPCMatchOrder"
    xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:client="http://xmlns.oracle.com/CD_JDE_Application_jws/JDE_UPCMatchOrder/UPCMatchOrder"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/db/CD_JDE_Application/JDE_UPCMatchOrder/JDE_DBA"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ns2="http://xmlns.oracle.com/pcbpel/adapter/db/QAMODA73/X56714P/">
    <!--
    PARTNERLINKS
    List of services participating in this BPEL process
    -->
    <partnerLinks>
    <!--
    The 'client' role represents the requester of this service. It is
    used for callback. The location and correlation information associated
    with the client role are automatically set using WS-Addressing.
    -->
    <partnerLink name="upcmatchorder_client" partnerLinkType="client:UPCMatchOrder" myRole="UPCMatchOrderProvider"/>
    <partnerLink name="JDE_DBA" partnerRole="JDE_DBA_role"
    partnerLinkType="ns1:JDE_DBA_plt"/>
    </partnerLinks>
    <!--
    VARIABLES
    List of messages and XML documents used within this BPEL process
    -->
    <variables>
    <!-- Reference to the message passed as input during initiation -->
    <variable name="inputVariable" messageType="client:UPCMatchOrderRequestMessage"/>
    <!-- Reference to the message that will be returned to the requester-->
    <variable name="outputVariable" messageType="client:UPCMatchOrderResponseMessage"/>
    <variable name="Invoke_1_InputVariable" messageType="ns1:args_in_msg"/>
    <variable name="Invoke_1_OutputVariable" messageType="ns1:args_out_msg"/>
    </variables>
    <!--
    ORCHESTRATION LOGIC
    Set of activities coordinating the flow of messages across the
    services integrated within this business process
    -->
    <sequence name="main">
    <!-- Receive input from requestor. (Note: This maps to operation defined in UPCMatchOrder.wsdl) -->
    <receive name="receiveInput" partnerLink="upcmatchorder_client" portType="client:UPCMatchOrder" operation="process" variable="inputVariable" createInstance="yes"/>
    <!-- Generate reply to synchronous request -->
    <assign name="Assign_3">
    <copy>
    <from variable="inputVariable" part="InputMessage"/>
    <to variable="Invoke_1_InputVariable" part="InputParameters"/>
    </copy>
    </assign>
    <invoke name="Invoke_1" inputVariable="Invoke_1_InputVariable"
    outputVariable="Invoke_1_OutputVariable" partnerLink="JDE_DBA"
    portType="ns1:JDE_DBA_ptt" operation="JDE_DBA"/>
    <assign name="Assign_2">
    <copy>
    <from variable="Invoke_1_OutputVariable" part="OutputParameters"/>
    <to variable="outputVariable" part="OutputMessage"/>
    </copy>
    </assign>
    <reply name="replyOutput" partnerLink="upcmatchorder_client" portType="client:UPCMatchOrder" operation="process" variable="outputVariable"/>
    </sequence>
    </process>
    Regards,
    -CD

    Hi Sanjay,
    The JDBC sender adapter returns the rows selected from the database in the follwoing format.
    <resultset>
    <row>
    <column-name1>column-value</ column-name1>
    <column-name2>column-value</ column-name2>
    <column-name3>column-value</ column-name3>
    </row>
    <row>
    <column-name1>column-value</ column-name1>
    <column-name2>column-value</ column-name2>
    <column-name3>column-value</ column-name3>
    </row>
    </resultset>
    This error occurs , when the source datatype you have created for the JDBC adapter does not match with this format. I would suggest that you check the source format along with the occurence of your field.
    Regards,
    Bhavesh

  • String (binary) to boolean conversion problem.

    Hello,
    Im facing problems converting a string (presumably in the binary format) to turn on LEDs according to its respective weight. ie.binary input = 1010. Thereby it would turn on the first (MSB) and third LEDs while the second and third are left off.
    What I have managed to obtain is a direct conversion of decimal to binary but have not much idea on how to achieve the above goal. The attached file shows two operations; top part does the boolean to binary conversion is fine. The bottom is supposed to be the binary to boolean conversion.
    Attachments:
    boolean to string.vi ‏21 KB

    OK, let's back up a second here. I don't understand what your "boolean to string" VI is doing. Are you starting with a string, a number, or a bunch of Boolean controls? The top part is dealing with Boolean controls and creating a string of characters of "0" and "1". The bottom part you have a numeric control. By the way, it is pointless to take the output of Number to Boolean Array, converting it to an array of 0s and 1s, indexing out each element, and then using the Not Equal to Zero operator. Just take the Boolean array output from Number to Boolean Array directly into an Index Array!
    You seem to be saying that you have a string in the binary format. This is somewhat meaningless, so I'm assuming you mean you have a string that consists of a sequence of the ASCII characters "1" and "0" to indicate a numerical 1 or 0. You then want to convert this into something that is programmatically useful. What that is is not clear, so let's assume an array of Booleans. If that's the case, then you can simply take advantage of the fact that you're starting out with ASCII characters, and use the ASCII codes to find out what you have. The ASCII code for the character "0" is 30 (hex) or 48 (decimal). The ASCII code for the character "1" is 31 (hex) or 49 (decimal). Assuming this is what you have and what you want, then you can simply do this:
    Attachments:
    Example_VI.png ‏8 KB

  • Binary to Voltage Conversion of encoder data on cRio 9073 using FPGA

    I am using FPGA with a cRio 9073 to acquire torque and absolute quadrature encoder values. It says in the FPGA instructions that the documentation for the 9073 should include the binary to voltage conversion, but when I looked at the documentation, it wasn't there. Where can I find the conversion value or function to convert binary encoder data back to voltage? The encoder is hooked up to an analog converter and is acquired with a 9215 AI (+-10V differential). Thanks

    There are individual formulas for one or a group of modules.
    LabView examples path:
    LabVIEW 2010\examples\CompactRIO\Basic IO\Analog Raw Host Calibration\AI Raw Host Calibration
    LabView help topic 
    Converting and Calibrating CompactRIO Analog Input Values (FPGA
    Interface)
    Best regards
    Christian

  • CDATA issue in RFC XML conversion

    Hi all,
    I am trying to consume a webservice from ABAP. One of the webservice method responds with a data holding an xml fragment under the tags CDATA, like,
    <!CDATA[[<?xml version="1.0" encoding=.....]]>
    But the program throws exception during RFC XML conversion.
    However i could find the correct response payload in the error log in ST11 transaction.
    Pls advice.

    Hi,
    as this is not a proper CDATA
    try:
    <![CDATA[ cdata text ]]>
    you can test it easily by opening with IExplorer
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • ALF to XML conversion

    Hi,
    I need to convert SAP generated ALF Printlists to XML format. For that I need to understand the structure of ALF (rather the grammar) so that I can parse it for XML conversion. May I know where I can get information on this? I will be using Java for XML conversion.
    Thanks,
    Praneeth

    use Transformer classes.
    String xslDoc = "abc.xsl";
    String xmlDoc = "xyz.xml";
    String xmlResult = "result.xml";
    DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
    TransformerFactory factory = TransformerFactory.newInstance();
    Transformer transformer = factory.newTransformer(new StreamSource(xslDoc));
    FileWriter fw = new FileWriter(new File(xmlResult));
    StreamResult output = new StreamResult(fw);
    transformer.transform(new StreamSource(new File(xmlDoc)), output);

  • Binary to Ascii conversion

    Dear experts,
    For BINARY to ASCII conversion, please give me some example programs (using methods).
    Thanks a lot in advance.
    Regards,
    Matt

    Hi,
    I think this link will be useful for you. Please go throught this link....
    http://help.sap.com/saphelp_erp2004/helpdata/en/d6/0dba8f494511d182b70000e829fbfe/frameset.htm
    Hope it will helps

Maybe you are looking for

  • Why can i no longer open more one page at a time

    I can no longer open more than on site at a time. One of the main things i like about fire fox is the ability to work with several windows open, which i do in my online marketing. Now if i click on another site it overrides the page i am on. I.E. Whe

  • Battery life while recording

    I would like to buy a creative mp3 player but i need to record conventions transmited by fm frequency. I need at least 8 hours of battery life to record a hole day. I also work out, so i need a leight mp3 player. Does the "Zen V Plus" or the "Zen nee

  • IPhoto not uploading pictures also cant find photostream option on my cloud.Help ny1?

    iPhoto not uploading pictures also cant find photostream option on my cloud.Help ny1? I use iphoto 11.n my photostream is activated n it shows its uploading but nothing come on my cloud.

  • Where to ask it

    Im trying to decide what type of laptop to buy, and although I have always been a PC person, I am now leaning towards a Mac, but the only problem is that they are significantly more expensive than PC's. I am starting university this October in the UK

  • Tritton bluetooth with new iPhone 3

    I saw this Tritton AX Visor bluetooth hands-free car kit and i was wondering does it work with the iPhone Message was edited by: LeaNew2iPhone