‎2005 Sep 21 1:39 PM
hi,
I try to upload several photos BDS, assaigning themto sales order,
I use BDS classname BUS2032 and classtype BO
but function module 'BDS_BUSINESSDOCUMENT_CREATEF' and cl_bds_document_set class method create_with_files returns same error SBDS205. I supposed, something is missing, but what?
here is the code..
DATA: o_document_set TYPE REF TO cl_bds_document_set,
wa_signature LIKE bapisignat,
i_signature LIKE bapisignat OCCURS 1,
wa_files LIKE bapifiles,
i_files LIKE bapifiles OCCURS 1,
i_object_key LIKE bapibds01-objkey.
CREATE OBJECT o_document_set.
MOVE: '1' TO wa_signature-doc_count,
'1' TO wa_files-doc_count,
'c:\temp' TO wa_files-directory,
'1.jpg' TO wa_files-filename.
APPEND wa_signature TO i_signature.
APPEND wa_files TO i_files.
i_object_key = '0000261877'.
BREAK-POINT.
CALL METHOD o_document_set->create_with_files
EXPORTING
classname = 'BUS2032'
classtype = 'BO'
CHANGING
object_key = i_object_key
files = i_files
signature = i_signature
.
DATA : files LIkE BAPIFILES OCCURS 1 WITH header line.
files-doc_count = '1'.
files-directory = 'c:\temp\'.
files-filename = '1.jpg'.
APPEND files.
CALL FUNCTION 'BDS_BUSINESSDOCUMENT_CREATEF'
EXPORTING
LOGICAL_SYSTEM =
classname = 'BUS2032'
classtype = 'BO'
CLIENT = SY-MANDT
OBJECT_KEY = '0000261877'
IMPORTING
OBJECT_KEY =
tables
files = files
SIGNATURE =
EXCEPTIONS
NOTHING_FOUND = 1
PARAMETER_ERROR = 2
NOT_ALLOWED = 3
ERROR_KPRO = 4
INTERNAL_ERROR = 5
NOT_AUTHORIZED = 6
OTHERS = 7
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Message was edited by: Igor Troshkov
‎2005 Sep 21 1:56 PM
Hi,
There is nothing wrong with the code. Make sure the file exists and the file path is correct.
Sri
‎2005 Sep 21 1:56 PM
Hi,
There is nothing wrong with the code. Make sure the file exists and the file path is correct.
Sri
‎2005 Sep 21 2:11 PM
i am sure with the path/filename. I also tried variants with/without capital letters/end slashes,
but problem is the same
‎2005 Sep 21 2:30 PM
‎2005 Sep 21 2:43 PM
it seems to me this note is concerning basis,
but i already upload picture using tr OAOR with same parametres, and this transaction have to use the same method
‎2005 Sep 21 2:53 PM
Hi,
Then put a breakpoint in the fm and go to OAOR and upload the image file and then check the FILES and SIGNATURE tables.
Compare them with what you are filling in your test program. That should help..
Sri
‎2005 Sep 21 10:19 PM
you need to pass the logical system
use the following FM to get the logical system
OWN_LOGICAL_SYSTEM_GET
for
BDS_BUSINESSDOCUMENT_CREATEF
to work
Regards
Raja
‎2005 Sep 22 7:06 AM
ok. now it is working. thanks to every body
Message was edited by: Igor Troshkov
‎2005 Sep 22 9:17 AM
‎2006 Oct 20 10:05 PM
I hope you read this message. I tried your code to attach a PDF document to invoice. It works, but why I got 2 attachments instead of one. Also since this is a test, how do I delete the attachment? I use trans. VF03 then go to
System -> Service for object -> attachmentlist to view the attachment. But I cannot click on the attachment and click on trash can. It said cannot delete under this type of document. Is there a FM to delete the attachment? By the way, where the link is stored after attachment is created?
Thanks