Skip to Content
author's profile photo Former Member
Former Member

BDS create/get using class/fm

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2005 at 12:56 PM

    Hi,

    There is nothing wrong with the code. Make sure the file exists and the file path is correct.

    Sri

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 20, 2006 at 09: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.