If you have not read the [overview | Organize your business attachments from Web] & {code:html}BSP/How To: Create attachment in Business transactions{code}, I would recommend to read those before you continue this blog.
Let's look at the outcome of this blog before we jump into the details.
*Note:* We will display & delete those documents, which we created in {code:html}BSP/How To: Create attachment in Business transactions{code} of this series blog.{code:html}
- Using this BSP Application we will view those attachment in web.
- Create the BSP Application, let's name it as ZATTACH_DISPLAY with Page List.htm (Page With Flow Logic)
- I used Iterator methodology to display the tableview. Here are the steps:
- Create the Iterator class; let's name it as ZCL_ATTACH_ITR.
- Under the Interface Tab, mention "IF_HTMLB_TABLEVIEW_ITERATOR" as interface.
- Place the below code in method GET_COLUMN_DEFINITIONS
method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS.
CLEAR p_column_definitions.
CLEAR p_overwrites.
DATA: tv_column TYPE TABLEVIEWCONTROL.
tv_column-COLUMNNAME = 'FILE_DATE'.
tv_column-sort = 'X'.
tv_column-TITLE = 'Date'.
tv_column-WIDTH = '70'.
APPEND tv_column TO p_column_definitions.
CLEAR tv_column.
tv_column-COLUMNNAME = 'FILE_NAME'.
tv_column-TITLE = 'File Name'.
tv_column-WIDTH = '120'.
APPEND tv_column TO p_column_definitions.
endmethod.
- Create the below variable in page attribute: