Post

SAP Workflow: Get Decision Note (Approver Comments) from a Work Item

Learn how to retrieve approver decision notes from SAP workflow work items using I_WorkflowTaskResultComment (cloud) or CL_WAPI_DECISION_COMMENT_QUERY.

SAP Workflow: Get Decision Note (Approver Comments) from a Work Item

Need to retrieve the comments an approver entered when approving or rejecting a workflow task? Two options depending on your system version.

Read Approver Comment from Fiori Inbox

1
2
3
4
5
6
7
8
SELECT FROM i_workflowtaskresultcomment
  FIELDS work_item_id,
         result_text,
         comment_text,
         created_by,
         created_at
  WHERE work_item_id = @lv_work_item_id
  INTO TABLE @DATA(lt_comments).

I_WorkflowTaskResultComment is a released CDS view available in BTP ABAP Environment and S/4HANA Public Cloud.

Option 2: Class (On-Premise)

1
2
3
4
5
6
7
8
9
10
DATA(lo_query) = NEW cl_wapi_decision_comment_query( ).
lo_query->set_workitem_id( lv_work_item_id ).

DATA(lt_comments) = lo_query->execute( ).

LOOP AT lt_comments INTO DATA(ls_comment).
  WRITE: / ls_comment-comment_text,
           ls_comment-decision_key,
           ls_comment-created_by.
ENDLOOP.

Retrieve Old / Completed Work Item Notes

If the comments aren’t showing for completed/old work items, run this report once to backfill:

1
Transaction SE38 → Program: RSWW_SET_WORKITEM_COMMENTS → Execute

This populates the comment store for historical work items.

Practical Use Cases

ScenarioUse
Show approver reason in Fiori Object PageRead via CDS, display in annotation
Audit trail reportLoop through I_WorkflowTaskResultComment
Rejection email with reasonRead comment → add to email body
MDG review commentsAvailable via same CDS/class
This post is licensed under CC BY 4.0 by the author.