cancel
Showing results for 
Search instead for 
Did you mean: 

Passing attachments with triggering events.

Former Member
0 Kudos
231

Hi all,

My requirement is to pass a link for an Office document from my customised event to my WF task. Now how to do it?

-I m getting the document <b>path-id</b> in one of my parameter variables in a SE38 prog.

-Passing the same to the Event container variable of <b>SOFM type</b> .

-Triggering the Event from <b>'SAP_WAPI_CREATE_EVENT'</b> function module..

-But not getting the velue in my <b>Workflow container</b> variable of <b>SOFM type</b>.

Can someone please help.

Regards,

Sudipto...

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sudipto,

You will have to create an instance of object of type SOFM from your program and them thro' event container, bind it to container element <b>_Adhoc_Objects</b>.

If SOFM object is created correctly, it will show the link in your work item as you required.

Hope it helps.

Regards,

Akshay Bhagwat

Message was edited by: Akshay Bhagwat

Former Member
0 Kudos

Doing the same. But still not getting the values...

Find attached herewith the concised code...

******************************************************************************************************************

REPORT ZTESTATTACHMENT .

PARAMETERS: P_FILE like RLGRAP-FILENAME OBLIGATORY.

data file like sofm.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE .

REFRESH FILES.

call method cl_gui_frontend_services=>file_open_dialog

exporting

window_title = l_title

changing

file_table = files

rc = subrc

exceptions

file_open_dialog_failed = 1

cntl_error = 2

error_no_gui = 3

others = 4.

check sy-subrc = 0.

loop at files into l_file.

str_file = l_file.

move str_file to filename.

exit.

endloop.

MOVE FILENAME TO P_FILE.

start-of-selection.

file = p_file.

ev_container-element = 'sofm'.

ev_container-value = file.

append ev_container.

clear ev_container.

CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'

EXPORTING

OBJECT_TYPE = 'ZTATTCH'

OBJECT_KEY = '10000000'

EVENT = 'attch'

  • COMMIT_WORK = 'X'

  • EVENT_LANGUAGE = SY-LANGU

  • LANGUAGE = SY-LANGU

USER = SY-UNAME

  • IFS_XML_CONTAINER =

  • IMPORTING

  • RETURN_CODE =

  • EVENT_ID =

TABLES

INPUT_CONTAINER = ev_container.

  • MESSAGE_LINES =

  • MESSAGE_STRUCT =

*----


******************************************************************************************************************

Kindly guide and help...

Regards,

Sudipto...

Former Member
0 Kudos

Hi Sudipto,

As I had already mentioned, this file i.e. document which you want to attach is not been created as an object of SOFM. This is present on Presentation server i.e may be on your PC but not in SAP system.

Have a look at <b>Create</b> method of SOFM. Check whether some part of this code can be used to create SOFM object instance i.e. your document has to be in SAP in the form of SOFM object, then only you will be able to see it as an object link.

Hope this helps to start off..

Regds,

Akshay