Skip to Content

BSP/How To: Display/Delete attachment from Business transactions

* *Introduction: This blog describes how to display/delete the documents, which are stored in any SAP Business transactions like IE01, VA01, FB01 and WTY etc from BSP Application.


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}


  1. Let’s say my notification number has 2 attachment as shown below.
  2. Using this BSP Application we will view those attachment in web.
  3. Once you execute the BSP Application, enter the Object Key Number for which you already created the attachment. In my case it’s Notification.
  4. You will get the list of attachments based on your Object key.
  5. You can see 2 buttons at footer to display & delete the attachment. Select the one of the row & click on display button –
  6. The moment you click on display button, popup window will come up with attachment as shown below.
  7. Lets look at the delete functionality. Again select anyone of the line & click on delete button –
  8. Look at the updated attachment list below.

h3. Let’s look at the development steps:

  1. Create the BSP Application, let’s name it as ZATTACH_DISPLAY with Page List.htm (Page With Flow Logic)
  2. 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


      CLEAR p_column_definitions.
      CLEAR p_overwrites.

      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.

  3. Create the below variable in page attribute:
You must be Logged on to comment or reply to a post.
  • Hi Raja,

    First of all: nice how to!

    We've applied your code in our BSP. The creation of the attachments works very well.

    We have the following problem:
    When we try to display our attachments (ex: .doc), it does not work in Internet Explorer 8. (A new window pops up, but it closes again immediately)

    It works perfectly in Firefox and Internet Explorer 6.

    Do you have any idea what could be causing this problem?

    Thanks in advance.


      • Hi,

        I posted this question on sdn, I got the answer over there.
        Apparently it is one of the security settings of IE8 (enable automatic prompting for download screens).

        Thanks anyway!


  • Hi,

    Have you ever tried using the actual file name while building the display_url instead fo using GUID?

    We had used that and it was giving one issue when file name contains any non-english characters.

    Please let me know if you have any workaround on that.