Skip to Content
0
Former Member
Nov 03, 2012 at 05:36 AM

SAP_WAPI_DECISION_COMPLETE does not work in a class method

1401 Views

Hi ,

I have to execute a decision step of a work item through code . For which i found the FM SAP_WAPI_DECISION_COMPLETE . This works fine when executed through SE37 and when i executed it in a report . It not only completed the work item but also changed the status of my document .

DATA : bbpex_follow_act_reject TYPE zfollowing_action VALUE 'REJECT',

bbpex_follow_act_approve TYPE zfollowing_action VALUE 'APPROVE'.

DATA : lv_decision_key TYPE swr_decikey,

return_code LIKE sy-subrc,

new_status TYPE sww_wistat.

IF Lv_decision EQ bbpex_follow_act_approve.

lv_decision_key = '0001'.

ELSE.

lv_decision_key = '0002'.

ENDIF.

CALL FUNCTION 'SAP_WAPI_DECISION_COMPLETE'

EXPORTING

workitem_id = iv_wiid

language = sy-langu

user = sy-uname

decision_key = lv_decision_key

do_commit = 'X' " Checkbox Field

IMPORTING

return_code = return_code

new_status = new_status.

However when i executed it through a method of my class . It only completed the workitem and did not change the status of the document ?

Could you please through some light on this issue . Or is there an alternative to execute a workitem ?

I checked the log i get an error like the attachment .

Thanks and Regards ,

Sheldon Rodrigues .

Attachments

error.PNG (14.1 kB)