cancel
Showing results for 
Search instead for 
Did you mean: 

UWL Mass Approval XML changes or Custom App

Former Member
0 Kudos

Dear Gurus,

Please help us in understanding the solution to mass approval issue. Shall we go for XML changes or go for a new custom development in wda/wdj

I have tried modifying XML method for leave approval but the issue is :

1. Tasks drop off from manager UWL with success message but the workflow goes to cancelled step and does not update the status of the employee request from sent to approved. can this be handled by workflow guys.

2. On doing XML changes in both views(normal and subview for mass approval), I lost hyperlinks on my workitems , so I could not launch any application even in the main view where approver shall approve items one by one.

I need help to understand if the above 2 issues can be addressed.

Further we have more than 10-12 types of approvals in our UWL down the line. So is it a good idea to configure XMl or just go and create 1 Master custom applicaiton to address all approvals and give mass approval facility in that alone.

Kindly help

Regards,

Ankur

Accepted Solutions (1)

Accepted Solutions (1)

piyush_kumar6
Active Contributor
0 Kudos

Hi Ankur,

I would love to say that go for the XML changes , i am saying this because i have worked alot on both ways.

XML configuration you can do very easily but if you are going for wda/wdj its bit complex specially in WD java.

And your both the issues can be handled from XML only.

As you mentioned that you are using Leave work flow .. right ??? and its not updating the work flow..??

i need to ask you that you have used FunctionModuleActionHandler or UserDecisionHandler for action

handler. As Leave task is of type BOR Class not the Decision type task if you are using standard task.

For you Hyper Link issue (on Subject )


In ItemTypes
<Attribute name="subject" type="link" displayName="Subject" />

In view
<DisplayAttribute name="subject" type="link" width=""
sortable="yes" format="default" actionRef="viewDetail" referenceBundle="subject"
hAlign="LEFT" vAlign="BASELINE" maxTextWidth="0" headerVisible="yes"/>

Regards,

Piyush

Former Member
0 Kudos

Dear Piyush,

honored by your reply. I had been using your threads to gain more understanding... Here is my code...

Items drop of managers UWL but status in employee leave overview stays as sent.

could you help me to know if I missed something and if I would require some workflow change by workflow consultant

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE UWLConfiguration PUBLIC '-//SAP//UWL1.0//EN' 'uwl_configuration.dtd'

>

<UWLConfiguration version="1.0">

<ItemTypes>

<ItemType name="uwl.task.approval.webflow.TS12300097.SAP_ECC" connector="WebFlowConnector"

defaultView="uwl.webflow.SAP_ECC_view" defaultAction="ViewDetail" executionMode="default">

<ItemTypeCriteria systemId="SAP_ECC" externalType="TS12300097" connector="WebFlowConnector"/>

<Actions>

<Action name="accept" userDecision="yes" handler="UpdatingContainerHandler" referenceBundle="com.sap.pct.erp.mss.leaverequest.approve">

<Properties>

<Property name="_WI_OBJECT_ID.STATUS" value="APPROVED"/>

<Property name="_WI_RESULT" value="A"/>

<Property name="_RESULT" value="A"/>

</Properties>

</Action>

<Action name="reject" userDecision="yes" handler="UpdatingContainerHandler" referenceBundle="com.sap.pct.erp.mss.leaverequest.reject">

<Properties>

<Property name="_WI_OBJECT_ID.STATUS" value="REJECTED"/>

<Property name="_WI_RESULT" value="R"/>

<Property name="_RESULT" value="R"/>

</Properties>

</Action>

</Actions>

</ItemType>

</ItemTypes>

<Views>

<View name="uwl.webflow.SAP_ECC_view" selectionMode="SINGLESELECT" width="98%"

supportedItemTypes="" columnOrder="subject, isEscalated, creatorId, createdDate,

priority, attachmentCount, dueDate, status, accept, reject" sortby="priority:desc,

dueDate:asc, createdDate:desc" tableDesign="STANDARD" visibleRowCount="17"

headerVisible="no" queryRange="undefined" tableNavigationFooterVisible="yes"

tableNavigationType="CUSTOMNAV" actionRef="" refresh="300" dueDateSevere="86400000"

dueDateWarning="259200000" emphasizedItems="new" displayOnlyDefinedAttributes="yes"

dynamicCreationAllowed="yes" actionPosition="top" referenceBundle="tasks">

<Descriptions default="Custom Mass Approval View">

<ShortDescriptions>

<Description Language="en" Description="Custom Mass Approval View"/>

</ShortDescriptions>

</Descriptions>

<DisplayAttributes>

<DisplayAttribute name="reject" type="radiobutton" width="" sortable="no" format="default" actionRef="reject" referenceBundle="reject" hAlign="CENTER" vAlign="TOP" maxTextWidth="0" headerVisible="yes">

