Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

In this wiki i want to share how to upload files using cl_fitv_gos class. As this class handles the file upload and download , developer need not create any table to maintain the file information.This class is more suitable for webdynpro abap ess related applications.

Use save method of cl_fitv_gos_class to upload the file

call method cl_fitv_gos=>save
    exporting
      iv_name    = lv_zfile_name "(pass the file name from context)
*    im_content     =
      iv_content_hex = lv_zdata "(pass the file content from context) 
      is_lporb       = wd_this->ms_lporb 
      iv_objtp     = 'EXT'
    receiving
      rt_messages    = lt_message
      .
Use the get_links method to generate link

call method cl_fitv_gos=>get_links
      exporting
        is_lporb    = wd_this->ms_lporb
      importing
        et_items    = lt_atta
        et_messages = lt_messages.

use the get_content method to open the file

  CALL METHOD cl_fitv_gos=>get_content
    EXPORTING
      iv_atta_id     = lv_atta_id
      iv_objtp       = stru_attachments-objtp
    IMPORTING
      ev_content     = lv_data
      ev_content_hex = lv_xdata.

The return parameter lt_atta contains the link.Based on the requirement developer can bind lt_atta to a table of type lt_atta and displays the link in the table.For that the table should contain a column with two cell variant. one variant for link to action and other for link to URL.once the link is generated and bind to the table , user can see the uploaded file name as link. Clicks on the link opens in a new browser and displays the file content in browser window.

Use delete method to delete the uploaded file. 

CALL METHOD cl_fitv_gos=>delete
  EXPORTING
      is_lporb    = wd_this->ms_lporb

      iv_atta_id  = l_atta_id

      iv_creator  = stru_attachments-sapnam

      iv_objtp    = stru_attachments-objtp

      iv_objdes   = stru_attachments-objdes

    IMPORTING

      et_messages = lt_messages.

I have attached the screen shots which give more information regarding requisites for file upload and download using cl_fitv_gos class

 

 

 

 

Output


  • No labels

6 Comments

  1. Guest

    Hi Ramanan Panchabakesan and Vijav Babu Dudla,

    First of all thank you for the sample.

    Some of the key settings are not clear in the example. I build exact the same but unfortunaly it doesn't work.

    Can you send a transport with the whole abap WD in email to me so I can compare??

    My email adres: kralfm@hotmail.com

    Thanks in advance!

    Kind regards,

    Muhammet Ali Kara



  2. Guest

    Hi Guys,

      This example has been invaluable for me; but Ive hit a massive road block with displaying the document. 

      Could you please upload the code for the action: ZTRA_OPENFILE?

    thanks,

    Todd

  3. Guest

    Hi Guys ,

    Please go through this blog to clarify your doubts on this: aanoopgupta20.blogspot.com

    Best Regards,

    Anoop

  4. Guest

    Hi Guys ,

    Please go through this blog to clarify your doubts on this: anoopgupta20.blogspot.com

    Best Regards,

    Anoop

  5. Former Member

  6. Former Member

    Hi Vijay and Ramanan,

    Can I use the class CL_FITV_GOS for uploading purchase requisition related attachments also?

    What will be the content of the variable ms_lporb in that case???

    Regards,

    Subhabaha Pal