Skip to Content
0
Former Member
Sep 22, 2010 at 11:48 AM

Work item not executable

321 Views

Hi Experts,

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 "this file does not have a program associated with it for performing this action.create an association in the set associations control panel " .Below is my BOR method code and please let me know where I am doing wrong.

begin_method attachment changing container.

data:func_mod_name type rs38l_fnam.

data:

output_options type ssfcompop, " optional part of

t_otf_from_fm type ssfcrescl,

wa_control_parameters type ssfctrlop, " optional part

tt_otf type table of itcoo,

ts_otf type itcoo,

lt_solix_tab type solix-line occurs 0,

zxstring type xstring,

w_bin_filesize type i,

w_bin_file type xstring,

tt_pdf_tab type table of tline,

ts_pdf type tline,

lv_wi_id type swr_struct-workitemid,

ls_wi_id type swwwihead-wi_id,

ls_header type swr_att_header,

zsofm type swc_object,

ls_att_id type swr_att_id.

swc_get_element container 'lv_workitem_id' ls_wi_id.

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = 'ZTEST_CFG'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

importing

fm_name = func_mod_name

  • EXCEPTIONS

  • NO_FORM = 1

  • NO_FUNCTION_MODULE = 2

  • OTHERS = 3

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

wa_control_parameters-no_dialog = 'X'.

wa_control_parameters-preview = 'X'.

wa_control_parameters-getotf = 'X'.

output_options-tddest = 'LP01'.

call function func_mod_name

exporting

  • ARCHIVE_INDEX =

control_parameters = wa_control_parameters

MAIL_APPL_OBJ =

MAIL_RECIPIENT =

MAIL_SENDER =

output_options = output_options

user_settings = ' '

importing

DOCUMENT_OUTPUT_INFO =

job_output_info = t_otf_from_fm.

tt_otf = t_otf_from_fm-otfdata.

call function 'CONVERT_OTF'

exporting

format = 'PDF'

max_linewidth = 132

  • ARCHIVE_INDEX = ' '

  • COPYNUMBER = 0

  • ASCII_BIDI_VIS2LOG = ' '

  • PDF_DELETE_OTFTAB = ' '

  • PDF_USERNAME = ' '

importing

bin_filesize = w_bin_filesize

bin_file = w_bin_file

tables

otf = tt_otf

lines = tt_pdf_tab.

ls_header-file_type = 'B'.

ls_header-file_name = 'FORM'.

ls_header-file_extension = 'PDF'.

ls_header-language = 'EN'.

lv_wi_id = ls_wi_id.

call function 'SAP_WAPI_ATTACHMENT_ADD'

exporting

workitem_id = lv_wi_id

att_header = ls_header

  • ATT_TXT =

att_bin = w_bin_file

DOCUMENT_OWNER = SY-UNAME

LANGUAGE = SY-LANGU

DO_COMMIT = 'X'

importing

  • RETURN_CODE =

att_id = ls_att_id.

swc_set_element container 'ZATT_ID' ls_att_id.

swc_set_element container 'ZSOFM' ls_att_id-doc_id.

ZATT_ID is the exporting paramter with type SWR_ATT_ID.

ZSOFM is the exporting parameter of object type SOFM.

Thanks and Regards,

Srini...