<Descriptions default="">

<ShortDescriptions>

<Description Language="en" Description="Reject"/>

</ShortDescriptions>

</Descriptions>

</DisplayAttribute>

<DisplayAttribute name="accept" type="radiobutton" width="" sortable="no" format="default" actionRef="accept" referenceBundle="approve" hAlign="CENTER" vAlign="TOP" maxTextWidth="0" headerVisible="yes">

<Descriptions default="">

<ShortDescriptions>

<Description Language="en" Description="Accept"/>

</ShortDescriptions>

</Descriptions>

</DisplayAttribute>

</DisplayAttributes>

<Actions>

<Action reference="submitUserDecisions"/>

<Action reference="Refresh"/>

<Action reference="defaultGlobalWizard"/>

<Action reference="addToNavigation"/>

<Action reference="removeFromNavigation"/>

</Actions>

</View>

</Views>

</UWLConfiguration>

piyush_kumar6
Active Contributor
0 Kudos

Hi Ankur,

Your xml config is not correct so its not approving the task in backend.

As you have written

<Action name="accept" userDecision="yes" handler="UpdatingContainerHandler" 
referenceBundle="com.sap.pct.erp.mss.leaverequest.approve">
<Properties>
<Property name="_WI_OBJECT_ID.STATUS" value="APPROVED"/>
<Property name="_WI_RESULT" value="A"/>
<Property name="_RESULT" value="A"/></Properties>

Incorrect Code in your XML

1. The value="APPROVED" will not work , we need to use either 1 or 2.

2. handler="UpdatingContainerHandler" will not work.

First let me know what is the type of your WorkFlow .. ??? Its a DecisionType task or BOR object ????

If its DecisionType task then use below code:

<Action name="Approved" userDecision="yes" handler="UserDecisionHandler">
		    <Properties>
			<Property name="decisionKey" value="1"/>
		    </Properties>
		    <Descriptions default="Approve"/>
		</Action>

<Action name="Rejected" userDecision="yes" handler="UserDecisionHandler">
      <Properties>				
	    <Property name="decisionKey" value="2"/>
     </Properties>
<Descriptions default="Reject"/>
</Action>

If its BOR Object then you need to call one FM to approve/reject the tasks

Use below format to call the FM

 <Action name="Approve" groupAction="yes" handler="FunctionModuleActionHandler">
     <Properties>
     <Property name="FunctionModule" value="ZHRTM_LEAVE_APPR"/>
     <Property name="IM_REQUEST_ID" value="${item.RequestId}"/> 
	 <Property name="IM_COMMAND" value="EXECUTE_APPROVE"/> 
	 <Property name="IM_PERNR" value="${item.pernr}"/> 
	 <Property name="WI_ID" value="${item.wi_id}"/> 
	 <Property name="IM_REMARK_ID" value="${item.AppRemDocId}"/>
     <Property name="UWL_RETURN_CODE" value="RET_CODE"/>
     <Property name="UWL_RETURN_TABLE" value="EX_MESSAGES"/>
	 <Property name="UWL_RETURN_TABLE_PARAMETER" value="MESSAGE"/>
    </Properties>
	 <Descriptions default="Approve"/>
   </Action>

    <Action name="Reject" groupAction="yes" handler="FunctionModuleActionHandler">
     <Properties>
     <Property name="FunctionModule" value="ZHRTM_LEAVE_APPR"/>
     <Property name="IM_REQUEST_ID" value="${item.RequestId}"/> 
	 <Property name="IM_COMMAND" value="EXECUTE_REJECT"/> 
     <Property name="IM_PERNR" value="${item.pernr}"/> 
	 <Property name="WI_ID" value="${item.wi_id}"/> 
	  <Property name="IM_REMARK_ID" value="${item.AppRemDocId}"/>
     <Property name="UWL_RETURN_CODE" value="RET_CODE"/>
     <Property name="UWL_RETURN_TABLE" value="EX_MESSAGES"/>
	 <Property name="UWL_RETURN_TABLE_PARAMETER" value="MESSAGE"/>
     </Properties>
	 <Descriptions default="Reject"/>
   </Action>

If you find any difficulty to understand the code then do let me know.

Regards,

Piyush

Former Member
0 Kudos

Dear Piyush,

thank you for the detailed code but still I have some questions

1. Could you give complete tag of this code to be written in itemtype to get hyperlink on subject...

<B>

<Attribute name="subject" type="link" displayName="Subject" />

</B>

2. How to check if my workflow is of decision type task or BOR Object? I am not sure how to check this out.

I tried with both the codes but got the same error...

Work item 000002882280 is not a user decision

