cancel
Showing results for 
Search instead for 
Did you mean: 

View Attachment option in Webdynpro ALV using ABAP

Former Member
0 Kudos

Dear Friends,

I want to create a View Attchment option in ALV Cell,where if the user click he can see his document.

Highly appreciate if anyone helps me with any appropriate template.

Thanks in Advance

Jay

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

Create a cell editor of type File Download UI and use attach_file_to_response to display the attachment.

Or you can even create a button/ link_to_action and in onAction of the button/link to action, get the xstring of the file from context and display the file.

Regards,

Kiran

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi!

Amy's answer seems to match the question and still she's getting a helpfull not correct mention. Is there something else you need to knwo? Please provide more informations and we'll be pleased to help you go further.

Regards.

amy_king
Active Contributor
0 Kudos

Hi Jay,

You could set the cell editor of your ALV column to a LinkToAction...

  data lo_interfacecontroller type ref to iwci_salv_wd_table .

  data lo_model                    type ref to cl_salv_wd_config_table.

  data lo_column_settings    type ref to if_salv_wd_column_settings.
  data lo_column                  type ref to cl_salv_wd_column.


  data lo_linktoaction            type ref to cl_salv_wd_uie_link_to_action.


* Get ALV model

  lo_interfacecontroller = wd_this->wd_cpifc_my_alv( ).  " here, wd_this is the view

  lo_model = lo_interfacecontroller->get_model( ).

* Set LinkToAction as the column's cell editor

  create object lo_linktoaction.

  lo_column_settings ?= lo_model.
  lo_column = lo_column_settings->get_column( 'COLUMN_ID' ).

  lo_column->set_cell_editor(
lo_linktoaction ).

Then have the LinkToAction open your attachment as needed. For example, if the attachment is stored as a SmartForm, .

Cheers,

Amy