2012 Feb 17 3:40 PM
HI,
I need to attach a pdf file in plmd_audit transaction my file is already in SAP (AL11 directory); I'm using BDS_BUSINESSDOCUMENT_CREATEF with the standart parameters but not a local directory and, function module return error_kpro = 4
any suggestions?
thx in advance
Fabio
2012 Feb 17 4:01 PM
Hi,
Can you check if below code may be you can find the problem
data: i_files like bapifiles occurs 1 with header line,
i_signature like bapisignat occurs 1 with header line.
i_files-doc_count = '1'.
i_files-comp_count = '1'.
i_files-directory = 'C:\sappcadm'. "#EC NOTEXT
i_files-filename = 'BDSPRESENTATION.PPT'. "#EC NOTEXT
i_files-mimetype = 'PPT'.
append i_files.
i_signature-doc_count = '1'.
i_signature-prop_name = 'BDS_DOCUMENTTYPE'.
i_signature-prop_value = 'BUSTEST'.
append i_signature.
i_signature-prop_name = 'BDS_DOCUMENTCLASS'.
i_signature-prop_value = 'PPT'.
append i_signature.
call function 'BDS_BUSINESSDOCUMENT_CREATEF'
exporting
LOGICAL_SYSTEM =
classname = 'BUS0815'
classtype = 'BO'
CLIENT = SY-MANDT
object_key = '123'
IMPORTING
OBJECT_KEY =
return =
tables
files = i_files
signature = i_signature
2012 Feb 17 5:13 PM
hi
the issue is
i_files-directory = 'C:\sappcadm'. "#EC NOTEXT
because my files are in a sap's directory for example /tmp
if I use the frontend directory it works fine
2012 Feb 17 9:22 PM
I think this FM works only for uploading files from presentation server, at least i could not get it to work for files on AL11. The workaround that i implemented is to download the file from AL11 to the PC using a FM, and then call the FM BDS_BUSINESSDOCUMENT_CREATEF to upload from the folder.
I know this is a very crude method, but i didnt find any other solution. If you come across anything better, do share it on the forum, will help all of us
Regards,
Raghav.