3. At a later stage, we will have 10 diffent type of applications seeking approval from manager, so will this xml change method will be enough to take care of that.... Actually anyways we will have to make custom applications to be called when approver would wish to see details of each request... so why not a common custom applicaiton for all approvals?

4. If we focus right now only on leave, our workflow task is TS12300097 which is standard, After successfully implenting the code suggested by you, will there be any changes needed in the workflow??? Does workflow consultant has to make a custom workflow?

Thanks a ton for your help

Regards,

Ankur

piyush_kumar6
Active Contributor
0 Kudos

Hi Ankur,

Find the details by your Point No

-


1. Could you give complete tag of this code to be written in itemtype to get hyperlink on subject...

<Attribute name="subject" type="link" displayName="Subject" />

<ItemType name="uwl.task.webflow.TS90100003" connector="WebFlowConnector"
 defaultView="Leave_Approval" defaultAction="launchWebDynPro" executionMode="default">

<ItemTypeCriteria externalType="TS90100003" connector="WebFlowConnector"/>

<CustomAttributes>

     <CustomAttributeSource id="WEBFLOW_CONTAINER" objectIdHolder="externalId" 
objectType="WebflowContainer" cacheValidity="final">

     <Attribute name="subject"	 type="link"	    displayName="Subject" /> 
 </CustomAttributeSource>

</CustomAttributes>

*.............. * your Actiona Tag  goes here*  ...............................*

</ItemType>

*In View Tag*

<View name="Leave_Approval" ............................... >

<DisplayAttributes>
<DisplayAttribute name="subject" type ="link"  actionRef="launchWebDynPro" width="" 
sortable="yes" format="medium" hAlign="LEFT">
		<Descriptions default="Subject">
		<ShortDescriptions>
		<Description Language="en" Description="Subject"/>
		</ShortDescriptions>
		</Descriptions>
		</DisplayAttribute>
 </DisplayAttributes>
 </View>

* Replace the TS90100003 with your task ID*
 

2. How to check if my workflow is of decision type task or BOR Object? I am not sure how to check this out.

I tried with both the codes but got the same error...

Work item 000002882280 is not a user decision

In this your workFlow guys will help you as you are using standard view so it will be
 BOR/ABAP Class only not  decision type
As you are getting the Error  *Work item 000002882280 is not a user decision*  
So its not of decision type task
So go for the  second code which i wrote above , 
Ask your ABAPER to write one RFC which will be 
called on action  as i have used name RFC called value="ZHRTM_LEAVE_APPR" in action.

Ask your ABAPER that he need to call Standard FM *'PT_ARQ_REQUEST_EXECUTE* in
 custom RFC to approve the tasks.

3. At a later stage, we will have 10 diffent type of applications seeking approval from manager,

so will this xml change method will be enough to take care of that .... Actually anyways we will

have to make custom applications to be called when approver would wish to see details of each

request... so why not a common custom applicaiton for all approvals?

Doing the required changes in XML you can handle any no of  task types
Through UWL you can get the details of each tasks no need to go 
for custom development.. what
 i think If you have decided the same then you can go .... 
but here i would suggest if you are going 
for Custome development
then go for WD ABAP here its easy to do that  

4. If we focus right now only on leave, our workflow task is TS12300097 which is standard

After successfully implenting the code suggested by you, will there be any changes needed

in the workflow??? Does workflow consultant has to

make a custom workflow?

If you are not going to add any extra columns in UWL then there is no need to 
change anything in workflow 

Regards,

Piyush

Former Member
0 Kudos

Dear Piyush,

Because of your help, I am able to get subject hyperlink and now have 3 columns of radio buttons to select and submit the selection.

the only issue that still pertains is the error on submit:

<B>

Work item 000002882280 is not a user decision

</B>

and the items also don't drop off from the UWL, which is OK as there is no one to handle that in back end.

<I>

The function module as suggested by you is not yet in place. I am not sure if this error is because of the lack of the FM , or if there is something to be done in Workflow. What is ur take?

The type of error that 1 of the Work Item is not decision type looks suspicious.

</I>

If you have access, could you give more info on the syntax of the Fm to be made?

Lastly thank you for your time and effort.

Regards,

Ankur

piyush_kumar6
Active Contributor
0 Kudos

Hi Ankur ,

Go to TC: Se 37 and search FM 'PT_ARQ_REQUEST_EXECUTE . I am 100% sure you will get this FM

its standard FM.

In above code i have just written one name called "ZHRTM_LEAVE_APPR" because you also need to

call FM 'PT_ARQ_REQUEST_EXECUTE from custom FM. because we need to validate the work flow before approval using 'PT_ARQ_REQUEST_PREPARE. Ask your work flow team they will tell you how the approval process

happens.

And there is no need to change the workflow in this process as you asked above.

Regards,

