Skip to Content
0
Former Member
Jun 19, 2009 at 08:36 AM

Create attachement problems

45 Views

I am new to WF and yesterday I did have a decison task coming through with a document number included in the attachment section, but now its not working. I cant figure out what I have changed but here is what I have done.

(1) Copied task 17900037

(2) Added the task to my WF - and I'm bing the %_ATTACH_OBJECT& to the task &_WI_RESULT&

(3) then added the binding to my decision task

But now the attachemnt is not getting created and when I look at the object the result contains the below which doenst include my document number and the link doesnt actually load anything. Below is my code - any pointers please...

Document + Recipient: FOL31000000000004OBJ34000000000011

BEGIN_METHOD Z_CREATE_ATTACHMENT CHANGING CONTAINER.

DATA:

pers_ref_contract TYPE SWOTOBJID,

ref_attachment TYPE SWC_OBJECT,

key_attachment TYPE SWO_TYPEID,

keyline_contract TYPE soli-line,

keytab_contract TYPE table of soli-line,

L_DOCUMENTTITLE TYPE SO_OBJ_DES.

DATA: tab_nonclearable_items LIKE rseg_buzei OCCURS 0,

f_belnr type belnr_d,

f_gjahr type gjahr.

swc_get_element container 'DocumentNumber' f_belnr.

swc_get_element container 'FiscalYear' f_gjahr.

CALL FUNCTION 'SWO_OBJECT_ID_GET'

EXPORTING

object = object-_handle

IMPORTING

OBJID = pers_ref_contract.

move f_belnr to keyline_contract.

append keyline_contract to keytab_contract.

SWC_GET_PROPERTY self 'IDENT' L_DOCUMENTTITLE.

swc_create_object ref_attachment 'MESSAGE' key_attachment.

SWC_CONTAINER l_container.

SWC_SET_ELEMENT l_container 'NO_DIALOG' 'X'.

SWC_SET_ELEMENT l_container 'DOCUMENTTYPE' 'OBJ'.

SWC_SET_TABLE l_container 'DOCUMENTCONTENT' keytab_contract.

SWC_SET_TABLE l_container 'DOCUMENTHEADER' keytab_contract.

SWC_SET_ELEMENT l_container 'DOCUMENTTITLE' L_DOCUMENTTITLE.

SWC_SET_ELEMENT l_container 'DOCUMENTNAME' L_DOCUMENTTITLE.

swc_call_method ref_attachment 'CREATE' l_container.

SWC_SET_ELEMENT CONTAINER RESULT ref_attachment.

END_METHOD.