Spool to Excel or Text Conversion

Dear All,
Is it possible to convert a spool into Excel file or Text Format?

Hi
Check the below links. They wil help you in converting spool to text format.
[http://www.sap-basis-abap.com/sapac016.htm]
[http://help.sap.com/saphelp_nw70/helpdata/en/30/cc154219fce12ce10000000a1550b0/content.htm]
Thanks,
Jyothi

Similar Messages

  • Spool to Excel or Text Conversion thru ABAP

    Dear All,
    Is it possible to convert a spool into Excel file or Text Format thru ABAP?

    Hi!
    The function modules CONVERT_ABAPSPOOLJOB_2_PDF, CONVERT_OTFSPOOLJOB_2_PDF are converting spool to PDF.
    HTH
    Peter

  • Send email with spool in excel attachment

    Hi,
    I have this function:
    CALL FUNCTION 'Z_SEND_EMAIL_SPOOL_PDF'
           EXPORTING
                application = 'EMAIL'
                emailtitle  = texttitle
                recextnam   = email
                src_spoolid = tsp01-rqident
           TABLES
                texttab     = body.
    And code:
    FUNCTION z_send_email_spool_pdf .
    *"*"Interfase local
    *"  IMPORTING
    *"     REFERENCE(APPLICATION) LIKE  SOOD1-OBJNAM DEFAULT 'EMAIL'
    *"     REFERENCE(EMAILTITLE) LIKE  SOOD1-OBJDES
    *"     VALUE(RECEXTNAM) LIKE  SOOS1-RECEXTNAM
    *"     REFERENCE(SRC_SPOOLID) LIKE  TSP01-RQIDENT
    *"  TABLES
    *"      TEXTTAB STRUCTURE  SOLI
    *- local data declaration
      DATA: ohd    LIKE sood1,
            oid    LIKE soodk,
            to_all LIKE sonv-flag,
            okey   LIKE swotobjid-objkey.
      DATA: g_document     LIKE sood4,
            g_header_data  LIKE sood2,
            g_authority LIKE sofa-usracc,
            lt_attachments LIKE STANDARD TABLE OF sood5 WITH HEADER LINE,
            l_folder_id    LIKE sofdk,
            l_objcont     LIKE soli OCCURS 0 WITH HEADER LINE,
            i_bin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            l_objhead     LIKE soli OCCURS 0 WITH HEADER LINE,
            folder_id      LIKE soodk,
            object_id      LIKE soodk,
            link_folder_id LIKE soodk,
            hd_dat  LIKE sood1.
      DATA: desired_type  LIKE sood-objtp,
            real_type LIKE sood-objtp,
            attach_type LIKE sood-objtp,
            otf LIKE sood-objtp VALUE 'OTF', " SAPscript Ausgabeformat
            ali LIKE sood-objtp VALUE 'ALI', " ABAP lists
            pdf LIKE sood-objtp VALUE 'PDF', "PDF format
            pbyte TYPE i,
            t_pdf LIKE tline OCCURS 0 WITH HEADER LINE,
            objtype LIKE rststype-type,
            type    LIKE rststype-type.
      CONSTANTS: ou_fol LIKE sofh-folrg              VALUE 'O',
                 c_objtp    LIKE g_document-objtp    VALUE 'RAW',
                 c_file_ext LIKE g_document-file_ext VALUE 'PDF'.
      DATA: BEGIN OF receivers OCCURS 0.
              INCLUDE STRUCTURE soos1.
      DATA: END OF receivers.
    * Fist part: Verify if the spool really exists
      SELECT SINGLE * FROM tsp01 WHERE rqident = src_spoolid.
      CHECK sy-subrc = 0.
    *- fill odh
      CLEAR ohd.
      ohd-objla    = sy-langu.
      ohd-objnam   = application.
      ohd-objdes   = emailtitle.
      ohd-objpri   = 3.
      ohd-objsns   = 'F'.
      ohd-ownnam   = sy-uname.
    *- send Email
      CONDENSE recextnam NO-GAPS.
      CHECK recextnam <> space AND recextnam CS '@'.
      CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
           EXPORTING
                authority     = 'SP01'
                client        = tsp01-rqclient
                name          = tsp01-rqo1name
                part          = 1
           IMPORTING
                type          = type
                objtype       = objtype
           EXCEPTIONS
                fb_error      = 1
                fb_rsts_other = 2
                no_object     = 3
                no_permission = 4
                OTHERS        = 5.
      attach_type = c_objtp.
      desired_type = pdf.
      IF objtype(3) = 'OTF'.
        CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
             EXPORTING
                  src_spoolid   = src_spoolid
             IMPORTING
                  pdf_bytecount = pbyte
             TABLES
                  pdf           = t_pdf.
      ELSE.
        CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
             EXPORTING
                  src_spoolid   = src_spoolid
             IMPORTING
                  pdf_bytecount = pbyte
             TABLES
                  pdf           = t_pdf.
      ENDIF.
      PERFORM convertir_tabla_pdf_2 TABLES t_pdf l_objcont.
      CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
           EXPORTING
                owner     = sy-uname
                region    = ou_fol
           IMPORTING
                folder_id = l_folder_id
           EXCEPTIONS
                OTHERS    = 5.
    * fill out informations about the header of the email
      CLEAR: g_document.
      g_document-foltp     = l_folder_id-foltp.
      g_document-folyr     = l_folder_id-folyr.
      g_document-folno     = l_folder_id-folno.
      g_document-objtp     = c_objtp.
      g_document-objdes    = emailtitle.
      g_document-file_ext  = c_file_ext.
      g_header_data-objdes    = emailtitle.
      CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
           EXPORTING
                method      = 'SAVE'
                office_user = sy-uname
           IMPORTING
                authority   = g_authority
           TABLES
                objcont     = texttab
                attachments = lt_attachments
           CHANGING
                document    = g_document
                header_data = g_header_data
           EXCEPTIONS
                OTHERS      = 1.
      object_id-objtp = c_objtp.
      object_id-objyr = g_document-objyr.
      object_id-objno = g_document-objno.
      folder_id-objtp = l_folder_id-foltp.
      folder_id-objyr = l_folder_id-folyr.
      folder_id-objno = l_folder_id-folno.
      link_folder_id-objtp = l_folder_id-foltp.
      link_folder_id-objyr = l_folder_id-folyr.
      link_folder_id-objno = l_folder_id-folno.
      hd_dat-file_ext = pdf.
      hd_dat-objdes = emailtitle.
      CALL FUNCTION 'SO_ATTACHMENT_INSERT'
           EXPORTING
                object_id                  = object_id
                attach_type                = attach_type
                object_hd_change           = hd_dat
                owner                      = sy-uname
           TABLES
                objcont                    = l_objcont
                objhead                    = l_objhead
           EXCEPTIONS
                active_user_not_exist      = 35
                communication_failure      = 71
                object_type_not_exist      = 17
                operation_no_authorization = 21
                owner_not_exist            = 22
                parameter_error            = 23
                substitute_not_active      = 31
                substitute_not_defined     = 32
                system_failure             = 72
                x_error                    = 1000.
    *       FORM SO_OBJECT_SEND_REC                                       *
    FORM  so_object_send_rec
          TABLES  objcont      STRUCTURE soli
                  receivers    STRUCTURE soos1
          USING   object_hd    STRUCTURE sood1
                  folder_id
                  object_id
                  link_folder_id.
      DATA:   oid     LIKE soodk,
              to_all  LIKE sonv-flag,
              okey    LIKE swotobjid-objkey.
      CALL FUNCTION 'SO_OBJECT_SEND'
           EXPORTING
                extern_address             = 'X'
    *            object_hd_change           = object_hd
    *            object_type                = 'RAW'
                outbox_flag                = 'X'
                sender                     = sy-uname
                owner                      = sy-uname
                folder_id                  = folder_id
                object_id                  = object_id
                store_flag                 = 'X'
                link_folder_id             = link_folder_id
           IMPORTING
                object_id_new              = oid
                sent_to_all                = to_all
                office_object_key          = okey
           TABLES
                objcont                    = objcont
                receivers                  = receivers
           EXCEPTIONS
                active_user_not_exist      = 1
                communication_failure      = 2
                component_not_available    = 3
                folder_not_exist           = 4
                folder_no_authorization    = 5
                forwarder_not_exist        = 6
                note_not_exist             = 7
                object_not_exist           = 8
                object_not_sent            = 9
                object_no_authorization    = 10
                object_type_not_exist      = 11
                operation_no_authorization = 12
                owner_not_exist            = 13
                parameter_error            = 14
                substitute_not_active      = 15
                substitute_not_defined     = 16
                system_failure             = 17
                too_much_receivers         = 18
                user_not_exist             = 19
                x_error                    = 20
                OTHERS                     = 21.
      IF sy-subrc <> 0.
        RAISE others.
      ENDIF.
    ENDFORM.
    *       FORM INIT_REC                                                 *
    FORM init_rec TABLES receivers STRUCTURE soos1.
      CLEAR receivers.
      REFRESH receivers.
      MOVE sy-datum  TO receivers-rcdat .
      MOVE sy-uzeit  TO receivers-rctim.
      MOVE '1'       TO receivers-sndpri.
      MOVE 'X'       TO receivers-sndex.
      MOVE 'U-'      TO receivers-recnam.
      MOVE 'U'       TO receivers-recesc.
      MOVE 'INT'     TO receivers-sndart.
      MOVE '5'       TO receivers-sortclass.
      APPEND receivers.
    ENDFORM.
    With this function I can send a spool in pdf format by email. But, now I need send a spool in Excel (xls) format by email. I try to disconnect 'CONVERT_OTFSPOOLJOB_2_PDF' and 'CONVERT_ABAPSPOOLJOB_2_PDF' but doesnt work.
    Can you help me?
    A lot of thanks in advance.
    Best regards.

    Hi.
    I do not think it is feasible to create a worthwhile Excel file from a SAP spool file.
    I have reports that send output as Excel attachments to email, but the code (including function modules etc) is too much to post here.
    You can use OLE to create an Excel file, but this will not generally work when the report is run in the background.
    So my approach is to make the report write an Excel XML file (that's just text after all), and send that as an XLS email attachment.  When the email receiver double-clicks on the attachment, it fires up Excel and brings in the data.  Most users would not realise that it's not a native Excel file.
    One nice touch is to have two sheets in the Excel file, one with the main report and the other with the selection criteria.
    Of course there is a lot of work getting started with this.
    John

  • How to prepare the Format of Flat file(Excel or Text file) for sales order

    Hi All,
    My requirement is to prepare the Flat File formats(Excel or Text file) for sales order Conversion using BAPI by COB.
    Needed Sample Excel or Text flat file .
    Thanks for all.
    Regards,
    Chowdary
    Moderator message : Search for available information. Thread locked. 
    Your similiar question [Flat files formats|Flat files formats] has been already locked for similiar reason.  Read forum rules before posting.
    Edited by: Vinod Kumar on Jul 8, 2011 9:36 AM

    Hi,
    You can use something like this:
    switch(cell.getCellType()) {
      case Cell.CELL_TYPE_STRING:
        System.out.println(cell.getRichStringCellValue().getString());
        break;
      case Cell.CELL_TYPE_NUMERIC:
        if(DateUtil.isCellDateFormatted(cell)) {
          System.out.println(cell.getDateCellValue());
        else {
          System.out.println(cell.getNumericCellValue());
        break;
        case Cell.CELL_TYPE_BOOLEAN:
          System.out.println(cell.getBooleanCellValue());
          break;
        case Cell.CELL_TYPE_FORMULA:
          System.out.println(cell.getCellFormula());
          break;
        default:
          System.out.println();
    Hope it helps,
    Daniel

  • Is there a way of  printing a text conversation

    can a text conversation be uploaded onto the computer and printed? so  you can see the times/dates etc?
    i've seen people saying to take screen shots and print as picture but im wanting to know if a long period of conversation can be printed
    thanks

    Do you have a Mac computer by any chance?

  • 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

  • How to download data from spool to excel file

    Hi,
    I have requirement like....i need to download data from spool to excel file.
    Please let me know the process how to download...
    <removed by moderator>
    <removed by moderator>
    Thanks,
    Khasimsa
    Moderator message: please (re)search yourself before asking, do not assign priorities, do not offer re-ward
    locked by: Thomas Zloch on Sep 8, 2010 1:18 PM

    Hi try this way..
    *FM called that returns the Spool Request Number data into and internal table
      CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB'
        EXPORTING
          rqident              = p_spool                     "Spool Request Number
          first_line           = 1
        TABLES
          buffer               = it_spool_xls                            "Internal table that will have the Spool Request No data
        EXCEPTIONS
          no_such_job          = 1
          not_abap_list        = 2
          job_contains_no_data = 3
          selection_empty      = 4
          no_permission        = 5
          can_not_access       = 6
          read_error           = 7
          OTHERS               = 8.
    *To convert the spool data into excel format
      CALL FUNCTION 'SO_RAW_TO_RTF'
        TABLES
          objcont_old = it_spool_xls               "Internal table having spool data
          objcont_new = it_xls_spool.           "Int table having Excel format data converted from Spool data
    "call GUI down Load by passing  it_xls_spool
    Prabhudas

  • 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

  • Messy format exporting to excel and text/html

    Need help please....i'm in the middle of problems, i'm developing application that can exporting reports to some formats like pdf, excel, and text/html. it is become a problem when i exporting it to excel or text/html, the format are so messy... I'm using POI library 2.0 when exporting to excel. My codes are simply like this :
    try {
    response.setContentType(type);
    if ("application/vnd.ms-excel".equals(type)) {
    exporter = new JRXlsExporter();
    exporter.setParameter(JRXlsExporterParameter.JASPER_PRINT,jasperPrint);
    exporter.setParameter(JRXlsExporterParameter.OUTPUT_STREAM,response.getOutputStream());
    else if ("text/html".equals(type)) {
    exporter = new JRHtmlExporter();
    exporter.setParameter(JRExporterParameter.JASPER_PRINT,
    jasperPrint);
    exporter.setParameter(JRExporterParameter.OUTPUT_WRITER,response.getWriter());
    is it just because the library? or i have to add some additional code before jasper reports execute it? thanks a lot for the answers....
    Message was edited by:
    darma_sadha
    Message was edited by:
    darma_sadha
    Message was edited by:
    darma_sadha

    First, you forgot to tell what the problem is. Second: this is not a Jakarta product support forum. POI has a mailing list of its own. Go ask them.

  • Ability to download Spool into Excel

    Hi,
    I have a requirement that the ALV report needs to be run in background with ability to download spool into excel .Can anyone please help in this regard.
    Many Thanks,
    Sharath

    Hi,
    First check whether the status of the job is Completed or Cancelled.
    WHILE 1 = 1.
    * GET THE JOB STEPLIST WHICH HAS THE SPOOL NUMBER
        CALL FUNCTION 'BP_JOB_READ'
          EXPORTING
            job_read_jobcount           = w_jobcount
            job_read_jobname            = w_jobname
            job_read_opcode             = '35'
    *   JOB_STEP_NUMBER             =
         IMPORTING
           job_read_jobhead            = wa_jobhead
         TABLES
           job_read_steplist           = i_jobsteplist
    * CHANGING
    *   RET                         =
       EXCEPTIONS
         invalid_opcode              = 1
         job_doesnt_exist            = 2
         job_doesnt_have_steps       = 3
         OTHERS                      = 4
        IF sy-subrc  0.
    *      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    *              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    * IF STATUS OF JOB IS COMPLETED(F) OR CANCELLED(A)
    * READ THE JOBSTEPLIST & GET THE SPOOL NUMBER
        IF wa_jobhead-status =  c_a OR wa_jobhead-status = c_f.
          READ TABLE i_jobsteplist INTO wa_jobsteplist INDEX 1.
          CHECK wa_jobsteplist-listident  space.
          w_spool_number = wa_jobsteplist-listident.
          EXIT.
        ENDIF.
      ENDWHILE.
    Use FM "RSPO_DOWNLOAD_SPOOLJOB".
    Best Regards,
    Sunil.

  • Spool SQl data into text file using dynamic sql

    Hi,
    I am spooling output data into text file using command
    select 'select t.mxname,bo.lxtype,t.mxrev'||chr(10)||'from mx_1234567'||chr(10)||
    'where <condition>';
    here mxname varchar(128),lxtype(128),mxrev(128) all are of varchar type.I want the output in format
    e.g Part|1211121313|A
    but due to column width the output,I am getting is with spaces.
    "Part then blank spaces |1211121313 then blank spaces |A"
    how can I remove these spaces between columns.I used set space 0 but not working.
    Thanks in advance.
    Your help will be appreciated.

    Hi Frank,
    I have seen your reply for SET LINE SIZE function. But, I could not be able to understand it.
    I am facing similar kind of issue in my present project.
    I am trying spool more than 50 columns from a table into flat file. Because of more column lengths in few columns, i am getting space. There are so many columns with the same issue. I want to remove that space.so that, data can fit perfectly in one line in .txt file without any wrap text.
    Below is my sample query.sql. Please let me know the syntax. My mail id : [email protected]
    --Created : Sep 22,2008, Created By : Srinivasa Bojja
    --Export all Fulfillments
    --Scheduled daily after 1:00am and should complete before 3:30am
    WHENEVER SQLERROR EXIT SQL.SQLCODE
    SET LINESIZE 800
    SET WRAP OFF
    SET PAGESIZE 800
    SET FEEDBACK OFF
    SET HEADING ON
    SET ECHO OFF
    SET CONCAT OFF
    SET COLSEP '|'
    SET UNDERLINE OFF
    SPOOL C:\Fulfillment.txt;
    SELECT SRV.COMM_METHOD_CD AS Method,
    SRV.SR_NUM AS "Fulfillment Row_Id",
    CON.LAST_NAME AS "Filled By"
    SRV.SR_TITLE AS Notes,
    SRVXM.ATTRIB_04 AS "Form Description"
    FROM SIEBEL.S_SRV_REQ SRV,
    SIEBEL.S_SRV_REQ_XM SRVXM,
    SIEBEL.S_USER USR,
    SIEBEL.S_CONTACT CON
    WHERE SRV.ROW_ID = SRVXM.PAR_ROW_ID AND
    SRV.OWNER_EMP_ID = USR.ROW_ID AND
    CON.ROW_ID= SRV.CST_CON_ID;
    SPOOL OFF;
    EXIT;

  • HT201401 When I am having a text conversation some times my bubbles are blue and sometimes they are green-why is that

    When I am having a text conversation sometimes my bubbles are blue and sometimes they are green -why is that

    blue colored bubbles are imessages(ios device to ios device), uses data
    green colored are SMS's(charged by carrier, if you have free SMS's, it should be free too)
    learn more about imessages
    http://www.apple.com/ios/messages/

  • UCM 11.1.1.4 : indexation : Text conversion of the file failed

    Hello,
    I'm facing an indexation issue with MS Office files, pdf, ...
    For instance :
    Text conversion of the file '/opt/oracle/middlewarehome/ucm/cs/weblayout/groups/public/documents/document/mdaw/mdaw/~edisp/virtuoz2dev000342.doc' failed.
    Content has been indexed with Info only. Resubmit should only be performed if the problem has been resolved.
    This a new installation of UCM 11.1.1.4 with Oracle DB 10.2.0.5.2 and WLS 10.3.4, all on a SUSE10 server.
    This issue is very similar to this one :
    Re: XML Not Indexing???
    But in my case, xml and txt files have no problem.
    thanks for your help,
    Vince

    Hi Srinath,
    Thanks for your reply. I checked the certification matrix and the certified version of DB with UCM 11g are :
    Oracle 10.2.0.4+
    Oracle 11.1.0.7+
    Oracle 11.2.0.1+
    It doesn't include 10.2.0.5 ??
    I managed to trace the server output.
    It seems there is a missing file : search.cfg
    also, what is the meaning of the "mdaw" directories ?
    thanks for your help,
    system/6 04.08 09:40:47.648 IdcServer-5934 Configuring tracing verbose: true; sections: indexer
    (internal)/5 04.08 09:40:47.652 IdcServer-5934 !csTraceChangedSectionsList,indexer!csTraceIsVerbose
    indexer/7 04.08 09:41:11.454 index update work /opt/oracle/middlewarehome/ucm/cs/search/search.cfg doesn't exist.
    indexer/7 04.08 09:41:11.455 index update work isRebuild?false; IndexerStep:Init; Class:intradoc.indexer.Indexer
    indexer/7 04.08 09:41:11.455 index update work isRebuild?false; IndexerStep:CheckCollection; Class:intradoc.indexer.IndexerCollectionManager
    indexer/7 04.08 09:41:11.456 index update work isRebuild?false; IndexerStep:BuildChanges; Class:entoracle.indexer.EOIndexerBuildChanges
    indexer/7 04.08 09:41:11.468 index update work Saving 1 update changes
    indexer/7 04.08 09:41:11.469 index update work isRebuild?false; IndexerStep:PreIndexingStep; Action:preIndexingStep
    indexer/7 04.08 09:41:11.469 index update work isRebuild?false; IndexerStep:CheckForWork; Class:intradoc.indexer.Indexer
    indexer/7 04.08 09:41:11.469 index update work Found work:Additions; Type:+; Change count: 1
    indexer/7 04.08 09:41:11.469 index update work isRebuild?false; IndexerStep:IndexAdditions; Class:intradoc.indexer.CommonIndexerBulkLoader
    indexer/7 04.08 09:41:11.470 index update work IndexerBulkLoader doing 'IndexAdditions' with m_change '+'; total count: 1; max count: 10000
    indexer/7 04.08 09:41:11.470 index update work WebChange retrieved. RevClassID:342; dID:364; Indexer State: ; ReleaseState:U
    indexer/7 04.08 09:41:11.477 index update work webFormat is application/msword
    indexer/6 04.08 09:41:11.477 index update work computeIndexableFileAttributes(); item:virtuoz2dev000342,formatType:webviewable,renditionCount:-1,format:application/msword,isAllowMap:true,isVault:false
    indexer/7 04.08 09:41:11.477 index update work Direct indexing allowed: false
    indexer/7 04.08 09:41:11.477 index update work Conversion allowed: true
    indexer/7 04.08 09:41:11.479 index update work Conversion handler for format 'application/msword' is 'TextIndexerFilter'
    indexer/6 04.08 09:41:11.479 index update work Added new item for indexing consideration. [format:application/msword, formatType:webviewable, filePath:/opt/oracle/middlewarehome/ucm/cs/weblayout/groups/public/documents/document/mdaw/mdaw/~edisp/virtuoz2dev000342.doc, fileSize:21504, url:/cs/groups/public/documents/document/mdaw/mdaw/~edisp/virtuoz2dev000342.doc,allowDirectIndex:false, allowConversion:true, conversionHandler:TextIndexerFilter, useMap:false, mapExtension:null
    indexer/7 04.08 09:41:11.480 index update work indexWebFile: true m_retryIndexing: false m_isFirstRetry: true
    indexer/6 04.08 09:41:11.494 index update work preparing 1 items
    indexer/6 04.08 09:41:11.549 index update work doing conversion with intradoc.indexer.TextConversionHandler@484f1ee on intradoc.indexer.IndexerInfo@47ef07e dID:364 key:null mdo:false iwf:true sta:-1 alone:true
    indexer/7 04.08 09:41:11.550 index update work InputFilePath is: </opt/oracle/middlewarehome/ucm/cs/weblayout/groups/public/documents/document/mdaw/mdaw/~edisp/virtuoz2dev000342.doc>
    indexer/7 04.08 09:41:11.550 index update work OutputFilePath is: </opt/oracle/middlewarehome/ucm/cs/search/IdcColl1/bulkload/~export/virtuoz2dev000342.txt> >indexer/7 04.08 09:41:11.550 index update work Sending document to conversion >(internal)/7 04.08 09:41:11.623 TextExport Abandon inattendu par le processus 'TextExport'. >indexer/6 04.08 09:41:11.624 index update work prepareDoc complete >indexer/7 04.08 09:41:12.001 index update work setting change on '364' to 'I' >indexer/7 04.08 09:41:12.005 index update work after handling indexing results: hasError: false m_retryIndexing: false m_isFirstRetry: true metaOnlyCount: 0 aSize: 1 >indexer/7 04.08 09:41:12.006 index update work isRebuild?false; IndexerStep:CheckForWork;  Class:intradoc.indexer.Indexer >indexer/7 04.08 09:41:12.006 index update work isRebuild?false; IndexerStep:DetermineSubscription;  Class:intradoc.indexer.DetermineSubscription >indexer/7 04.08 09:41:12.007 index update work isRebuild?false; IndexerStep:Replication;  Class:intradoc.server.IndexerReplication >indexer/7 04.08 09:41:12.008 index update work isRebuild?false; IndexerStep:PostIndexingStep;  Action:postIndexingStep >indexer/7 04.08 09:41:12.008 index update work isRebuild?false; IndexerStep:Cleanup;  Class:intradoc.indexer.Indexer >indexer/7 04.08 09:41:12.013 index update work cleanup for dID 364 change is I origChange is + newIndexerState is  >indexer/7 04.08 09:41:12.022 index update work isRebuild?false; IndexerStep:ContentRefresh;  Action:postDatabaseStep >indexer/7 04.08 09:41:12.024 index update work isRebuild?false; IndexerStep:Init;  Class:intradoc.indexer.Indexer >indexer/7 04.08 09:41:12.024 index update work isRebuild?false; IndexerStep:CheckCollection;  Class:intradoc.indexer.IndexerCollectionManager >indexer/7 04.08 09:41:12.024 index update work isRebuild?false; IndexerStep:BuildChanges;  Class:entoracle.indexer.EOIndexerBuildChanges >indexer/7 04.08 09:42:23.609 index update work /opt/oracle/middlewarehome/ucm/cs/search/search.cfg doesn't exist. >indexer/7 04.08 09:42:23.609 index update work isRebuild?false; IndexerStep:Init;  Class:intradoc.indexer.Indexer >indexer/7 04.08 09:42:23.609 index update work isRebuild?false; IndexerStep:CheckCollection;  Class:intradoc.indexer.IndexerCollectionManager >indexer/7 04.08 09:42:23.610 index update work isRebuild?false; IndexerStep:BuildChanges;  Class:entoracle.indexer.EOIndexerBuildChanges >indexer/7 04.08 09:42:23.613 index update work isRebuild?false; IndexerStep:Replication;  Class:intradoc.server.IndexerReplication >indexer/7 04.08 09:42:23.613 index update work isRebuild?false; IndexerStep:PostIndexingStep;  Action:postIndexingStep >indexer/7 04.08 09:42:23.613 index update work isRebuild?false; IndexerStep:Cleanup;  Class:intradoc.indexer.Indexer >indexer/7 04.08 09:42:23.617 index update work isRebuild?false; IndexerStep:ContentRefresh;  Action:postDatabaseStep >indexer/7 04.08 09:42:23.618 index update work isRebuild?false; IndexerStep:Init;  Class:intradoc.indexer.Indexer >indexer/7 04.08 09:42:23.618 index update work isRebuild?false; IndexerStep:CheckCollection;  Class:intradoc.indexer.IndexerCollectionManager >indexer/7 04.08 09:42:23.619 index update work isRebuild?false; IndexerStep:BuildChanges;  Class:entoracle.indexer.EOIndexerBuildChanges                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Send/export the background job spool in Excel (in MHTML format) in ECC 6.0.

    Hello All,
    I have a requirement to send/export the background job spool in Excel (in MHTML format) in ECC 6.0. Please help.
    Thank you.
    Nalini

    Hi Jigar,
    Thanks for your response.
    Anything is like download to desktop or email is fine. But in MHTML format.
    We can download the ALV report in MHTML spreadsheet format when we run the program online. But the program is running for long time and going to dump.
    So i scheduled it as background job and downloading the output in  .HTML format. But user wants the spool/report output in .MHTML spreadsheet format.
    I can write the code. Instead of changing the existing program I would like to know is there any way (from standard SAP) that I can get the background spool in MHTML spreadsheet format.
    Thanks,
    Nalini

  • Can i copy an entire text conversation somehow to print?

    I wouldl like to be able to copy an entire text conversation dating back to the past year; is there some way to do this?

    Google touchcopy or ibackupbot

Maybe you are looking for

  • Error in Schedule Background Job for Deadline Monitoring of swu3

    While Auto Customization swu3 i am getting error message 'Output device "" not known' in 'Schedule Background Job for Deadline Monitoring' Please advice what could be cause of it

  • My ipod is not recognized on my computer or itunes

    First, itunes told me my ipod was corrupted so I rest ored it. Then itunes wouldn't allow me to add my music back on, it gave me many pop ups saying it couldn't sync because the folder could not be foundt Lots of reports saying it couldn't copy my mu

  • ITunes could not load dataclass information from sync services

    I'm getting this message every time i'm connecting my iPhone with my mac. When i try to sync it i get this message: iTunes could not backup the iPhone "iPhone" because the backup session failed. I've tried deleting all my old backups and a manual bac

  • Payment authorization

    Hi I was trying to make payment authorization for my account four times. Still it's not working. Payment authorization product 1 USD $1.00 Status: Cancelled. Somebody know why? Thank you. Peace.

  • Should there be a packing slip when returning an Iphone by post? (UK)

    I'm returning a broken iphone by post I've recieved the box and addressed pack, but I'm just wondering if they send a packing slip to return as well? Like so they know the phonne is mine. Just scared that I could have not seen it and thrown in the bi