Problem while updating excel file in Km

Hai,
  I am using jxl api to generate excel file . I need to update the excel file. for that i am creating tht excel file in temp location , and updating using this code.
excelFile=new File(fileName);
embedDataIntoExcel();
workbook.write();
workbook.close();
IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
          com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();
           IUser ep5User =WPUMFactory.getUserFactory().getEP5User(sapUser);
           ResourceContext context = new ResourceContext(ep5User);
           RID rid = RID.getRID("/path/excelFile.xls");
           IResourceFactory factory =ResourceFactory.getInstance();
           IResource folder = (IResource) factory.getResource(rid,context);
          FileInputStream fin = new FileInputStream(excelFile);
           fin.read();
           Content content = new Content(fin,"ms-excel", -1);
           folder.updateContent(content);
<b>problem is the excel file is generating with some junk data </b>
how can i solve this
regards,
naga

Hai,
I am using jxl api to generate excel file . I need to update the excel file. for that i am creating tht excel file in temp location , and updating using this code.
excelFile=new File(fileName);
embedDataIntoExcel();
workbook.write();
workbook.close();
IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
          com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();
           IUser ep5User =WPUMFactory.getUserFactory().getEP5User(sapUser);
           ResourceContext context = new ResourceContext(ep5User);
           RID rid = RID.getRID("/path/excelFile.xls");
           IResourceFactory factory =ResourceFactory.getInstance();
           IResource folder = (IResource) factory.getResource(rid,context);
          FileInputStream fin = new FileInputStream(excelFile);
           fin.read();
           Content content = new Content(fin,"ms-excel", -1);
           folder.updateContent(content);
problem is the excel file is generating with some junk data
how can i solve this
regards,
naga

