Skip to Content
Former Member
Sep 02, 2010 at 01:32 PM

get element from WF-container '_Attach_Objects'


Hello all!

My problem is also including the 'Include cntain'.

Here the surrounding area:

In my class 'zsieb_mailin' I have the inbound processing interface 'IF_INBOUND_EXIT_BCS' with the method 'PROCESS_INBOUND'. In the method I have the function that it identify the email document and its attachment, it converts the pdf-document into a xstring object, it starts the workflow with FM 'SAP_WAPI_START_WORKFLOW', with the FM 'SAP_WAPI_ATTACHMENT_ADD' I write the xstring into the container element '_Attach_Objects' of the workflow.

Here is the fragment:



workitem_id = wiid

att_header = ls_att_header

att_bin = lv_pdf_x


return_code = lv_return

att_id = lv_sofm_id


message_lines = lt_message_lines

message_struct = lt_message_struc.

Till here everything is fine.

Now the problem: Inside the pdf-object I have some data which I also need and which I have to give to the workflow element container. How can I get the element from the '_Attach_Objects' out again?

In the macro area I have the include <cntn02> and >cntn03>. I found in the forum the include <cntn01> and <cntain> but when I want to activate it, the error "it is not allowed to reference with 'LIKE' or 'STRUCTURE' inside a class" appear (the error is inside the include). Because of this I can't work with the methods 'SWC_GET_ELEMENT' and so on.

Now I tried it with this code:

Data tab_any TYPE TABLE OF SOFM.

Data bo_sofm type swc_object.

swc_create_object bo_sofm lv_objsofm lv_objtkey.

*SWC_SET_ELEMENT '_Attach_Objects' 'ObjectType' bo_sofm .

SWC_SET_ELEMENT tab_any 'ObjectType' bo_sofm .

swc_container_to_persistent tab_any.

But there I get the error sy-subrc = 8 (criteria wrong/ search key is wrong) or rather my object tab_any is empty and in the debbuging mode I found the error message 'Exception -> CX_SY_DYN_CALL_ILLEGAL_TYPE'.

Do I miss anything? Is there the possibility to include the include <cntn01>?