cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
Read only

Dynamic parallel processing steps

Former Member
0 Likes
2,014


Dear Consultants,

I am creating a custom workflow , where i am sending work item to all first level  approvers at the same time and taking approval of all approvers.

This has been achieved by parallel block profetch. However i am stuck with some scenario -

1. I want to send outlook mail to requestor's outlook ID

2. an outlook mail to all approvers ( With table in item text ,where detail and approver list should appear)

3. an most importantly i want if one of the  approver rejects the work item , that work item should go to requestor for edit and resend the item only to the approver who has reected that item, but all the work work item should not go to the all approvers who have already approved the task?

Anyone has any idea?

Thanks

View Entire Topic
Former Member
0 Likes

Hello

hey i am stuck with this ? Also i have one question how to send request agin to requester ?

Do you have any document ,ehich can help me out?

In the same rejection branch, save the rejection agent (_ACTUAL_AGENT from the task to the workflow in a new variable)., say in LV_REJ_AGENT of type SWHACTOR. Pass it back from the block to the workflow

After the block , send a revision item to the workflow initiator if LV_REJECTED = 'X', clear the rejection flag, after that activity of WF Initiator, loop back to top of block, replace the agent table with the LV_REJ_AGENT saved in the rejection branch.

I have created a task to read values but where i hae to creae  container?

DATA: ztask_wi_id type SWWWIHEAD-WI_ID,

      it_container type table of swr_wihdr,

      wa_container type swr_wihdr,

      lv_rej_agent type SWHACTOR.





swc_get_element container 'ztask_wi_id' ztask_wi_id.





CALL FUNCTION 'SAP_WAPI_READ_CONTAINER'



EXPORTING



workitem_id = ztask_wi_id



language = sy-langu



TABLES



simple_container = it_container



* MESSAGE_LINES =



* MESSAGE_STRUCT =



* SUBCONTAINER_BOR_OBJECTS =



* SUBCONTAINER_ALL_OBJECTS =



.

IF sy-subrc = 0.

READ TABLE it_container INTO wa_container WITH KEY WI_AAGENT = '_WI_ACTUAL_AGENT'.

ENDIF.

swc_set_element container '_WI_ACTUAL_AGENT' lv_rej_agent.





*MOVE wa_container-value TO reqndetails-employeeid.

I042439
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Sudhanshu

Why did we create a method to manipulate the container?

We need to use a loop step.

the workflow logic should look like this:

1) Start -> Get agents

2) Start loop -> end condition can be LV_APPROVED = 'X'

3) Start Block (with local container data as necessary) - end condition correctly setup - pass back necessary variables back to workflow in binding to read later on

4) End block

5) IF LV_REJECTED = 'X', send workitem to _WF_INITIATOR (available in the workflow container) - After WI completion, loop back to send the WI to the Agnets (you can overwrite the agents table with Actual Agent

6)  IF LV_REJECTED <> 'X' - set LV_APPROVED = 'X' so that the loop ends

Regards,

Modak


Former Member
0 Likes

This Workflow is working fine in approved case , but for reject i think i am missing something , can you please check the workflow diagram , if this logic is correct i will re do the whole part again

I042439
Product and Topic Expert
Product and Topic Expert
0 Likes

can you expand the full log in the first screen shot - navigate to the actual item in error and show the step history. Also give a screen shot of the Binding between the block and WF.

Please make sure that your screen shots have the outcome labels.

Regards,

Modak


Former Member
0 Likes

Hello Modak,

I have created this one. Issue was with binding of blocks.

Thanks

Sudhanshu