Piyush

Former Member
0 Kudos

Dear Piyush,

Thank you for your detailed reply once again.

I have some doubts from technical team point of view. requesting your help in that ...

1. do we have to write our own logic to update the leave status in infotype or FM will take care of that too.

2. The XML code mentioned by you is clearly sending some parameters to the FM it is calling. I hope these will automatically received by the FM. Do we have to call any other FM's besides the 2 FM's you have specified i.e.

'PT_ARQ_REQUEST_EXECUTE

'PT_ARQ_REQUEST_PREPARE

If Possible could you share the FM code ?

Former Member
0 Kudos

Dear Piyush,

we have been successful in writing our custom FM and we are calling the standard FM's in our abap box. leaves get approved on executing the custom FM from R3. however from portal UWL, still we are getting the same error message. I think our portal is not able to call the ABAP FM.

Error Message:

<b>

Work item 000002882700 is not a user decision

</b>

<br>

Our UWL code now is like:

<i>

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE UWLConfiguration PUBLIC '-//SAP//UWL1.0//EN' 'uwl_configuration.dtd'

>

<UWLConfiguration version="1.0">

<ItemTypes>

<ItemType name="uwl.task.approval.webflow.TS12300097" connector="WebFlowConnector"

defaultView="uwl.webflow.SAP_ECC_view" defaultAction="viewDetail" executionMode="default">

<ItemTypeCriteria systemId="SAP_ECC" externalType="TS12300097" connector="WebFlowConnector"/>

<Actions>

<Action name="Approve" groupAction="yes" handler="FunctionModuleActionHandler">

<Properties>

<Property name="FunctionModule" value="ZHRTM_LEAVE_APPR"/>

<Property name="IM_REQUEST_ID" value="${item.RequestId}"/>

<Property name="IM_COMMAND" value="EXECUTE_APPROVE"/>

<Property name="IM_PERNR" value="${item.pernr}"/>

<Property name="WI_ID" value="${item.wi_id}"/>

<Property name="IM_REMARK_ID" value="${item.AppRemDocId}"/>

<Property name="UWL_RETURN_CODE" value="RET_CODE"/>

<Property name="UWL_RETURN_TABLE" value="EX_MESSAGES"/>

<Property name="UWL_RETURN_TABLE_PARAMETER" value="MESSAGE"/>

</Properties>

<Descriptions default="Approve"/>

</Action>

<Action name="Reject" groupAction="yes" handler="FunctionModuleActionHandler">

<Properties>

<Property name="FunctionModule" value="ZHRTM_LEAVE_APPR"/>

<Property name="IM_REQUEST_ID" value="${item.RequestId}"/>

<Property name="IM_COMMAND" value="EXECUTE_REJECT"/>

<Property name="IM_PERNR" value="${item.pernr}"/>

<Property name="WI_ID" value="${item.wi_id}"/>

<Property name="IM_REMARK_ID" value="${item.AppRemDocId}"/>

<Property name="UWL_RETURN_CODE" value="RET_CODE"/>

<Property name="UWL_RETURN_TABLE" value="EX_MESSAGES"/>

<Property name="UWL_RETURN_TABLE_PARAMETER" value="MESSAGE"/>

</Properties>

<Descriptions default="Reject"/>

</Action>

</Actions>

</ItemType>

</ItemTypes>

<Views>

<View name="uwl.webflow.SAP_ECC_view,w" selectionMode="SINGLESELECT" width="98%"

supportedItemTypes="" columnOrder="subject, isEscalated, creatorId, createdDate,

priority, attachmentCount, dueDate, status, accept, reject" sortby="priority:desc,

dueDate:asc, createdDate:desc" tableDesign="STANDARD" visibleRowCount="17"

headerVisible="no" queryRange="undefined" tableNavigationFooterVisible="yes"

tableNavigationType="CUSTOMNAV" actionRef="" refresh="300" dueDateSevere="86400000"

dueDateWarning="259200000" emphasizedItems="new" displayOnlyDefinedAttributes="yes"

dynamicCreationAllowed="yes" actionPosition="top" referenceBundle="tasks">

<Descriptions default="Custom Mass Approval View">

<ShortDescriptions>

<Description Language="en" Description="Mass Approval View"/>

</ShortDescriptions>

</Descriptions>

<DisplayAttributes>

<DisplayAttribute name="subject" type ="link" actionRef="launchWebDynPro" width=""

sortable="yes" format="medium" hAlign="LEFT">

<Descriptions default="Subject">

<ShortDescriptions>

<Description Language="en" Description="Subject"/>

</ShortDescriptions>

</Descriptions>

</DisplayAttribute>

