cancel
Showing results for 
Search instead for 
Did you mean: 

Reading commnent from Workflow response.

avishek_gorai2
Participant
0 Kudos

Hi,

While working with Duet enterprise workflow, I noticed that the comment being returned from SharePoint that the actor of the task enters in being returned as an attachment in the task container. What are the ways to read this comment?

One way I found and was very cumbersome was to first read the document name from the task context and then somehow pass this to a FM (may be SO_DOCUMENT_READ_API1) to read the contents. Then again I found the contents were in HTML and have to do a parsing to read the comments.

Is there any other way out, possibly using Inbound handler or something else?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Avishek,

You can programmatically read the comments string via a custom inboundhandler:

FUNCTION Z_Process_Comments_ib .

*"----------------------------------------------------------------------*"*"Local Interface:

*"  IMPORTING

*"     VALUE(IV_WORKITEM_ID) TYPE  SWN_APPKEY

*"     VALUE(IV_DECISION_KEY) TYPE  SWR_DECIKEY OPTIONAL

*"     VALUE(IV_USER_ID) TYPE  SYUNAME OPTIONAL

*"     VALUE(IV_OPERATION_ID) TYPE  S_OSP_DT_WI_OPERATION_ID OPTIONAL

*"     VALUE(IV_WORKITEM_STATUS) TYPE  SWW_WISTAT OPTIONAL

*"     VALUE(IV_WRT_CONT_FLAG) TYPE  S_OSP_DT_FLAG DEFAULT 'X'

*"     VALUE(IV_LANGUAGE) TYPE  SPRAS OPTIONAL

*"     VALUE(IT_WF_CONTAINER_TAB) TYPE  SOSP_TT_WF_CONTAINER OPTIONAL

*"     VALUE(IT_APPL_CONTAINER_TAB) TYPE  SOSP_TT_APPL_CONTAINER

*"         OPTIONAL

*"  EXPORTING

*"     VALUE(EV_ERROR_FLAG) TYPE  S_OSP_DT_FLAG

*"     VALUE(ET_RETURN) TYPE  BAPIRETTAB

*"----------------------------------------------------------------------

IT_WF_CONTAINER_TAB contains the 'WorkflowApproverNotes', in container-element ACTION_COMMENTS; as type CHAR(255)

Best regards, William.

avishek_gorai2
Participant
0 Kudos

Thanks William,

This is just what I was looking for. Will try to use this.

Avishek.

avishek_gorai2
Participant
0 Kudos

Works fine, William.

Steps used-> Copied standard inbound handler; used code suggested with modifications for our requirement; made entries in SIMGH (workflow pattern customization) for including custom handler.

Thanks for the help.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Yes, you're correct. The approver's comment entered from SharePoint using Duet Enterprise is stored in the task container _Attach_Objects. This is the standard behaviour of the SAP Business Workflow, and the same way as if the approver's comment was entererd from the Unniversal Work List in the SAP Enterprise Portal.

To view the comment, you can go to the SAP Business Workplace and there is a hyperlink after you select the work item under the section Objects and Attachments.

Cheers,

Anh-Tuan