cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to store PDF , XL , Word document into SAP archived tables

Former Member
0 Kudos

Hi Experts,

I have created a web interface in WD ABAP which stores the employee's attachement data into sap arcived link.

For that I have carried out following activities.

I have Complted customizing for a document type under business object PREL and for this I have reffered following link.

SASAP Archived Link

Now I have used file Upload UI element in WDABAP which passes the local file data in Xstring to following function modoules for creating

an attachment.

data: it_out type TOADT,

it_storage type ZDMSSTORAGE.

CALL FUNCTION 'ARCHIV_CREATE_TABLE'

EXPORTING

ar_object = 'HRPDATA' " Object catagory that I have created for file storage under Business Object PREL

object_id = '10000008'

sap_object = 'PREL'

document = filedata

IMPORTING

OUTDOC = it_out

EXCEPTIONS

error_archiv = 1

error_communicationtable = 2

error_connectiontable = 3

error_kernel = 4

error_parameter = 5

error_user_exit = 6

OTHERS = 7.

For reading the attached document I am using following FM's

CALL FUNCTION 'SCMS_AO_TABLE_GET'

EXPORTING

  • MANDT = SY-MANDT

arc_id = 'Z1'

doc_id = lv_doc_type"im_doc "'4D5D8445165220C8E10000000A3C082E'

  • COMP_ID = 'data'

  • IMPORTING

  • LENGTH =

tables

data = bindata.

*data: BINARY_TAB type

CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'

EXPORTING

input_length = 10000

  • FIRST_LINE = 0

  • LAST_LINE = 0

IMPORTING

BUFFER = V_XSTRING

tables

binary_tab = bindata.

Now when I upload any file text or image file, its working fine. When I try to upload any pdf , XL or word document, it uploads the file into acchived table

but when I read this file by converting file data into xstring and passing it into file downlod UI element, It says file is corrupt. Please suggest that if that

is a issue with object catagory configration ( With storage class) or it is wrong way of reading a document for PDF, XL and word

Thanks in advance

Abhay

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi

please check the function module used whether it can handle the PDF as well as xl, word documents. if not use some other function module