<DisplayAttribute name="reject" type="radiobutton" width="" sortable="no" format="default" actionRef="reject" referenceBundle="reject" hAlign="CENTER" vAlign="TOP" maxTextWidth="0" headerVisible="yes">

<Descriptions default="">

<ShortDescriptions>

<Description Language="en" Description="Reject"/>

</ShortDescriptions>

</Descriptions>

</DisplayAttribute>

<DisplayAttribute name="accept" type="radiobutton" width="" sortable="no" format="default" actionRef="accept" referenceBundle="approve" hAlign="CENTER" vAlign="TOP" maxTextWidth="0" headerVisible="yes">

<Descriptions default="">

<ShortDescriptions>

<Description Language="en" Description="Accept"/>

</ShortDescriptions>

</Descriptions>

</DisplayAttribute>

</DisplayAttributes>

<Actions>

<Action reference="submitUserDecisions"/>

<Action reference="Refresh"/>

<Action reference="defaultGlobalWizard"/>

<Action reference="addToNavigation"/>

<Action reference="removeFromNavigation"/>

</Actions>

</View>

</Views>

</UWLConfiguration>

</i>

piyush_kumar6
Active Contributor
0 Kudos

Hi Ankur,

In view tag for the radiobutton you have written actionRef="accept" but in item type its caps ,

for reject also its the same case. Please replace the DisplayAttribute as mentioned below

<DisplayAttribute name="accept" type="radiobutton" width="" sortable="no"
 format="default" actionRef="Approve" referenceBundle="approve" hAlign="CENTER"
 vAlign="TOP" headerVisible="yes">
<Descriptions default="">
<ShortDescriptions>
<Description Language="en" Description="Accept"/>
</ShortDescriptions>
</Descriptions>
</DisplayAttribute>

<DisplayAttribute name="reject" type="radiobutton" width="" sortable="no" 
format="default" actionRef="Reject" referenceBundle="reject" hAlign="CENTER"
 vAlign="TOP" headerVisible="yes">
<Descriptions default="">
<ShortDescriptions>
<Description Language="en" Description="Reject"/>
</ShortDescriptions>
</Descriptions>
</DisplayAttribute>

After doing these changes check once again, If it still not working then add below

functions in Actions's for ItemType as well as for view. It will overwrite the default function

</Actions>
<Action name="submitUserDecisions" groupAction="yes"
handler="UIActionHandler" referenceBundle="submit_msg"
returnToDetailViewAllowed="no"
launchInNewWindow="SHOW_HEADERLESS_PORTAL">
<ConfirmDescriptions referenceBundle="submit_prompt"/>
</Action>

</Actions>

And one more thing in view for supportedItemTypes we must write task id

supportedItemTypes="uwl.task.webflow.TS12300097

Now i think every thing is fine. Do the required changes and let me know.

Regards

Piyush

Former Member
0 Kudos

Dear Piyush,

Firstly thanks again for your detailed mail.

I have done the suggested changes but still no success. the same error message comes in red.

So we decided to check if the FM is being called at all. The ABAP consultant wrote some code to save the data passed by XML in a table. that table after submitting user decision is empty.

this makes me think whether the custom FM is called at all or not.

Is there any way we could establish that?

<B><U>

this is our abap code

</B></U>

<font color="#0000FF">

FUNCTION ZHRTM_LEAVE_APPR.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(IM_REQUEST_ID) TYPE TIM_REQ_ID

*" VALUE(IM_WI_ID) TYPE SWW_WIID OPTIONAL

*" VALUE(IM_COMMAND) TYPE PTREQ_COMMAND

*" VALUE(IM_PERNR) TYPE P_PERNR

*" TABLES

*" EX_MESSAGES TYPE PTARQ_UIA_MESSAGES_TAB OPTIONAL

*" EX_COMMANDS TYPE PTARQ_UIA_COMMAND_TAB OPTIONAL

*"----


DATA: LOC_PREP_COMMAND TYPE PTREQ_COMMAND.

PERFORM f_clear_fields.

CASE IM_COMMAND.

WHEN 'EXECUTE_APPROVE'.

LOC_PREP_COMMAND = 'PREPARE_APPROVE'.

WHEN 'EXECUTE_REJECT'.

LOC_PREP_COMMAND = 'PREPARE_REJECT'.

WHEN OTHERS.

ENDCASE.

ZWHRTM_LEAVE-REQID = IM_REQUEST_ID.

ZWHRTM_LEAVE-AENAM = sy-uname.

ZWHRTM_LEAVE-AEDAT = sy-datum.

modify ZWHRTM_LEAVE.

commit work.

CALL FUNCTION 'PT_ARQ_REQUEST_PREPARE'

EXPORTING

IM_REQUEST_ID = IM_REQUEST_ID

IM_WI_ID = IM_WI_ID

IM_COMMAND = LOC_PREP_COMMAND

