Download excel file or xml in webdynpro for abap

hi experts,
i have an internal table which have many fileds so that i cant display this table as alv. This amount of data can only displaying with table binding. But the users wants to download data as excell spreadsheet..
No standard gui_download funtion is working.. i need help
ps : İ have tried to use file download with xstring property element. it isnt successfull for me
thanks for helps

Hi,
You can display images with the Image UIElement which can point to a URL. So if you store your JPEG file on the MIME then you have to generate a URL for this file and then make your Image UI Element point to this URL.
If your image is stored on a content server then generate a URL, as I said previously, set the source at runtime to the generated URL.
In both cases, make the source attribute of the Image UIElement point to a context attribute (type string should be ok) and use the code wizard to set the attribute.
Hope it helps,
Olivier MATT
PS: be sure that your image is a JPEG or any supported fileformat by your browser (WD do not handle image conversions).

Similar Messages

  • Excel File Upload In Webdynpro For ABAP

    Hi All,
    I have a doubt regarding EXCEL file upload for Webdynpro for ABAP.
    I am able to get the path of file using 'FILEUPLOAD' UI element.Now I need to upload the EXCEL file into ALV.I have tried out with GUI_UPLOAD and other excel upload function module.But these Function Module throws Dump.
    Can you please suggest how to go about it.It will be a great help if u can suggest any function module or method.

    Hi Amita,
    Insetad of using GUI_UPLOAD use 'HR_KR_XSTRING_TO_STRING'
    Here is the sample code,
    TYPES :BEGIN OF str_itab,
                  name(10) TYPE c,
                  age(10) TYPE c,
                 END OF str_itab.
    DATA : t_table1 TYPE STANDARD TABLE OF str_itab,
           i_data TYPE STANDARD TABLE OF string,
                   lo_nd_sflight TYPE REF TO if_wd_context_node,
                    lo_el_sflight TYPE REF TO if_wd_context_element,
                    l_string TYPE string,
            fs_table TYPE str_itab,
                    l_xstring TYPE xstring,
    fields TYPE string_table,
    lv_field TYPE string.
    DATA : t_table TYPE if_main=>elements_data_tab,
    data_table TYPE if_main=>elements_data_tab.
      * get single attribute
    wd_context->get_attribute(EXPORTING name =  `DATASOURCE`  
                              IMPORTING value = l_xstring ).
    CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
    EXPORTING
    in_xstring = l_xstring
    IMPORTING
    out_string = l_string.
    SPLIT l_string  AT
    cl_abap_char_utilities=>newline INTO TABLE i_data.
      * Bind With table Element.
    LOOP AT i_data INTO l_string.
    SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE
    fields.
    READ TABLE fields INTO lv_field INDEX 1.
    fs_table-name = lv_field.
    READ TABLE fields INTO lv_field INDEX 2.
    fs_table-age = lv_field.
    APPEND fs_table TO t_table1.
    ENDLOOP.
    lo_nd_sflight = wd_context->get_child_node( 'DATA_TAB' ).
    lo_nd_sflight->bind_table( t_table1 ).
      ENDMETHOD.
    if correct give correct answer
    Thanks & Regards,
    Meenachi.R

  • How can i read local excel file into internal table in webdynpro for abap a

    Could someone tell me how How can i read local excel file into an internal table in webdynpro for abap application.
    thank u for your reply

    Deep,
    File manuplations...............................
    1. At the presentation level:
    ->GUI_UPLOAD
    ->GUI_DOWNLOAD
    ->CL_GUI_FRONTEND
    2. At the application server level:
    ->OPEN DATASET : open a file in the application server for reading or writing.
    ->READ DATASET : used to read from a file on the application server that has been opened for reading
    -> TRANSFER DATASET : writing data to a file.
    -> CLOSE DATASET : closes the file
    -> DELETE DATASET : delete file
    If file is on the local PC,use the function module GUI_UPLOAD to upload it into an internal table by passing the given parameters......
    call function 'GUI_UPLOAD'
    exporting
    filename = p_file
    filetype = 'ASC'
    has_field_separator = '#'
    tables
    data_tab = t_data
    p_file : excel file path.
    t_data : internal table
    <b>reward points if useful.</b>
    regards,
    Vinod Samuel.

  • In SAP Webdynpro using ABAP,how to colour the downloaded excel file?

    Hi all Experts'
    I have downloaded the data from the webdynpro application into an excel file in the presentation server using a custom button in a layout of a view in the webdynpro component.
    Now the requirement is to colour the column heading names and the downloaded excel file should show the full column length.
    Could anybody help me on this how to do this two things.
    Thanks in advance.

    Hi,
    You can use this function GUI_EXEC.
    Let say you want to use winzip to zip the file then what you should do like this:
    use this command --> ' -min -a D:\WALCOTT.ZIP D:\MBARANG.TXT'
    D:\MBARANG.TXT --> path to the file you want to Zip
    D:\WALCOTT.ZIP --> result zip file
    The command above is depends on the software you use to zip.
    then
      DATA: cmdguiexec(150).
      cmdguiexec = cmd.
      CALL FUNCTION 'GUI_EXEC'
        EXPORTING
          command          = cmdguiexec.
    Hope this help you.
    Best Regards,
    Victor.

  • File download from DMS into Webdynpro for ABAP application

    I need to download the file from DMS content server on the PC and with my application on clicking of file name, file needs to be displayed.
    To achieve the downloading part I tried BAPI_DOCUMENT_CHECKOUTVIEW2, but it is not working.
    If I pass the parameters
    PF_HTTP_DEST              = 'SAPHTTPA'
    PF_FTP_DEST               = 'SAPFTPA', then it returns error message saying file can not be saved.
    If I don't pass above parameters then it gives me 'RFC_START_PROGRAM' error.
    How to download the file from DMS in WebDynpro and read/display the content?
    Please help.
    Thanks, in advance.

    Hi,
    I had the same problem, but found a solution. All I changed was the hostname to 'DEFAULT'
    Use the code below:
    DATA: lt_drao TYPE TABLE OF drao,
             wa_drao TYPE drao,
             wa_bin TYPE x LENGTH 2550,
             lt_bin LIKE TABLE OF wa_bin,
             file_data TYPE xstring,
             v_line TYPE i,
             size TYPE i.
       CALL FUNCTION 'CVAPI_DOC_CHECKOUTVIEW_DIALOG'
         EXPORTING
           pf_dokar                 = ls_input-dokar
           pf_doknr                 = ls_input-doknr
           pf_dokvr                 = ls_input-dokvr
           pf_doktl                 = ls_input-doktl
    *     PF_FTP_DEST              = 'SAPFTPA'
    *     PF_HTTP_DEST             = ' '
          pf_hostname              = 'DEFAULT'
          pf_content_provide       = 'TBL'
    *     PS_API_CONTROL           =
    *   IMPORTING
    *     PSX_MESSAGE              =
    *     PSX_FILE                 =
    *     PSX_DRAW                 =
        TABLES
          ptx_content              = lt_drao.
       LOOP AT lt_drao INTO wa_drao.
         wa_bin = wa_drao-orblk.
         APPEND wa_bin TO lt_bin.
       ENDLOOP.
       DESCRIBE TABLE lt_drao LINES v_line.
       size = 2550 * v_line.
       CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
         EXPORTING
           input_length       = size
    *     FIRST_LINE         = 0
    *     LAST_LINE          = 0
        IMPORTING
          buffer             = file_data
         TABLES
           binary_tab         = lt_bin
    *   EXCEPTIONS
    *     FAILED             = 1
    *     OTHERS             = 2
       IF sy-subrc <> 0.
    * Implement suitable error handling here
       ENDIF.
    CALL METHOD cl_wd_runtime_services=>attach_file_to_response
         EXPORTING
           i_filename      = 'abc.pdf'
           i_content       = file_data
           i_mime_type     = 'application/pdf'
    *     i_in_new_window = ABAP_FALSE
    *     i_inplace       =  ABAP_FALSE

  • PeopleCode to "Save As" - convert an excel file to XML file

    All,
    Is there any way to convert an excel file to XML file via PeopleCode? I can manually "Save As" an excel file to be an XML file, but is there anyway of doing it via PeopleCode? I guess it would be a little possible via VBScript, but since by App server resides on a Unix box, that would not work.
    Any help would be really appreciated.
    Thanks,
    Mani

    The attached zip file contains several VI's to read and write directly to Excel using ActiveX. There are several example VI showing how to use everything. This set is saved in LabVIEW 6.0.2.
    I suggest you unzip these to your user.lib directory so you'll be able to easily access them from the functions palette.
    I have not actually used these, but others that have say they have worked well for them.
    Good Luck
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    excel_lv6i.zip ‏898 KB

  • URL Link on downloaded Excel File

    Hi,
    I have got a requirement.
    For study and analysis purpose user download data on excel file from OCOD. Struture(Contents) of downloaded excel file is same as screen.
    But the problem is when user click on 'DETAIL' (which has URL link) he/she is directed to Live OCOD and asked for log in with ID and Password, even if
    user is logged in OCOD.
    What i want to do is.
    1) Download Excel file without any URL link.
    2) If 1) is not possible then do not want to have 'DETAIL' option of downloded file.
    3) Method for avoiding relog into OCOD.
    Thanks in Advance
    Yuj

    Yuj, within the application click on the Training and Support link in the upper right, then click on Add-On Applications, then click on Reports and Analysis for Excel Template. In order to take the webinar click on Browse Training, then click on Training Resources by Job, then click on All Users, then click on Using Mail Merge for Word and Reports and Analysis for Excel with Oracle CRM On Demand.

  • Excel file to XML file

    Hi Expets!
    I have a requirement to convert  Excel file to XML file. This is new to me . When i serach in SDN i came to know that we want to create an EJB Module. I am not having much knowledge in Java bean. we are using the PI7.1 version.
    I need to know what is the basic requirements for creating this EJB Module and also some inputs for how to start with this scenario.
    Thanks and Regard's
    Preethi.

    u have to create a adapter module for the same...
    /people/shabarish.vijayakumar/blog/2009/04/05/excel-files--how-to-handle-them-in-sap-xipi-the-alternatives
    http://wiki.sdn.sap.com/wiki/display/ABAP/AdapterModuleToReadExcelFilewithMultipleRowsandMultiple+Columns
    /people/sap.user72/blog/2005/07/04/read-excel-instead-of-xml-through-fileadapter
    Libraries for adapter module development:
    http://wiki.sdn.sap.com/wiki/display/XI/Where%20to%20get%20the%20libraries%20for%20XI%20development
    how to create adapter module in PI7.1:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e6747fa

  • Download Excel file from  from a second server

    Hi,
    In our Java based web application (jsp pages) users need to download Excel files stored on a different server (business tier) than the first application server server that hosts only the presentation tier.
    For security reasons users don't access the second application server. From a technical point of view what's the best solution to answer this requirement ? The logic should be the following: the user clicks on a report name that is displayed on this browser, the request is sent to the first application server that will retrieve the report stored on a second server and will return it to the user.
    Thanks a lot.

    it's been a while since i've done ejb stuff, but i believe you can configure an ejb to "runas" a different user. so, you would configure an ejb on the accessible server to "runas" a user who has access to the secondary server.

  • Download Excel file using JSP

    Hi All,
    I am working on a JAVA/JSP application. JSP page passes the user inputs to JAVA page (using POST method) which queries to the database and generate an Excel file and returns the link for that file. I am displaying that link in JSP page ("Your file is successfully saved. Click here to download or view your file).
    Now what I want is when the user clicks on the link, open/save dialog will appear which give flexibility to the user to download or view the file in same JSP page. The problem is I don�t want to post again the data or dont want to open a child window. How to set the content type without posting it (I don�t know much about this). Is there any way to do this?
    Any help is highly appreciated. Thanx in advance
    Cheers
    Inderpal

    Hi
    Iam retreiving a file which is in image type in Ms SQl database, but while im retreiving the data from database using Servlet OutputStream the data is showing in binary format with all speciall symbols and text inside .Iamunable to find the solution for that,
    Pleas help me
    my code
              response.setContentType("application/msword");                    
                   OutputStream ros = response.getOutputStream();
              ros.flush();
                   ros.write(bt,0,bt.length);
    Thankz for ur help ,
    my id: [email protected]

  • Problems with Adapter module converting Excel file to XML

    Hi All,
    I have created an adapter moduel to convert the input excel file to XML and have deployed it. While testing we found that there is an extra empty record with empty elements added additionally. Can anyone help on this?
    Below is the convert function used for it.
    public byte[] convert(byte src[],String msgType,String nameSpace) throws Exception
                        String xmldata = "";
                        try
                               ByteArrayInputStream byteArr= new ByteArrayInputStream(src);
                               Workbook wb = Workbook.getWorkbook(byteArr);
                               Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"AO: Conversion Started.");
                               xmldata ="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n"+ "<ns0:"+msgType+" "+"xmlns:ns0=\""+nameSpace+"\">";
                               Cell[] cells ;
                               Cell[] cellNames ;
                               cellNames = wb.getSheet(0).getRow(4);
                               for(int j=5;j<wb.getSheet(0).getRows();j++)
                                       xmldata = xmldata+"<Record>";
                                       cells = wb.getSheet(0).getRow(j);
                                       for(int i=1;i<wb.getSheet(0).getColumns();i++)
                                            xmldata = xmldata+"<"+cellNames<i>.getContents().replaceAll(" ","")+">"+cells<i>.getContents()+"</"+cellNames<i>.getContents().replaceAll(" ","")+">";
                                       xmldata = xmldata+"</Record>";
                                xmldata = xmldata + "</ns0:"+msgType+">";     
                                                            wb.close();
                         catch (Exception e)
                             Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"AO: Exception in Convert Method.");
                         return xmldata.getBytes();
    Regards,
    Malini
    Edited by: malini balasubramaniam on Mar 5, 2010 7:28 AM

    Hi,
    xmldata = xmldata+"<Record>";
    cells = wb.getSheet(0).getRow(j);
    for(int i=1;i<wb.getSheet(0).getColumns();i++)
    xmldata = xmldata"<"cellNames<i>.getContents().replaceAll(" ","")">"cells<i>.getContents()"</" ","")">";
    xmldata = xmldata+"</Record>";
    Can u please change this part of code as
    Hi,
    cells = wb.getSheet(0).getRow(j);
    if(cells.size()>0)  
    xmldata = xmldata+"<Record>";
    for(int i=1;i<wb.getSheet(0).getColumns();i++)
    xmldata = xmldata"<"cellNames<i>.getContents().replaceAll(" ","")">"cells<i>.getContents()"</" ","")">";
    xmldata = xmldata+"</Record>";
    Check first if the row is empty...
    im nt sure it is cells.size() or cells.length.. please try both
    Thanks & Regards
    Babu

  • Filename of downloaded Excel file

    I frequently download Excel files from a website that seems for the most part windows centric. These excel files have an extension of .xls, I can double click them to open, but when opened they just have the file name of WORKSHEET. If I rename the file in the finder the same thing happens. If I try to open the file in numbers I get something like
    <table border="1">
    <!-- <tr><td colspan = "15" valign="middle" align="center">Date: 8/1/2008</td></tr>-->
    <!-- <tr><td colspan = "15" valign="middle" align="center">Investor's Business Daily Æ</td></tr> -->
    <tr><td colspan = "15" valign="middle" align="center">Investor's Business Daily 100</td></tr>
    <tr><td colspan = "15" valign="middle" align="center">Data as of 8/1/2008 market close</td></tr>
    Any idea? Now I have to open the file in excel, then do a save as, type in the file name (if I don't want WORKBOOK), then delete (or write over) the original file. What can I tell the website people?

    Hello ,
    In my procedure i am passing id and with the help of that id , ia am fetching values from the database.
    i have declared on clob type variable say v_insert where i am storing table structure(like worksheet) which i need on excel
    example
    v_insert := v_insert||'<tr>';
            v_insert := v_insert||'<td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td><b>Column1_Value</b></td> <td>abc</td>';
        v_insert := v_insert||'</tr>';then i am converting that clob into blob and storing the content into BLOB type variable say v_blob
    below is the code used for downloding the blob content.
    wpg_docload.download_file(v_blob);Thanks,
    Jitendra

  • Convert MS Excel File to XML using ssis

    Dear Experts,
    i want convert Excel file to XML(based on .XSD) using SSIS-2012.
    so request you to provide steps how to build this job.
    Thanks in Advance.
    Anil.

    Have Data Flow1 - Export Excel data to SQL Table
    Have Data Flow2 -
    Export SQL Table to XML by using FOR XML clause in your SELECT statement.
    FOR XML clauses has several options such as RAW/AUTO or specify the ROOT and then you get the XML the way you want.
    Another option is to use 3rd party Cozyroc -
    Template Task
    Cheers,
    Vaibhav Chaudhari
    [MCTS],
    [MCP]

  • How to create an Excel file from XML in the Receiver File Adapter Comm Ch

    How do I create an Excel file from XML in the Receiver File Adapter Communication Channel? I have my mapping done and I am outputting the file as a comma delimited csv file. However, the target can only process an Excel file (.xls). How can I generate an Excel in XI?
    I saw this blog, but I don't know how to create a XSLT transformation.
    /people/michal.krawczyk2/blog/2005/12/10/xi-generating-excel-files-without-the-java-nor-the-conversion-agent-not-possible
    Any help would be appreciated. Thanks.

    Here are the steps I took to create an XSLT transformation in XI 3.0:
    1. I created my source and target XSDs using XMLSpy.
    2. I created the XSLT mapping from source to target in XMLSpy (referencing the souce XSD schema).
    3. I created another XSLT mapping to format the target into Excel XML.
    4. Import the source and target XSDs in the IR's External Definitions
    5. Zip each XSLT mapping (.xls) and import it into the IR's Imported Archives
    6. Reference the XSL mappings in the Interface Mapping

  • Excel in Webdynpro for abap

    Hi Experts,
    I have excel file (example "http://xxxx/test.xls") with contents. I want to incorporate this excel file into my web dynpro application. For this I used Officecontrol UI element and set the following properties for Officecontrol
    1. datasource : binding with context attribute DATAS(xstring)
    2. document type : ms_excel
    Please suggest how to display excel with contents in view of my application.
    Can any one help me.....
    Thanks & Regards
    Sridhar

    Hi Thomas,
    Thanks for your time.  Here my requirement is ..
    I have an excel file "http://sdn.sap.com/test.xls" , I can  open this file through web browser without any authorizations  ( i.e open to all).
    I need to show this excel file in web dynpro application, for this I used officecontrol UI element. Please suggest the right way...
    I saw few web dynpro applications like "IOS_TEST_SPREADSHEET_MS", but here excel file is available in MIME repository. so the following code is used
    mime_repository = cl_mime_repository_api=>get_api( ).
      CALL METHOD mime_repository->get
        EXPORTING
          i_url = url
        IMPORTING
          e_content = content.
    Instead of this code what I have to do...
    Please help me.....
    Thanks
    Sridhar

Maybe you are looking for