<div><br clear="all">Hi Experts,<br><br>In my work flow I have a requirement where in I need to add an existing smart form as an attachment to my workitem. For this I have a created a BOR method which will convert smart form otf data to xstring via CONVERT_OTF function module and then pass the return XSTRING file to the function module SAP_WAPI_ATTACHMENT_ADD. I could see the workitem in SBWP but when I try to execute the work item is going error status (Workitem not executable) and when I click on attachment I am getting a pop-up message &quot;this file does not have a program associated with it for performing this action.create an association in the set associations control panel &quot; .</div>

<div> </div>
<div> I also see in SWI2_DIAG the following error messages.<br><br>Work item 000001042120: Object DECISION method PROCESS cannot be executed<br>Method container for work item cannot be created<br>Method container for work item cannot be created<br>
Unable to instantiate object &#39;_ATTACH_OBJECTS&#39;<br>Error handling for work item 000001042120<br></div>
<div> </div>
<div>Below is my BOR method code and please let me know where I am doing wrong.<br><br>begin_method attachment changing container.<br>data:func_mod_name type rs38l_fnam.<br><br>data:<br>output_options type ssfcompop, &quot; optional part of<br>
t_otf_from_fm type ssfcrescl,<br>wa_control_parameters type ssfctrlop, &quot; optional part<br>tt_otf type table of itcoo,<br>ts_otf type itcoo,<br>lt_solix_tab type solix-line occurs 0,<br>zxstring type xstring,<br>w_bin_filesize type i,<br>
w_bin_file type xstring,<br>tt_pdf_tab type table of tline,<br>ts_pdf type tline,<br>lv_wi_id type swr_struct-workitemid,<br>ls_wi_id type swwwihead-wi_id,<br>ls_header type swr_att_header,<br>zsofm type swc_object,<br>ls_att_id type swr_att_id.<br>
<br>swc_get_element container &#39;lv_workitem_id&#39; ls_wi_id.<br><br>call function &#39;SSF_FUNCTION_MODULE_NAME&#39;<br>exporting<br>formname = &#39;ZTEST_CFG&#39;<br>* VARIANT = &#39; &#39;<br>* DIRECT_CALL = &#39; &#39;<br>
importing<br>fm_name = func_mod_name<br>* EXCEPTIONS<br>* NO_FORM = 1<br>* NO_FUNCTION_MODULE = 2<br>* OTHERS = 3<br>.<br>if sy-subrc 0.<br>* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO<br>* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.<br>
endif.<br>wa_control_parameters-no_dialog = &#39;X&#39;.<br>wa_control_parameters-preview = &#39;X&#39;.<br>wa_control_parameters-getotf = &#39;X&#39;.<br>output_options-tddest = &#39;LP01&#39;.<br><br>call function func_mod_name<br>
exporting<br>* ARCHIVE_INDEX =<br>control_parameters = wa_control_parameters<br>MAIL_APPL_OBJ =<br>MAIL_RECIPIENT =<br>MAIL_SENDER =<br>output_options = output_options<br>user_settings = &#39; &#39;<br>importing<br>DOCUMENT_OUTPUT_INFO =<br>
job_output_info = t_otf_from_fm.<br><br>tt_otf = t_otf_from_fm-otfdata.<br><br>call function &#39;CONVERT_OTF&#39;<br>exporting<br>format = &#39;PDF&#39;<br>max_linewidth = 132<br>* ARCHIVE_INDEX = &#39; &#39;<br>* COPYNUMBER = 0<br>
* ASCII_BIDI_VIS2LOG = &#39; &#39;<br>* PDF_DELETE_OTFTAB = &#39; &#39;<br>* PDF_USERNAME = &#39; &#39;<br>importing<br>bin_filesize = w_bin_filesize<br>bin_file = w_bin_file<br>tables<br>otf = tt_otf<br>lines = tt_pdf_tab.<br>
ls_header-file_type = &#39;B&#39;.<br>ls_header-file_name = &#39;FORM&#39;.<br>ls_header-file_extension = &#39;PDF&#39;.<br>ls_header-language = &#39;EN&#39;.<br>lv_wi_id = ls_wi_id.<br><br>call function &#39;SAP_WAPI_ATTACHMENT_ADD&#39;<br>
exporting<br>workitem_id = lv_wi_id<br>att_header = ls_header<br>* ATT_TXT =<br>att_bin = w_bin_file<br>DOCUMENT_OWNER = SY-UNAME<br>LANGUAGE = SY-LANGU<br>DO_COMMIT = &#39;X&#39;<br>importing<br>* RETURN_CODE =<br>att_id = ls_att_id.<br>
<br>swc_set_element container &#39;ZATT_ID&#39; ls_att_id.<br>swc_set_element container &#39;ZSOFM&#39; ls_att_id-doc_id.<br><br>ZATT_ID is the exporting paramter with type SWR_ATT_ID.<br>ZSOFM is the exporting parameter of object type SOFM.<br>
<br>-- <br>Thanks and Regards<br>Srini..<br><br></div>