Skip to Content
avatar image
Former Member

Dynamic File Download

Experts,

I have the following requirement in my WebDynpro Java Application.

On clicking of a button on the screen, I have to navigate to another screen where the application will pick up some files based on the file name having a fixed pattern (sapfile*.txt). The files are physically stored in a fixed location (/receiver folder).

So if the folder on the file system has sapfile1.txt, sapfile2.txt and sapfile3.txt, the application should pick up the files and create hyperlinks for the 3 files and display the links on the screen.

(So the fetching of the correct files happens on runtime as the files are being generated continuously in the folder by SAP XI)

Any kind of help would be appreciated.

Regards,

Shobhit

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 26, 2007 at 05:51 AM

    Hai ,

    create a outbound plug to initialview, inbound plug to downloadview.

    fire the outbound plug tin button action to navigate to dowload view.

    wdThis.wdFireTODownloadView();

    Create ContextNode Download under create attribute fileName.

    Create a table ui element right click on table bind the download node to table.

    select the table cell editor as linktoUrl.

    File f=new File("/receiver folder");
    if(f.isDirectory()){
      String str[]=f.list();
     for(int i=0;i<str.length;i++){
    IprivateDownloadView.IDownloadElement ele=wdContext.createDownloadElement();
    ele.setFileName("/receiver folder/"+str<i>);
    wdContext.nodeDownload.addElement(ele);
    }
    }
    

    Regards,

    Naga

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 26, 2007 at 05:33 AM

    Hi Swaroop

    There are some Controls in the webdynpro that are file fetching FileUPLoad and FileDownLoad.So create one more view with this controls and you can extract the files with these.See whether hyperlink controls are available or not.If not you have to write the code for generating those links to the extracted files.Also see the webdynpro documents available in help.sap.com site so that you can fix your problem

    regards

    kalyan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 26, 2007 at 06:31 AM
    Add comment
    10|10000 characters needed characters exceeded