Document Park workflow

Nat 4 Govender ngovender4 at toyota.co.za
Fri May 29 04:05:56 EDT 2009


Hi John,

This is how we have done the very similar thing but for a different
business object.

Parameters for the method.



Method Code

begin_method selectapprovalagents changing container.
constants:
      $yes like fist-oper value 'X',
      $no  like fist-oper value '-'.
data:
      o_task type swc_object,
      valid_selection like fist-oper value $no,
      title like rseu1-tit_text,
      task_id like swwwihead-wi_rh_task,
      selectmultiple like syst-input,
      selectedobject like rhobjects-object,
      selectedobjectlist like table of rhobjects-object
                              with header line,
      namelist   like table of rhobj_name       with header line,
      objectlist like table of rhobjects-object with header line,
      profile    like table of ust04-profile    with header line.
swc_get_element container 'SelectMultiple' selectmultiple.
swc_get_element container 'Title'          title.
swc_get_element container 'Task_ID'        task_id.
swc_get_table   container 'Profile'        profile.

while valid_selection eq $no.
  clear namelist.   refresh namelist.
  clear objectlist. refresh objectlist.
  perform fill_namelist_objectlist tables namelist objectlist profile.
  swc_container   new_container.
  swc_set_element new_container 'SelectMultiple' selectmultiple.
  swc_set_table   new_container 'NameList' namelist.
  swc_set_table   new_container 'ObjectList' objectlist.
  swc_create_object o_task 'WF_TASK' task_id.
  swc_call_method   o_task 'Dispatch' new_container.
  if sy-subrc eq 8017.
    exit_cancelled.
  endif.
  if selectmultiple is initial.
    swc_get_element new_container 'SelectedObject' selectedobject.
*      PERFORM authority_check USING selectedobject
*                                    subrc.
    read table objectlist with key selectedobject.
    if sy-subrc ne 0.
*      IF subrc EQ $not_authorised.
      valid_selection = $no.
      message i016(zworkflowmessages).
*        MESSAGE i017(zworkflowmessages).
*      ELSEIF subrc EQ $invalid_agent_type.
*        MESSAGE i018(zworkflowmessages).
    else.
      valid_selection = $yes.
    endif.
  else.
    swc_get_table new_container 'SelectedObjectList'
                                 selectedobjectlist.
    loop at selectedobjectlist.
*        PERFORM authority_check USING selectedobjectlist
*                                      subrc.
      read table objectlist with key selectedobjectlist.
      if sy-subrc ne 0.
*        IF subrc EQ $not_authorised.
        valid_selection = $no.
        message i016(zworkflowmessages).
*          MESSAGE i017(zworkflowmessages).
*        ELSEIF subrc EQ $invalid_agent_type.
*          MESSAGE i018(zworkflowmessages).
      else.
        valid_selection = $yes.
      endif.
    endloop.
  endif.
endwhile.
swc_set_element container 'SelectedObject'     selectedobject.
swc_set_table   container 'SelectedObjectList' selectedobjectlist.
end_method.


*&---------------------------------------------------------------------*
*&      Form  FILL_NAMELIST_OBJECTLIST
*&---------------------------------------------------------------------*
form fill_namelist_objectlist tables   p_namelist structure rhobj_name
                                       p_objectlist
                                       p_profile.
  tables: ust04, usr01.
  data:
        current_index like sy-tabix,
        short_text    like objec-stext,
        i_bname       like table of ust04-bname with header line.

  loop at p_profile.
    select bname from ust04 into (i_bname)
      where profile = p_profile.
      collect i_bname.
    endselect.
  endloop.
  read table i_bname with key sy-uname.
  if sy-subrc eq 0. delete i_bname index sy-tabix. endif.

  loop at i_bname.
    concatenate 'US' i_bname into p_objectlist.
    call function 'RH_CHECK_ORG_OBJECT_EXISTS'
         exporting
              act_object_ext       = p_objectlist
         importing
              act_stext            = short_text
         exceptions
              no_active_plvar      = 1
              no_org_object        = 2
              org_object_not_found = 3
              others               = 4.
    move p_objectlist to p_namelist-object.
    move short_text   to p_namelist-stext.
    append p_objectlist.
    append p_namelist.
  endloop.
endform.                    " FILL_NAMELIST_OBJECTLIST





Binding from task to method



Binding from workflow to task







Regards
Nat Govender
Toyota South Africa
IT - SAP Workflow Specialist
Internal Ext.   :  32645
Direct Line    :  +27 031 910 2645
Fax               :  086 607 0414
E-mail           :  ngovender4 at toyota.co.za

If you tell the truth, you don't have to remember anything.


                                                                           
             kaukabr at yahoo.com                                             
             Sent by:                                                      
             sap-wug-bounces at m                                          To 
             it.edu                    "SAP Workflow Users' Group"         
                                       <sap-wug at mit.edu>                   
                                                                        cc 
             29-05-2009 05:25                                              
             AM                                                    Subject 
                                       Re: Document Park workflow          
                                                                           
             Please respond to                                             
               "SAP Workflow                                               
               Users' Group"                                               
             <sap-wug at mit.edu>                                             
                                                                           
                                                                           




Hi John,
You need to create POPUP method task after your decision Task and create
button in the task "Select Approvers", so when ever user click on Select
Approvers Button A popup method pops up a menu of a role then he/she can
select approvers from there.
But yu need to create a correct method in your  Business Object and a task
of background method in the WF .
I hope this helps the requirement of your client.
Regards,
Aziz.

From: Nash John <emailtonash at gmail.com>
To: SAP Workflow Users' Group <sap-wug at mit.edu>; sap-wug-request at mit.edu
Sent: Thursday, May 28, 2009 9:11:31 PM
Subject: Document Park workflow

Hi
I’m working on FI document park workflow. We are having a custom workflow
which gets triggered when ever a document is parked. The workflow is
working fine and is correctly finding the agents. However there is a new
change request that client does not want workflow to determine agent,
instead client want to select approvers from a list and workfitem should go
to that person. How can I achieve this(provideing list of approvers to
user). is there a user exit or something available?

Thanks

Nash_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20090529/425af383/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 23729762.gif
Type: image/gif
Size: 10447 bytes
Desc: not available
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20090529/425af383/attachment.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 23241427.gif
Type: image/gif
Size: 54347 bytes
Desc: not available
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20090529/425af383/attachment-0001.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 23164255.gif
Type: image/gif
Size: 39038 bytes
Desc: not available
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20090529/425af383/attachment-0002.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20090529/425af383/attachment-0003.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic21979.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20090529/425af383/attachment-0004.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20090529/425af383/attachment-0005.gif


More information about the SAP-WUG mailing list