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
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
Add a comment