IM_PERNR = IM_PERNR

IM_MODUS = 'A'

  • IM_DEBUG =

IMPORTING

EX_REQUEST = WF_REQUEST

EX_DATA_READ_ONLY = WF_DATA_READ_ONLY

EX_NOTICE_READ_ONLY = WF_NOTICE_READ_ONLY

EX_CHANGED = WF_CHANGED

EX_HAS_ERRORS = WF_HAS_ERRORS

EX_SHOW_CHANGE = WF_SHOW_CHANGE

TABLES

EX_MESSAGES = GINT_MESSAGES

EX_COMMANDS = GINT_COMMANDS .

CALL FUNCTION 'PT_ARQ_REQUEST_EXECUTE'

EXPORTING

IM_REQUEST_ID = IM_REQUEST_ID

IM_COMMAND = IM_COMMAND

IM_PERNR = IM_PERNR

IM_MODUS = 'A'

  • IM_DEBUG =

IMPORTING

EX_REQUEST = WF_REQUEST

EX_HAS_ERRORS = WF_HAS_ERRORS

EX_SHOW_CHANGE = WF_SHOW_CHANGE

TABLES

EX_MESSAGES = GINT_MESSAGES

EX_COMMANDS = GINT_COMMANDS .

EX_MESSAGES[] = GINT_MESSAGES[].

EX_COMMANDS[] = GINT_COMMANDS[].

ENDFUNCTION.

</font>

piyush_kumar6
Active Contributor
0 Kudos

Hi Ankur,

If you want to check that your FM got called or not then use "External Dibugger" , Put break point in FM

with some user's Id (who is approving the Tasks from UWL ) , Now try to approve from UWL It will

open the debugger .

From your given FM i observed that the task id (TS12300097 your Task ID)

is not mentioned in your FM at all .

Ask your ABAPER to take reference from below FM.

Once you done with the FM, Then before checking the code from UWL

It would be better that you Execute the FM manually and pass the required input

FM Code :

FUNCTION ZHRTM_LEAVE_APPR.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(IM_REQUEST_ID) TYPE  TIM_REQ_ID OPTIONAL
*"     VALUE(IM_COMMAND) TYPE  PTREQ_COMMAND
*"     VALUE(IM_PERNR) TYPE  P_PERNR
*"     VALUE(WI_ID) TYPE  SWW_WIID
*"  EXPORTING
*"     VALUE(RET_CODE) TYPE  SY-SUBRC
*"  TABLES
*"      EX_MESSAGES TYPE  PTARQ_UIA_MESSAGES_TAB
*"----------------------------------------------------------------------
** Mass Approval from UWL ( Approve Reject Check boxes )
data : lt_messages type PTARQ_UIA_MESSAGES_TAB,
       ls_messages type bapiret2,
       lt_commands type PTARQ_UIA_COMMAND_TAB,
       lv_haserror type PTREQ_HAS_ERROR_FLAG,
       lv_request  type PTARQ_UIA_REQUEST,
       lv_command type PTREQ_COMMAND.

data : lt_cont type table of SWR_CONT,
       ls_cont type SWR_CONT.

data : ls_wf_appr type ZTHR_WF_APPVR.
data : lv_wi_id  type SWW_WIID.

** Prepare to Approve Leave Request

lv_command = 'PREPARE_APPROVE'.

CALL FUNCTION 'PT_ARQ_REQUEST_PREPARE'
  EXPORTING
    IM_REQUEST_ID             = im_request_id
    IM_COMMAND                = lv_command
    IM_PERNR                  = im_pernr
    IM_MODUS                  = 'R'
  IMPORTING
    EX_REQUEST                = lv_request
    EX_HAS_ERRORS             = lv_haserror
  TABLES
    EX_MESSAGES               = lt_messages
    EX_COMMANDS               = lt_commands
          .

** Check Leave Approval
clear lv_command.
lv_command = 'CHECK_APPROVE'.
CALL FUNCTION 'PT_ARQ_REQUEST_CHECK'
  EXPORTING
    IM_REQUEST           = lv_request
    IM_COMMAND           = lv_command
    IM_PERNR             = im_pernr
    IM_MODUS             = 'R'
  IMPORTING
    EX_HAS_ERRORS        = lv_haserror
  TABLES
    EX_MESSAGES          = ex_messages " lt_messages
    EX_COMMANDS          = lt_commands
          .

** If no error execute Leave Approval
if lv_haserror is initial.



CALL FUNCTION 'PT_ARQ_REQUEST_EXECUTE'
  EXPORTING
    IM_REQUEST_ID        = im_request_id
    IM_COMMAND           = im_command
    IM_PERNR             = im_pernr
    IM_MODUS             = 'R'
