on 09-22-2010 12:48 PM
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...
Hi,
I also see in SWI2_DIAG the following error messages.
Work item 000001042120: Object DECISION method PROCESS cannot be executed
Method container for work item cannot be created
Method container for work item cannot be created
Unable to instantiate object '_ATTACH_OBJECTS'
Error handling for work item 000001042120
Thanks and Regards,
Srini...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivas,
Please check the below things.
1. Is the workflow was working fine before the attachment added?
2. If so, then check the Return value of FM, 'SAP_WAPI_ATTACHMENT_ADD'.
3. If it is fine, then in workflow log check whether the workflow container '_ATTACH_OBJECTS' populated corrcetly?
4. Also check the Binding in the Particular Approver Task - ATTACHOBJECTS Binding.
Thanks,
Viji.
Hi Rick,
When I click on the attachment I am getting the error "This file does not have a program associated with it for performing the action.Create an association in the Set associations control panel." But when I check the SAPWORKDIR I could see the attachment saved here if I click on the file and choose a program example pdf. I could see the attachment as desired.
What could be possible reasons for the following errors.
1) Why the attached file is showing an error,when tried to open from a workitem?? While the same file when opened from SAPWORKDIR is showing as desired after selecting a program from the list.
2) Why the workitem is going to the error status 'Not executable'. When a document is attached??
Thanks and Regars,
Srini..
When you display the file, does it have the ".pdf" extension?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.