Hi David,<div><br></div><div>Create an activity in the REJECT path and put in the below code. Using this, once user clicks on REJECT button, a popup will appear where in user will enter the rejection reason. If he/she does not do that, then a new pop up regarding confirmation will appear and this will continue until and unless user does not enter the rejection reason in the window. This will save you using any loop or soemthing in the workflow.</div>
<div><br></div><div><p class="MsoNormal"><span style="font-size:10.0pt;line-height:115%;font-family:&quot;Courier New&quot;;color:blue;background:white">FUNCTION </span><span style="font-size:10.0pt;line-height:115%;font-family:&quot;Courier New&quot;">zhrfm_get_rejection_reason<span style="color:purple;background:white">.</span><br>

<i><span style="color:gray;background:white">*&quot;----------------------------------------------------------------------</span></i><br>
<i><span style="color:gray;background:white">*&quot;*&quot;Local Interface:</span></i><br>
<i><span style="color:gray;background:white">*&quot;  EXPORTING</span></i><br>
<i><span style="color:gray;background:white">*&quot;     REFERENCE(EX_TEXT) TYPE  CATSXT_LONGTEXT_ITAB</span></i><br>
<i><span style="color:gray;background:white">*&quot;----------------------------------------------------------------------</span></i><br>
<i><span style="color:gray;background:white">* get  the reason for rejection from approver in a
pop up window</span></i><br>
  <span style="color:blue;background:white">DATA</span><span style="color:purple;background:white">: </span>lv_answer<span style="color:purple;background:white">(</span><span style="color:#3399ff;background:white">1</span><span style="color:purple;background:white">).</span><br>

  <span style="color:blue;background:white">CALL FUNCTION </span><span style="color:#4da619;background:white">&#39;CATSXT_SIMPLE_TEXT_EDITOR&#39;</span><br>
    <span style="color:blue;background:white">EXPORTING</span><br>
      im_title        <span style="color:purple;background:white">= </span><span style="color:#4da619;background:white">&#39;Reason for Rejection&#39;</span><span style="color:purple;background:white">(</span><span style="color:#3399ff;background:white">008</span><span style="color:purple;background:white">)</span><br>

      im_start_column <span style="color:purple;background:white">= </span><span style="color:#3399ff;background:white">20</span><br>
      im_start_row    <span style="color:purple;background:white">=
</span><span style="color:#3399ff;background:white">20</span><br>
    <span style="color:blue;background:white">CHANGING</span><br>
      ch_text         <span style="color:purple;background:white">= </span>ex_text<span style="color:purple;background:white">.</span><br>
<br>
  <span style="color:blue;background:white">IF NOT </span>ex_text <span style="color:blue;background:white">IS
INITIAL</span><span style="color:purple;background:white">.</span><br>
  <span style="color:blue;background:white">ELSE</span><span style="color:purple;background:white">.</span><br>
    <span style="color:blue;background:white">DO</span><span style="color:purple;background:white">.</span><br>
      <span style="color:blue;background:white">CLEAR </span>lv_answer<span style="color:purple;background:white">.</span><br>
      <span style="color:blue;background:white">CALL FUNCTION </span><span style="color:#4da619;background:white">&#39;POPUP_CONTINUE_YES_NO&#39;</span><br>
        <span style="color:blue;background:white">EXPORTING</span><br>
          defaultoption <span style="color:purple;background:white">= </span><span style="color:#4da619;background:white">&#39;Y&#39;</span><br>
          textline1     <span style="color:purple;background:white">=
</span><span style="color:#4da619;background:white">&#39;Its Mandatory to fill
Rejection reason&#39;</span><br>
          textline2     <span style="color:purple;background:white">=
</span><span style="color:#4da619;background:white">&#39;Please continue to call
editor again&#39;</span><br>
          titel         <span style="color:purple;background:white">= </span><span style="color:#4da619;background:white">&#39;Information&#39;</span><br>
          start_column  <span style="color:purple;background:white">=
</span><span style="color:#3399ff;background:white">25</span><br>
          start_row     <span style="color:purple;background:white">=
</span><span style="color:#3399ff;background:white">6</span><br>
        <span style="color:blue;background:white">IMPORTING</span><br>
          answer        <span style="color:purple;background:white">= </span>lv_answer<span style="color:purple;background:white">.</span><br>
