Upload and Download Files in Webdynpro ABAP

...Previous

Code required in Action ‘upload’.

Go to’ Actions’ Tab.

Place below code in action.

  DATA lo_nd_file_upload TYPE REF TO if_wd_context_node.

    DATA lo_el_file_upload TYPE REF TO if_wd_context_element.
    DATA ls_file_upload TYPE wd_this->element_file_upload
    DATA lt_file_upload TYPE STANDARD TABLE OF wd_this->element_file_upload.

*   navigate from <CONTEXT> to <FILE_UPLOAD> via lead selection
    lo_nd_file_upload = wd_context->get_child_node( name = wd_this->wdctx_file_upload ).

    DATA lo_nd_file_download TYPE REF TO if_wd_context_node.
    DATA lt_file_download TYPE wd_this->elements_file_download.
         lo_nd_file_download = wd_context->get_child_node( name = wd_this->wdctx_file_download ).

*   get element via lead selection
    lo_el_file_upload = lo_nd_file_upload->get_element( ).

*   get all declared attributes
    lo_el_file_upload->get_static_attributes(
      IMPORTING
        static_attributes = ls_file_upload ).
    APPEND ls_file_upload to lt_file_upload.

lo_nd_file_download->bind_table( lt_file_upload  ).

Test Application

To test the application right click on application and click on test like below.

Now View looks like below.

Browse file and click on upload.  

Click on the links under ‘Link to download’. Image file will open in separate window like below.

 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image