on ‎2009 Sep 14 11:41 AM
I am following the document which I got in SDN . for making attachments in WF.
I have done the same way as it was given but In tcode SWI1 its showing as Error.
I am triggering the workflow through my report program usinf the FM SWW_WI_START_SIMPLE.
and in my BOR object I defined the method attachment and called the FM SAP_WAPI_ATTACHMENT_ADD
What might be the problem, could any one explain please
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
1.First of all I would suggest to start the workflow with SAP_WAPI_START_WORKFLOW
2. Please check whether the header of the Attahcment is populated correctly or not.
I hope the code snippet might help you to understand
DATA :
lv_header TYPE swr_att_header.
IF lv_xstring IS NOT INITIAL.
lv_header-file_type = 'B'.
lv_header-file_name = 'Attachment'.
lv_header-file_extension = 'DOC'.
lv_header-language = 'EN'.
CALL FUNCTION 'SAP_WAPI_ATTACHMENT_ADD'
EXPORTING
workitem_id = wf_wi_id
att_header = lv_header
att_bin = lv_xstring
IMPORTING
return_code = lv_return
att_id = att_id.
IF lv_return = 0.
lv_objtkey = att_id-doc_id.
lv_objsofm = 'SOFM'.
swc0_create_object bo_sofm lv_objsofm lv_objtkey.
ENDIF. " IF lv_return = 0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
when I am using the FM 'SAP_WAPI_START_WORKFLOW its leading to dump as there is type conflict in the container type
I am using the INCLUDE <cntn01>.
In the Binding also there is a Problem.
the Task is not getting binded with the method automatically.
what might be the problem.
Thanks and regards
CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
EXPORTING
task = 'WS90000092'
LANGUAGE = SY-LANGU
*DO_COMMIT = 'X'
USER = SY-UNAME
start_asynchronous = 'X'
DESIRED_START_DATE =
DESIRED_START_TIME =
DESIRED_START_ZONLO = SY-ZONLO
IFS_XML_CONTAINER =
IMPORTING
RETURN_CODE =
workitem_id = workitem_id
NEW_STATUS =
TABLES
input_container = container
MESSAGE_LINES =
MESSAGE_STRUCT =
agents = it_agents .
COMMIT WORK.
WRITE : workitem_id.
ENDIF.
replace the starting of workflow with the below code
CALL FUNCTION 'EWW_WORKFLOW_START'
EXPORTING
x_task = 'WS90000092'
TABLES
X_CONTAINER = container
EXCEPTIONS
INVALID_TASK = 1
NO_ACTIVE_PLVAR = 2
START_FAILED = 3
GENERAL_ERROR = 4
OTHERS = 5
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
HI
The confiogurations are done. thanks for the support.
in the post you have given a code snippet
IF lv_return = 0.
lv_objtkey = att_id-doc_id.
lv_objsofm = 'SOFM'.
swc0_create_object bo_sofm lv_objsofm lv_objtkey.
ENDIF.
can you help me with the data types of the lv_objkey , lv_objsofm, and what is bo_sofm.
I think I have to use the above code snippet in BOR method.? am I correct.
reagrds
Yes., you need to write code in the BOR method and later you have to export the attachment object back to the task and from task to workflow and you have to make the bindings between workflow and the step which you want to send to the agent.
If you are implementing the logic in the BOR then,
1. Bo_sofm TYPE SWC_OBJECT.
2.lv_objsofm TYPE swotobjid-objtype,
3. lv_objtkey TYPE swotobjid-objkey,
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.