<br>
      <span style="color:blue;background:white">IF </span>lv_answer <span style="color:purple;background:white">= </span><span style="color:#4da619;background:white">&#39;J&#39;</span><span style="color:purple;background:white">.</span><br>

        <span style="color:blue;background:white">CALL FUNCTION </span><span style="color:#4da619;background:white">&#39;CATSXT_SIMPLE_TEXT_EDITOR&#39;</span><br>
          <span style="color:blue;background:white">EXPORTING</span><br>
            im_title        <span style="color:purple;background:white">= </span><span style="color:#4da619;background:white">&#39;Reason for
Rejection&#39;</span><span style="color:purple;background:white">(</span><span style="color:#3399ff;background:white">008</span><span style="color:purple;background:white">)</span><br>
            im_start_column <span style="color:purple;background:white">= </span><span style="color:#3399ff;background:white">20</span><br>
            im_start_row    <span style="color:purple;background:white">=
</span><span style="color:#3399ff;background:white">20</span><br>
          <span style="color:blue;background:white">CHANGING</span><br>
            ch_text         <span style="color:purple;background:white">= </span>ex_text<span style="color:purple;background:white">.</span><br>
        <span style="color:blue;background:white">IF NOT </span>ex_text <span style="color:blue;background:white">IS INITIAL</span><span style="color:purple;background:white">.</span><br>
          <span style="color:blue;background:white">EXIT</span><span style="color:purple;background:white">.</span><br>
        <span style="color:blue;background:white">ENDIF</span><span style="color:purple;background:white">.</span><br>
      <span style="color:blue;background:white">ENDIF</span><span style="color:purple;background:white">.</span><br>
    <span style="color:blue;background:white">ENDDO</span><span style="color:purple;background:white">.</span><br>
  <span style="color:blue;background:white">ENDIF</span><span style="color:purple;background:white">.</span><br>
<br>
<span style="color:blue;background:white">ENDFUNCTION</span><span style="color:purple;background:white">.</span></span></p></div><div><br></div><div><font color="#4da619" face="Courier New"><span style="line-height:14px">Regards,</span></font></div>
<div><font color="#4da619" face="Courier New"><span style="line-height:14px">Richa Gupta</span></font></div><div><font color="#4da619" face="Courier New"><span style="line-height:14px">Email : <a href="mailto:richa.cse7@gmail.com">richa.cse7@gmail.com</a><br>
</span></font><br><div class="gmail_quote">On Mon, Feb 25, 2013 at 5:07 PM, David G Cooper <span dir="ltr">&lt;<a href="mailto:davidgcooper06@gmail.com" target="_blank">davidgcooper06@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
HI fellow experts,<br>
<br>
I have a requirement for a custom developed application that requires<br>
workflow approval.<br>
<br>
This is a complete customer application from top to bottom.<br>
<br>
The standard user decision option in our current version does not support a<br>
mandatory reason for rejection that can be enforced.<br>
<br>
As a result the custom application has an approval sub screen with two<br>
buttons.  This is delivered to the user via a BOR object method/Task using<br>
Set parameter ID and a &quot;Call Transaction&quot;.  The idea being that once the<br>
decision is made the result can be returned to the work item.<br>
<br>
The Task is contained within an Until Loop to make sure a decision is made,<br>
before the work flow continues.  I now need to return the result of the user<br>
decision from the custom application back to the work item.<br>
<br>
What have I tried,<br>
1) Raise Event and leave program where the task has terminating events.<br>
    When pressing BACK/EXIT/CANCEL buttons the user experiences a continual<br>
loop back to the approval screen.<br>
    The current work item completes, but as a decision has not been made, a<br>
new instance of the work item is created and immediately redisplayed to the<br>
user without going through the SAP Inbox again.  Result no way to exist<br>
without choosing a decision.<br>
   If one of the decision buttons is pressed an event is raised and the<br>
program completes.  However this results in the work item completing, but<br>
not returning the correct event, so loops back and presents the transaction<br>
again without going through the SAP Inbox.<br>
<br>
2) Next tried Function SAP_WAPI_WORKITEM_COMPLETE.  Work Item is locked and<br>
function returns an ENQUEUE Error.  Even though the work item is locked by<br>
the same user, as the one executing the function.   (Possible SAP Error).<br>
<br>
Suggestions most welcome.<br>
<br>
_______________________________________________<br>
SAP-WUG mailing list<br>
<a href="mailto:SAP-WUG@mit.edu">SAP-WUG@mit.edu</a><br>
<a href="http://mailman.mit.edu/mailman/listinfo/sap-wug" target="_blank">http://mailman.mit.edu/mailman/listinfo/sap-wug</a><br>
</blockquote></div><br></div>