Skip to Content
-1

fetch agents in user decision step Approve/Reject options and trigger sequentially to approvers

May 09 at 05:17 AM

28

avatar image

Hello,

I triggered workflow when status of claim notification (tcode iqs1 ) is in ‘IN PROCESS’.

I nedd workflow item with user decision button Approve/Reject and link to tcode iqs1. So that users can see claim notification and Approve/Reject with comments.

Workflow need to triggered sequentially to multiple approvers.

I have created user decision step with approve/reject. How to fetch agents in user decision step and trigger workflow sequentially to approvers. Kindly help.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Laszlo Haladin
May 09 at 06:10 AM
0

Hello,

you will find detailed information in the following SAPHELP pages:

User Decisions

Unit 9: Adding a User Decision

Best Regards
Laszlo

Share
10 |10000 characters needed characters left characters exceeded
reshma raman May 10 at 08:18 AM
0

Hello,

I created workflow template 99900010 with triggering event ZTRIGGER_WF.

Workflow tempalte is triggering when status is in 'IN PROCESS' in tcode iqs1.

Workflow task 99900016 is not getting executed.

BEGIN_METHOD EDITASYNCHRONOUS CHANGING CONTAINER.
SET PARAMETER ID 'IQM' FIELD OBJECT-KEY-NUMBER.
CALL TRANSACTION 'CLM2' AND SKIP FIRST SCREEN.
END_METHOD.


task.png (34.9 kB)
Share
10 |10000 characters needed characters left characters exceeded
Himanshu Gupta
May 10 at 04:20 AM
0

Hi Reshma,

How you are determining the Agents ?

if you are using rules , then create an activity to get all the agents and store in internal table and then pass that table in the Expression as agents.

you can also use the loop if you have multiple sequential users to approve it. if any user reject , exit from loop and terminate the workflow.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hello,

I am able to trigger workflow when the status of claim notification is 'IN PROCESS' in tcode iqs1. I wanted to fetch the details of claim notification number when the status is 'IN PROCESS' on clicking save and fetch agents.

Loop the agents in user decision step sequentailly with Approve/reject options.

Once the approver1 approves workitem needs tobe triggered to next approver.

Kindly help me on this.

---------------------------------------------------------------------------------

I created Task with method FETCH_AGENT in business object ZBUS7050

In method FETCH_AGENT im using:

1. CALL TRANSACTION CLM3

2. Fetch container element

3.fetch agents in internal table gt_tab.

4. Set value in workflow container

swc_set_element ac_container
'gt_tab' gt_tab.

-------------------------------------------------------------------------

Im using below code in method FETCH_AGENTS

SET PARAMETER ID 'IQM' FIELD object-key-number.
CALL TRANSACTION 'CLM3' AND SKIP FIRST SCREEN.

INCLUDE <cntain>.

DATA: l_qmnum LIKE viqmel-qmnum,
l_claim TYPE swc_object,
userlist TYPE TABLE OF WFSYST-AGENT.

DATA: l_parnr LIKE ihpa-parnr,
l_nrart LIKE tpar-nrart,
h_qmnum LIKE viqmel-qmnum.
DATA: wa_tq80 LIKE tq80.
DATA: wa_qmel LIKE qmel.
DATA: wa_ihpa LIKE ihpa,
t_ihpa TYPE TABLE OF ihpa,
GT_TAB TYPE TABLE OF SWHACTOR.
data: lv_counter TYPE numc2.


REFRESH actor_tab.


swc_get_element ac_container
'Claim' l_claim.
* read Objectkey
swc_get_object_key l_claim l_qmnum.


SELECT SINGLE * FROM qmel INTO wa_qmel
WHERE qmnum = l_qmnum.

IF sy-subrc NE 0.


MESSAGE e468(im) WITH l_qmnum RAISING nobody_found.
ENDIF.

SELECT SINGLE * FROM tq80 INTO wa_tq80
WHERE qmart = wa_qmel-qmart.
IF sy-subrc NE 0.
ENDIF.

SELECT * FROM ihpa INTO TABLE t_ihpa
WHERE objnr = wa_qmel-objnr.
" AND PARVW = wa_TQ80-PARVW_VERA.

IF sy-subrc NE 0.
*
SELECT * FROM ihpa INTO TABLE t_ihpa
WHERE objnr = wa_qmel-objnr.
" AND PARVW = wa_TQ80-PARVW_INT.

ENDIF.
LOOP AT t_ihpa INTO wa_ihpa.
CALL FUNCTION 'PM_PARTNER_LENGTH'
EXPORTING
parnr_imp = wa_ihpa-parnr
parvw = wa_ihpa-parvw
IMPORTING
parnr_exp = l_parnr
nrart_exp = l_nrart
EXCEPTIONS
parvw_and_nrart_inital = 01
invalid_parvw = 02.

IF sy-subrc NE 0.
RAISE nobody_found.
ENDIF.

CLEAR actor_tab.

CASE l_nrart.
WHEN 'PE'.
actor_tab-otype = 'P'.
actor_tab-objid = l_parnr.
APPEND actor_tab.
WHEN 'O'.
actor_tab-otype = 'O'.
actor_tab-objid = l_parnr.
APPEND actor_tab.
WHEN 'S'.
actor_tab-otype = 'S'.
actor_tab-objid = l_parnr.
APPEND actor_tab.
WHEN 'US'.
actor_tab-otype = 'US'.
actor_tab-objid = l_parnr.
APPEND actor_tab.
WHEN OTHERS.
REFRESH actor_tab.
CLEAR actor_tab.
ENDCASE.
ENDLOOP.

swc_get_element ac_container
'lv_counter' lv_counter .

DESCRIBE TABLE actor_tab lines lv_counter.
swc_set_element ac_container
'lv_counter' lv_counter .

GT_TAB[] = actor_tab[].
swc_set_element ac_container
'gt_tab' gt_tab.

0