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,
- There is no customizing settings required, that’s the good news for developers.
- 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
- Business Object Repository object – We are going to explore in detail.
- The advantage is, you can view the documents in SAP along with Business data in one place.
- Object from class library
- In order to store using Class, you need to link our class to document class in Transaction code SBDSV1.
- 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:
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,
Jigesh.
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’ ).
IF FILE->FILE_LENGTH > MAX_LENGTH.
* Send your error message
ENDIF.
* For ITS,
YOu can post your queries in ITS Forums..
Regards,
Raja T
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 ?
regards,
Laxman
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
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?
Regards,
Isaac
My requirement is to create an attachment and display it at another page, but without any business object. Request you to guide as to how to proceed with it.
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.
Thanks,
Murthy katta
.