on 02-21-2011 5:09 AM
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.
SA[SAP Archived Link|http://wiki.sdn.sap.com/wiki/display/ERPHCM/AddEmployeePhotoonInfotype+0002]
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.