Similar Messages

  • Problem while uploading excel file to server

    Hello,
    I have created an excel file using OLE and saved it to local desktop. Then I use GUI_UPLOAD to upload the excel into SAP and attach it to mail. but while using Function GUI_UPLOAD I am getting dump for CNTL_ERROR.
    If I skip the process of excel creation by OLE and passes the excel file created earlier then it gives no dump and is executed successfully.
    Kindly help on this.

    Hi Suchendar,
    Try using the FM -  F4_FILENAME to get the valid file name and use TEXT_CONVERT_XLS_TO_SAP FM to upload into SAP based on the required format.
    Regards,
    Suresh

  • Problem while opening excel files in office 365

    Hi, Facing issue in office 365. Suppose one excel file is already opened and if we tried to open another one it just is looks like opening file and if check after sometime it shows excel blank window to open new file.
    Please help

    Hi,
    Thanks for your post.
    Based on my experience, if you've ticked the option of "Ignore other applications that use Dynamic Data Exchange (DDE)“
    under FILE>Options>Advanced, you will probably have this kind of issue.
    Please try to turn off that option and see if it works.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Error while accessing excel file using ODBC

    Hi
    I am getting the below error message while accessing excel sheet using ODBC from Oracle:
    ERROR at line 1:
    ORA-28545: error diagnosed by Net8 when connecting to an agent
    Unable to retrieve text of NETWORK/NCR message 65535
    ORA-02063: preceding 2 lines from EXCL
    Can anyone help me on this...
    Cheers
    Pradeep
    Message was edited by:
    user634393

              Hi
              Thank you.Is there a way to read a file which is existing in the war file.
              Regards
              Anand Mohan
              "Wenjin Zhang" <[email protected]> wrote:
              >
              >In Weblogic, if your files are archived in a WAR, you cannot get an entry
              >as individual
              >file since it is only bytes in a large archive file. So getRealPath will
              >give
              >you null result. If you only want the path, try to use other getXXXPath,
              >getURL,
              >or getURI method. If you want to read the content, use getResource.
              >
              >
              >"Anand" <[email protected]> wrote:
              >>
              >>Hi
              >>I am having problem while accessing the file located in the server from
              >>a JSP
              >>page. I am not getting the RealPath from a JSP page using getRealPath(request.getServletpath()).
              >>
              >>The same code is working if the jsp placd under defaultwebApp directory
              >>and not
              >>working if i create a war and deploy the same.
              >>
              >>I am using weblogic server 7.0 trail version.I am setting the context
              >>path also.
              >>
              >>Can any help me in this regard.
              >>
              >>Thank And Regards
              >>
              >>Anand Mohan
              >
              

  • Error message while upload excel file (with macro) to sap (iw28)

    While upload excel file to sap through iw28, i get error message (vb)
    u2022     i have to say that the excel file contain macro , with out the macro , work fine .
    u2022     The error display just in refresh command.
    the error message :
    Public Sub ALV_CUS_Exit()
    Dim objs As ChartObjects
    Dim obj As ChartObject
    Dim sheet As Worksheet
    Dim r As Range
    For Each sheet In Sheets
    Set objs = sheet.ChartObjects
    For Each obj In objs
    Set r = Sheets("RawData").UsedRange
    obj.Chart.SetSourceData Source:=r
    Next obj
    Next sheet
    End Sub

    hi,
    This is releated to the ABAP coding...There might be some ouput problem in the Abap list viewer...Pls check it with the ABAP consultant...
    Regards
    Priyanka.P

  • Problem while updating the Support Package 17 on my SAP WAS SP9

    Hi,
    I'm facing problem while updating the Support Package 17 on my SAP WAS SP9
    ERROR 2006-10-13 10:23:22
    FSL-06002  Error 2 (The system cannot find the file specified.
    ) in execution of a 'CreateProcess' function, line (284), with parameter (java.exe ...).
    Please help me in this regard.....
    Thanks in advance...
    Satya

    Hello gentlemen, I am also having problem with the following running on 64 bit Windows and SQL2005/64 bit. I am erroring in Step 8 'Updating JDBC' driver. I am attempting to update from SP9 to SP18. The WEBAS Jave installed went flawless but I seem to be stuck here. Any help is appreciated...
    ERROR 2006-11-22 10:13:57
    FSL-06002  Error 2 (The system cannot find the file specified.
    ) in execution of a 'CreateProcess' function, line (284), with parameter (java.exe ...).

  • Windows Media Player encountered a problem while playing the file...

    I am running WMP 11.0.5721.5280. I am running XP SP3 with every update that has come out. I have 4 GB RAM and my processor is a Pentium 4, 2.6GHz.
    I have a large collection of music file ripped from my CD collection. Almost every time I want to plat a music file I get a message; Windows Media Player encountered a problem while playing the file, For additional assistance, click Web Help. When this
    error box is displayed, a red 'X' placed next to the file in WMP.
    When I click the "Web Help" button, I am taken to a MS website (http://windows.microsoft.com/en-us/windows7/c00d11b1) which tells me that I should go to the sound device website and make certain I have the latest driver. All of the advice which
    is given does not apply to me. My sound device works fine! I can play CD, DVD (movies), and MP3 files. Even when I use RealPlayer, the same thing happens, but not as frequently.
    Can anyone offer a solution to this problem?

    They'll help you over here.
    Windows
    XP forums on Microsoft Answers
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • My media player is not working, no sound. keeps saying encountered problem while playing the file.

    HP Pavilion g series (g6-1b50us Notebook PC), windows 7, 64-bit.
    My media player keeps saying  it encountered problems while playing a file. and little red x's appearing beside song titles. They did play before. Please help.

    Hi,
    This may happen if the files were moved to a different folder or a different location.
    Try this:
    http://answers.microsoft.com/en-us/windows/forum/windows_7-sound/red-x-symbol-next-to-each-song-whil...
    Note:
    If you have HP Support Assistant installed on the computer(The Blue Question Mark) then open it ==> Complete all pending Updates & Tuneups==> Restart and Check. It may solve your problem
    Although I am an HP employee, I am speaking for myself and not for HP.
    **Click on “Kudos” Star if you think this reply helped** Or Mark it as "Solved" if issue got fixed.

  • A problem while implementing a file to file senario

    hi all :
         There is some problem while implement a file to file senario. the file couldn't be sent or recieved.
          and as I try to check Check the Sender File Adapter Status  via
         Runtime Workbench -> Component Monitoring -> Communication Channel Monitoring ,
         It is found that Adapter Engine has error status with red light.  Is it why the file couldn't be sent?
        Could you please tell me how to make Adapter Engine  available?
        Thank you very much!!!

    Hi Sony
    Error getting JPR configuration from SLD. Exception: No entity of class SAP_BusinessSystem for EC1.SystemHome.cnbjw3501 found
    No access to get JPR configuration
    Along with what experts suggested
    What is the type of Business system is this. Standalone Java?
    JPR can have problem if you have a business system thats not ABAP/Java type if this system is not having a SAP TS in landscape then create Java type.
    Thanks
    Gaurav

  • Problem  while reading XML file from Aplication server(Al11)

    Hi Experts
    I am facing a problem while  reading XML file from Aplication server  using open data set.
    OPEN DATASET v_dsn IN BINARY MODE FOR INPUT.
    IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      READ DATASET v_dsn INTO v_rec.
    WHILE sy-subrc <> 0.
      ENDWHILE.
      CLOSE DATASET v_dsn.
    The XML file contains the details from an IDOC number  ,  the expected output  is XML file giving  all the segments details in a single page and send the user in lotus note as an attachment, But in the  present  output  after opening the attachment  i am getting a single XML file  which contains most of the segments ,but in the bottom part it is giving  the below error .
    - <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803<The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/SHPORD_0080005842.xml'.
    /SPAN></NTEND>
      <NTENZ>000000</NTENZ>
    for all the xml  its giving the error in bottom part ,  but once we open the source code and  if we saved  in system without changing anything the file giving the xml file without any error in that .
    could any one can help to solve this issue .

    Hi Oliver
    Thanx for your reply.
    see the latest output
    - <E1EDT13 SEGMENT="1">
      <QUALF>003</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803</NTEND>
      <NTENZ>000000</NTENZ>
      <ISDD>00000000</ISDD>
      <ISDZ>000000</ISDZ>
      <IEDD>00000000</IEDD>
      <IEDZ>000000</IEDZ>
      </E1EDT13>
    - <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803<The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/~1922011.xml'.
    /SPAN></NTEND>
      <NTENZ>000000</NTENZ>
    E1EDT13 with QUALF>003 and  <E1EDT13 SEGMENT="1">
    with   <QUALF>001 having almost same segment data . but  E1EDT13 with QUALF>003  is populating all segment data
    properly ,but E1EDT13 with QUALF>001  is giving in between.

  • Problem while dowloading the file from Application Server

    Dear Experts,
                 I am facing the Problem while downloading the file from Application server.
    We done the automatic function while saving the invoice, this will create an idoc, and this idoc is written in the Application Server.
    I am running the Transaction AL11 and select the record, and from menu --> List, i am downloading into TXT format.
    But for some segments, the length is long, and so the last 3 to 4 fields values are not appearing in the File. Even though i am unable to view the values in the file before downloading. But i can view in IDOC.
    Please help me to solve this issue.
    Thanks & Regards,
    Srini

    but our user will use the Txn. AL11 and they will download from there
    Educate the user On a serious note, tell him this is not how data from app server should be downloaded. You can ask him to talk to the basis team to provide him access to the app server folder where the file is being stored.
    I can set the Variant and put this in background, But always the file name will be change, Like we use Time stamp in the File name.
    You can't automate this process by scheduling in BG mode. This is because the in BG mode you can't dwld the file to presentation server.
    Hope i'm clear.
    BR,
    Suhas

  • Hello i am rajesh i am having problem while conveting other files into pdf format please help me

    i am rajesh i am having problem while converting other files into acrobat format please help me

    Hello Rajesh,
    I'm sorry to hear you're having trouble. Are you using Acrobat.com to convert your files to PDF? Please let me know where you are having trouble and I will do my best to help you convert your files. For your reference, here is a list of filetypes that can be converted to PDF online with Acrobat.com:
    http://kb2.adobe.com/cps/524/cpsid_52456.html#Create%20PDF
    Best,
    Rebecca

  • Facing problem while updating IInfotype 0009-bank details through workflow

    Dear SAP Gurus,
    I am facing a problem while updating Infotype 0009 through workflow which is integrdated with portal.
    Scenario:
    Employee logins to portal and changes his/her bank details like payee name, bank key, account number, postal code and city of bank, bank name etc.
    Once he submits the request, my workflow is triggered through SAP_WAPI_START_WORKFLOW which is called from portal and goes through various approval steps and finally reaches the step where the container elements are finally to be updated in IT0009.
    Field bank account number (BANKN), which is part of table PA0009 are easily updates using the FM HR_INFOTYPE_OPERATION by first enqueuing the employee number and after the update dequeuing it.
    However fields like payee name (EMFTX) bank key (BANKL) , bank name(BANKA -structure BNKA_BF-this is automatically fetched based on bank key) and postal code(BKPLZ) and city of bank (BKORT) are from structure Q0009 (on the infotype 9 screen level) and from table BNKA (at table level). The problem is that these are not getting updated by HR_INFOTYPE_OPERATION as they are not the part of infotype 9.
    Can anyone help me to understand how can these fields be updated ?
    Quick help will be highly appreciated.

    Hi Spantaleoni,
    Thanks for your quick response.
    Well actually the table BNKA is a master table for the bank information and we must not create entries in it or update the table programatically,  rather we should  use the available data in it.
    Now say employee currently has bank as A and he wants to change it as B which is available in BNKA then he will just select the bank B from search help provided in portal which again comes from table BNKA only. Employee then submits the info and it must get updated in the infotype PA0009.
    As far as think, this should be done on screen level of infotype PA0009 as I have already mentioned that certain fields are coming from structure Q0009 and they cannot be updated on PA0009 table level.
    I am just looking for way through which I can update the screen of infotype PA0009 of employee through workflow.
    Regards

  • Problem while processing large files

    Hi
    I am facing a problem while processing large files.
    I have a file which is around 72mb. It has around more than 1lac records. XI is able to pick the file if it has 30,000 records. If file has more than 30,000 records XI is picking the file ( once it picks it is deleting the file ) but i dont see any information under SXMB_MONI. Either error or successful or processing ... . Its simply picking and igonring the file. If i am processing these records separatly it working.
    How to process this file. Why it is simply ignoring the file. How to solve this problem..
    Thanks & Regards
    Sowmya.

    Hi,
    XI pickup the Fiel based on max. limit of processing as well as the Memory & Resource Consumptions of XI server.
    PRocessing the fiel of 72 MB is bit higer one. It increase the Memory Utilization of XI server and that may fali to process at the max point.
    You should divide the File in small Chunks and allow to run multiple instances. It will  be faster and will not create any problem.
    Refer
    SAP Network Blog: Night Mare-Processing huge files in SAP XI
    /people/sravya.talanki2/blog/2005/11/29/night-mare-processing-huge-files-in-sap-xi
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Processing huge file loads through XI
    File Limit -- please refer to SAP note: 821267 chapter 14
    File Limit
    Thanks
    swarup
    Edited by: Swarup Sawant on Jun 26, 2008 7:02 AM

  • Error Raised while uploading Excel file to SAP

    Hi All,
    I am getting error while uploading excel file into SAP using the function module 'TEXT_CONVERT_XLS_TO_SAP'.
    Error Message is UX(893) -  'Excel file & cannot be processed' .
    Please let me know what went wrong.
    Regards,
    Deepthi

    Hi,
    1 .TEXT_CONVERT_XLS_TO_SAP  Funtion module will work if you have installed Microsoft Excel at front end.
    2. Whenyou declare internal table for upload, specify the char only in the strcture ,don't specify any data element or dictionary reference.    If the data element and dictionaly reference is character field then its ok.
    eg.
    types:begin of st_data,
               field1 type char15,
               field2 type char23,
              endif.
    3. Close the excel before you upload
    Hope this might solve your issue.
    Regards
    Aromal R

Maybe you are looking for

  • Photo Library not uploading from iPhone 6

    Hi, I have a new iPhone 6, updated with 8.3. I activated the Apple Library more than three days ago and still no photos got uploaded. I tried signing out iCloud and back on but still nothing happening, with the iPhone fully charged and connected to w

  • List of files in application server

    Hi, I would like to get the list of files in the directory of application server. Is there any standard function module to acieve this?. Regards Elini.P

  • "open with" photoshop not available

    When I right-click a picture or an image under windows explorer, and coose the "open-with" option, why does not it offer me to open it with Photoshop (which is purchased and correctly installed)? P.

  • What wifi broadcaster do I need?

    I am now SHARING my comcast internet from my 10,1 iMac with my iPad Air. I must keep the iMac running to do this. I desire to stop this and buy, what I would call a WiFi broadcaster, so I can shut down the iMac and use as needed. What price should I

  • Memory leak pulling in data from database view or database table

    Post Author: Thang Nguyen CA Forum: Data Integration Hi, I'm experiencing memory leaks when using DI to load from a database view or table. I have seen the issue on 11.7.2.0 and 11.7.2.2 and was wondering if anyone else has seen it. You can see the r