Skip to Content

Organize your business attachments from Web

Introduction: This series of blog will explain how to organize your attachment in SAP from web applications like BSP and Webdynpros.

There are many blogs in SDN, which explains how to upload and download the documents in SAP from web.
But there are some scenario where in attachment needs to be managed from web as well as from SAP GUI.
This series of blog will serve & share my views on the same.

There are many ways you can store the attachments in SAP like Records Management, Document Management and Business Document Service (BDS).
I’m going to use BDS to organize the documents.The reasons are,

  1. There is no customizing settings required, that’s the good news for developers.
  2. The documents can be viewed in Business Transaction like IE01, VA01 etc.

In order to view the attachments in web, we need an custom application. In addition, user can view the attachments along with Business data in SAP without any further development effort.

Ways to store:

There are multiple way to store the documents in BDS. Using

  1. Business Object Repository object – We are going to explore in detail.
    1. The advantage is, you can view the documents in SAP along with Business data in one place.
  2. Object from class library
    1. In order to store using Class, you need to link our class to document class in Transaction code SBDSV1.
  3. Other objects – Settings required

Attachment can also be viewed in BDS Navigator (Transaction code OAOR).

We are going to discuss the below items using Business object option in detail:

  1. BSP
    1. BSP/How To: Create attachment in Business transactions
    2. BSP/How To: Display/Delete attachment from Business transactions
  2. Webdynpro – Java
    1. How To: Create attachments in Business Transaction from Webdynpro(Java)
    2. Display/Delete attachment from Business transactions using Webdynpro (Java)
You must be Logged on to comment or reply to a post.
  • Hi Raja, absolutely great weblog.

    We have couple of BSP / ITS applications with requirement to limit the size of attachments. Can you please guide me how to achieve the same ?

    Best Regards,

    • Thanks ...

      I can help you how to restrict the file size in BSP...

      Look at the below code:

        CONSTANTS: MAX_LENGTH  TYPE I VALUE '102400'.             " 1 MB

      FILE ?= CL_HTMLB_MANAGER=>GET_DATA( REQUEST = REQUEST ID = 'uploadID' NAME = 'fileUpload' ).


      * Send your error message


      * For ITS,

      YOu can post your queries in ITS Forums..

      Raja T

  • Hi, Your blog has all useful information.
    is that ordernumber is mandatory? means can I upload the document first and save alogn with interaction record or activity ? Do you have any docs on that ?


    • Thanks for the comment.

      Yes, its mandatory. If you want to save along with record, i would suggest create the record first & get the order number. Then you can save doc in order number. But from front end it will single call.

      Raja T

  • Hi Raja,

    First of all this blog is very useful. But I have problems with the function module BDS_DOCUMENT_GET_TABLE, it doesn't return nothing. I don't know why, I use the same data that return the function BDS_ALL_CONNECTIONS_GET so it is correct. I'm developing something in Web Dynpro for ABAP so it is like the same thing. But I just have this issue, so if you can help me, if I'm doing something wrong I'll very appreciated. I'm testing the function in the transaction SE37, I import the parameter of DOC_ID and I fill the table of SIGNATURE with the fields DOC_COUNT, DOC_ID, DOC_VER_NO, DOC_VAR_ID, DOC_VAR_TG. Another thing is that I'm reading the attachments from the assets (transaction AS02). So I use the ClassName: BUS1022 and the ClassType: BO. Do you know something that I'm doing wrong?


  • Absolutley nice blog Raja,
    Actually i have a problem,
    when uploaing the file from PC,
    i require the file path along with the file name,
    as i need to upload the same to another remote server.
    Kindly reply asap.

    Murthy katta