cancel
Showing results for 
Search instead for 
Did you mean: 

The source and target structure have a different number of fields

Former Member
0 Kudos

Hi,

I am new to workflow and I am trying to create an attachment in Workflow (SAP ECC 6.0) and pass it through to a User Decision (User Decision works fine) however the workflow is failing on the attachment step with u2018The source and target structure have a different number of fieldsu2019. The bindings check ok. Please see details below.

I have used document u2018Creating Attachments to Work Items or to User Decisions in Workflowsu2019 by Ramakanth Reddy for guidance. Thanks in advance.

1) Workflow containers (SWDD)

WORKITEMID (import)

ZSWR_ATT_ID (export)

SOFM (export)

2) Task Container (PFTC)

1 Import parameter defined u2013 WORKITEMID (swr_struct-workitemid)

2 Export parameters defined

- SOFM (Ref. obj. type SOFM)

- ZSWR_ATT_ID (swr_att_id-doc_id)

Binding task -> Method

Binding for 1 parameter (import) defined

Task <- Method

Binding for 2 parameters (export) defined

3) Z BOR object created with a Method, Method Parameters and Event (SWO1)

1 import parameter defined

2 export parameters defined

Method calls FM SSF_FUNCTION_MODULE_NAME, CONVERT_OTF, SCMS_XSTRING_TO_BINARY and SAP_WAPI_ATTACHMENT_ADD

Workflow is triggered by FM SAP_WAPI_CREATE_EVENT, Return_code = 0

Event_id = 00000000000000000001

Test results

A) Triggered by ABAP/ FM SAP_WAPI_CREATE_EVENT - SWI2_DIAG results

Work item 14791: object <z bor object name> method <method name> cannot be executed. The source and target structure have a different number of fields (this message is repeated 3 times). Error handling for work item 14791. No errors occurred -> details in long text (message is repeated 3 times).

Message no. WL821, OL383, WL050 in long text

B) Z BOR Test method <execute>

Enter workitem id.

Runtime error - Data objects in Unicode programs cannot be converted. The statement "MOVE src TO dst" requires that the operands "dst" and "src" are convertible. Since this statement is in a Unicode program, the special conversion rules for Unicode programs apply.

In this case, these rules were violated.

Program SAPLSWCD

Include LSWCDF00

Row 475

Module type (FORM)

Module Name MOVE_CONTAINER_TO_VALUE

C) Z BOR Test method <debugging>

Enter workitem id.

SAP_WAPI_ATTACHMENT_ADD, return_code = 0, message_lines = Attachment created

both swc_set_element container work ok

Runtime error occurs after end_method executed. Data objects in Unicode programs cannot be converted.

D) Workflow test

Enter workitem id <execute>

Task started> Workflow log> Status = Error

Workflow errors in Attachment step (however Office document can be viewed in details for step).

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Problem has now been resolved. Problem was related to use of swr_att_id structure and swc_set_element statement in BOR program - problem resolved by only setting w/f container to swr_att_id-doc_id.