*   IM_DEBUG             =
* IMPORTING
*   EX_REQUEST           =
*   EX_HAS_ERRORS        =
*   EX_SHOW_CHANGE       =
  TABLES
    EX_MESSAGES          = lt_messages
    EX_COMMANDS          = lt_commands
         
else.

** If error exists .. update the workflow container with error messages
 ret_code = sy-subrc.

loop at ex_messages into ls_messages.

ls_cont-element = 'remarks'.
ls_cont-value   = ls_messages-message.
append ls_cont to lt_cont.

endloop.

* Get the workitem id of the current workitem
select single wi_id from SWW_WI2OBJ into lv_wi_id
       where
         top_wi_id = wi_id  and
         wi_rh_task in ('TS90100003' ,'TS90100006' ,'TS90100009' ).

** Update the container
CALL FUNCTION 'SAP_WAPI_WRITE_CONTAINER'
  EXPORTING
    WORKITEM_ID             = lv_wi_id
    LANGUAGE                = SY-LANGU
*   ACTUAL_AGENT            = SY-UNAME
    DO_COMMIT               = 'X'
*   IFS_XML_CONTAINER       =
* IMPORTING
*   RETURN_CODE             =
  TABLES
   SIMPLE_CONTAINER         = lt_cont
*   MESSAGE_LINES           =
*   MESSAGE_STRUCT          =
          .

endif.
ENDFUNCTION.

Regards,

Piyush

Former Member
0 Kudos

Dear Piyush

Thanks again buddy.

Consulted with Workflow experts here and we see you are using some custom tasks and not the standard one as we are.

Please let us know if this is a user decision task or something else. if that is the case, we too will make our own user decision tasks and use the XML code against that task and not against standard 12300097 task.

Could you also let know the reason why you used the custom task in your scenerio.

Thank you

Regards,

Ankur

piyush_kumar6
Active Contributor
0 Kudos

Hi Ankur,

I have worked on both the tasks ie Custom and Standard. Here Only Task type matters not the mode of task.

Suppose you take example of Leave Request Task - Either its custom or standard it will be BOR object not

the decision type task(as i have seen in Till this date ) and when we approve in normal also it will call

PT_ARQ_REQUEST_EXECUTE to process it.

Regards,

Piyush

Former Member
0 Kudos

Dear Piyush,

Even after doing all the things, we are struck at the same error.

I tried debugging again, but it does not happen while using radio buttons and submitting the decisions.

However when I click on accept/reject buttons, that are available individually at the botton of uwl pertaining to each workitem, the debugger works .

this now makes me feel that something is still wrong on my xml code. that is why it is not able to call the FM.

I suspect this statement:

<ItemType name="uwl.task.approval.webflow.TS12300097">

however if i remove the word "approval", the custom view does not contain any workitems.

Can you think of some issue?

Thanks

Ankur

piyush_kumar6
Active Contributor
0 Kudos

Hi Ankur,

It should be something like :

If not decision type:

<ItemType name="uwl.task.webflow.TS????" connector="WebFlowConnector"
defaultView="yr view name" defaultAction="launchWebDynPro" executionMode="default">

If Decision type:

<ItemType name="uwl.task.webflow.decision.TS200????" connector="WebFlowConnector"
 defaultView="yr view name " defaultAction="viewDetail" executionMode="default">

So in your case it should be first one.

Regards,

Piyush

Former Member
0 Kudos

Dear SIr,

Because of your extensive help here and following your blog, We have been fairly successful with our work for UWL Mass Approval.

1. we have been able to launch WDJ application after clicking on subject line.

2. we have got columns of checkboxes.

3. we are able to set debug point in custom FM and abel to debug our program.

4. our Custom program in R3 works fine, approves leave and updates status in infotype.

But we have just 1 issue pending with these 2 lines of code:

<B>

<Property name="IM_PERNR" value="${item.pernr}"/>

<Property name="WI_ID" value="${item.wi_id}"/>

</B>

while debugging in R3, values of pernr and wi_id are passed as zeros not the correct values. because of this FM is not approving the leaves.

Could you please be kind so as to let us know if there is some issue in this? Do we need to write something so that pernr and wi_id are picked from session? else let us know where do we look for more info on 'item'.

Thank you very much

Ankur Agarwal

Former Member
0 Kudos

Dear Sir,

Only because of your extensive help and ingenious troubleshooting, we are finally able to implement this in our system.

Thank you a ton.

Regards

Ankur

piyush_kumar6
Active Contributor
0 Kudos

Hi Ankur,

Its nice to hear that your problem has been resolved.

Regards,

Piyush

Former Member
0 Kudos

Hello Piyush,

I know this question is closed. I am trying to retreive custom attributes from decisson. I am not able to do that.

I am able to retrieve ABAP_BOR object.

