Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BDS create/get using class/fm

Former Member
0 Likes
6,393

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,893

Hi,

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

Sri

9 REPLIES 9
Read only

Former Member
0 Likes
4,894

Hi,

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

Sri

Read only

0 Likes
4,893

i am sure with the path/filename. I also tried variants with/without capital letters/end slashes,

but problem is the same

Read only

0 Likes
4,893

Hi,

Check OSS Note 317250.

Sri

Read only

0 Likes
4,893

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

Read only

0 Likes
4,893

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

Read only

0 Likes
4,893

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

Read only

0 Likes
4,893

ok. now it is working. thanks to every body

Message was edited by: Igor Troshkov

Read only

0 Likes
4,893

good to hear that its working. all the best.

Regards

Raja

Read only

Former Member
0 Likes
4,893

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