Skip to Content
Within this WebLog I want to promote my new Web Dynpro Java learning material (tutorials, articles, sample projects and SDN Wiki code tutorial) on Uploading and Downloading Files in SAP NetWeaver 7.0. The presented Web Dynpro Java sample applications all leverage the newest techniques for uploading and downloading resources based on the newly introduced resource dictionary type and its related Web Dynpro Java APIs. Beginning with the basic technical aspects of file upload and download you will also learn how to utilize the new resource  type  for on-demand file download in Web Dynpro tables or for instant Excel export of Web Dynpro table data:

  • Tutorial: Uploading and Downloading Files in Web Dynpro Java – SAP NetWeaver 7.0
  • Article: Uploading and Downloading Files in Web Dynpro Tables – SAP NetWeaver 7.0
  • NEW: SDN Wiki Code Tutorial: Exporting Table Data Using On-Demand Streams – SAP NetWeaver 7.0

Tutorial: Uploading and Downloading Files in Web Dynpro Java – SAP NetWeaver 7.0

image

In this tutorial you learn how to download and upload files within Web Dynpro applications running on SAP NetWeaver 7.0 by utilizing the new dictionary type Resource and its related Web Dynpro APIs IWDResource and WDResourceFactory. In contrast to the dynamic type modification of a binary context attribute in SAP NetWeaver 04, the new dictionary simple type Resource yields a fully declarative, zero coding data transport of download and upload resources between Web Dynpro client and controller context on server side. Additionally you learn how to apply the new file download behavior types within SAP NetWeaver 7.0: opening resources in-place without opening a dialog window, save resource in local file system (open dialog) and open resource depending on the MIME type of the downloaded file (open dialog).

Article: Uploading and Downloading Files in Web Dynpro Tables – SAP NetWeaver 7.0

This article is an addition to the tutorial above comprising more advanced technical details. Please read this tutorial first to understand the principles of file upload and download in SAP NetWeaver 7.0.

image

In SAP NetWeaver 04 file download and upload inside Web Dynpro Table UI elements was subject to significant technical restrictions which are all solved in the NetWeaver 7.0 release. This article and its related Web Dynpro sample project demonstrate how to upload and download image resources with different mime types per table line, how to store these image resources in a multiple context node of the controller context and how to instantly display an uploaded image in a table cell by utilizing the new Java dictionary type Resource and its related new Web Dynpro Java APIs.  Additionally the article comprises an in-depth description of the new on-demand streaming technique combined with 0-byte resource creation which yields a  heavily reduced context memory consumption on server side.

SDN Wiki Code Tutorial: Exporting Table Data Using On-Demand Streams – SAP NetWeaver 7.0

After having gained my first experiences with the new SDN Wiki I was very impressed by many great advantages this channel yields compared to a PDF- or WebLog-based approach: easy content editing, code formating, collaborative editing, comment support, label/tagging support and much more Web 2.0 like features. I therefor decided to publish my very first Web Dynpro tutorial in the SDN Wiki Code Gallery:

Exporting Table Data Using On-Demand Streams – SAP NetWeaver 7.0.

You are friendly invited to edit this wiki page, to improve or correct its content or to add comments to it using the comments tab.

image

This code tutorial applies the new Web Dynpro file download techniques to the Web Dynpro Excel Export sample application developed for  NW 04: downloading data from a table using the on-demand resource streaming technique in SAP NetWeaver 7.0 combined with a ToolBarLinkToURL-UI-Element to open the Excel resource instantly. This technique does not require opening a Web Dynpro popup window with a LinkToURL-UI-element pointing to a cachedExcel resource. This sample application is implemented in two separate components: a reusable service component for Excel export and a client component displaying table data.

Printing a SDN Wiki Code Tutorial

To print a SDN wiki page you must simply select the context menu item Open Link in New Window above the Print icon in the top right corner. The page content is then rendered in a new window without additional navigation side bar, where you can apply your browser’s print function. 

image

Enjoy Web Dynpro,

Bertram Ganz, Web Dynpro Java Knowledge Transfer, SAP NetWeaver UI, SAP AG

To report this post you need to login first.

6 Comments

You must be Logged on to comment or reply to a post.

  1. Ingo Biermann
    Hi,

    I found this Blog and the corresponding tutorials on download and on-demand-streaming very helpful.

    I use the technique do download String data to the client as HTML and EXCEL (csv).

    I encounter problems whith the charset of the downloaded data. Serverside the data is encoded as UTF-8 and I write it to the client using WDResource and IWDInputStream. On the client (e.g. in the browser) special characters (Umlaute) are not displayed corretly. Setting the view mode to “UTF-8” by hand in the browser fixes the view.

    I am missing a way to set charset encoding of the response. Just like
    response.setContentType(“text/html; charset=utf-8”); in a Java servlet.

    Is there a hint you can provide?

    Regards
    Ingo

    (0) 
  2. Krishna Sri
    Hi,

    Could you guide me how to change browse button with some other image (internationalization) please.

    Thnx & Rgrds,
    Krishna.

    (0) 
  3. Jiannan Che
    Hi Bertram,

    This blog is excellent.  I downloaded the solution code and deployed it to a J2EE Engine, and it worked without any problem in a normal IE browser.  It did not work when I tried it on a Blackberry mobile device.  For file upload, the file exlorer function did not work. For file down load, the radio button did not work. It was complaining about the radio button renderer UI element. Do you have any idea how I can get it to work in a mobile device? Thanks.

    Regards,
    Jiannan

    (0) 
  4. Dharani us
    Hi ,
    Thanks for the wonderful Blog.

    I have requirement to give a file upload option in Java Webdynpro screen and also should create a UI which will display the No of attachments with the DELETE option. So user can delete the selected document.

    Please advice how to pass the document that we have uploaded into webdynpro to SAP R/3?

    Thanks in Advance,
    Dharani

    (0) 

Leave a Reply