These attributes are not directly in container. Those attributes are located in ADHOCOBJECT, _WORKITEMS, _Attachments.

How I am able to retrieve them. Can you point me to scriplets of XML.

I really appreciate your help.

Regards

Mark

piyush_kumar6
Active Contributor
0 Kudos

Hi Mark,

From XML we can read only the attributes which are in root container. Please ask your WorkFlow Team to

add new attributes in root container and map these added attributes with the attributes inside

ADHOCOBJECT, _WORKITEMS, _Attachments.

After mapping you can get the value in XML.

Please let me know if you face any other issue after mapping.

Regards,

Piyush

Former Member
0 Kudos

Hi Gurus,

I wanted to add radio buttons for mass approval/rejection, i have downloaded the xml and made chages and uploaded the file and cleared the cache.I have changed the navigationId from default which is main to my custom file name but still I cant see the radion button. Here is my code:

</View>

<View name="WorkItemsApprovalView" selectionMode="SINGLESELECT" width="98%" supportedItemTypes="uwl.task.approval, uwl.task.coll.approval" columnOrder="subject, creatorId, createdDate, priority, attachmentCount, dueDate, openCol, approveCol, rejectCol" sortby="priority:descend, dueDate:ascend, createdDate:descend" tableDesign="STANDARD" visibleRowCount="10" headerVisible="no" queryRange="undefined" tableNavigationFooterVisible="yes" tableNavigationType="CUSTOMNAV" actionRef="" refresh="0" dueDateSevere="86400000" dueDateWarning="259200000" emphasizedItems="new" displayOnlyDefinedAttributes="yes" dynamicCreationAllowed="yes" actionPosition="top" referenceBundle="task_approvals">

<DisplayAttributes>

<DisplayAttribute name="openCol" type="radiobutton" width="" sortable="no" format="default" referenceBundle="open" hAlign="CENTER" vAlign="BASELINE" maxTextWidth="0" headerVisible="yes"/>

<DisplayAttribute name="rejectCol" type="radiobutton" width="" sortable="no" format="default" actionRef="reject" referenceBundle="reject" hAlign="CENTER" vAlign="BASELINE" maxTextWidth="0" headerVisible="yes"/>

<DisplayAttribute name="approveCol" type="radiobutton" width="" sortable="no" format="default" actionRef="accept" referenceBundle="approve" hAlign="CENTER" vAlign="BASELINE" maxTextWidth="0" headerVisible="yes"/>

</DisplayAttributes>

piyush_kumar6
Active Contributor
0 Kudos

Hi Thandile,

Your XML looks good. Have you uploaded the new XML file with higher priority for your required system alias or not ??

If we do not upload it with higher order than default XML then changes will not reflect in your Sub-view . As default

config file will overwrite the lower config file.

Regards,

Piyush

Former Member
0 Kudos

Hi Piyush,

I have read your solution on Mass Approval XML. I am currently working on a similar enhancement.

I would like to check for your Mass Approval solution, say for multiple leave requests for an employee.

An employee has submited 3 leave requests

1 to delete previously approved leave

1 to change an previously approved leave

1 to add new leave

When these 3 leaves are approved all together thru Mass Approval,  what would be the sequence of processing by SAP at the backend?

Do you know if there is any rule behind governing the sequence of processing.

Thanks

Ivan

vengadesh_r
Explorer
0 Kudos

Hi Ankur,

I also facing this issue.

<B>

<Property name="IM_PERNR" value="${item.pernr}"/>

<Property name="WI_ID" value="${item.wi_id}"/>

</B>

while debugging in R3, values of pernr and wi_id are passed as zeros not the correct values. because of this FM is not approving the leaves.

How did you resolve it ?

Former Member
0 Kudos

Hi,

First of all, let me tell you that changing XML will not be enough. There should be:

a. A Z function module to be written in ABAP box for handling the inputs sent by portal and then to trigger workflow.

b. Adjustments to workflow.

tell me, if you have created the Z function module in abap? if yes, wait while I search my xml code for you.

P.S. I don't know the code written in ABAP or the changes done to workflow. can find out portal side modified xml file.

Ankur

vengadesh_r
Explorer
0 Kudos

Dear Ankur,

  Thanks for your reply. Now this is working fine. I already wrote Z function module in the backend. For the function module i only passed the Workitem ID and IM_COMMAND through XML. I did some coding changes in the FM code mentioned here to fetch the other details.

Former Member
0 Kudos

Hi Piyush,

I have a requirement to complete the leave approval cycle in single click just wanted to know would making changes to the UWL XML help me with the same.  I was able skip the review screen, now I need that my submission takes place on click of approve or reject.  Kindly help

Thank you

Regards,

Jaspreet Kaur

Answers (0)