Changes to Std Workflow - WS14500015

Hi friends,
I want to make changes to std workflow WS14500015. Before approval process I want to first send a workitem to a person say 'manager1' who will change a SC field. Only when he changes it and approves, then only should the remaining wfl process continue otherwise the workitem should be sent to creator for resubmission. Can anyone please help me out with this???its very urgent.
Please help out!!!

Hi,
   See the foll code for reference:
method if_ex_bbp_wfl_approv_badi~get_remaing_approvers.
Business objects (local)
  constants:
   c_shop          type crmt_subobject_category_db value 'BUS2121',
   c_step1         type bbp_step_description value 'First approval step',
   c_step2         type bbp_step_description value 'Second approval step'.
*variables for holding the runtime SC values
  data : w_total type reqhead-total_value_long,
         w_group type zgroup-zprodgrp,
         w_category type zgroup-zprodcat,
         w_ccenter type zapprovers-zccnetre.
  data:
*Header data table
   wa_header type bbp_pds_sc_header_d,
*approver  structure
   wa_approver type bbp_wfl_approval_table_badi,
item structures
  it_item type table of bbp_pds_sc_item_d,
  wa_it_item  like line of it_item,
accounting structures
  it_account  type table of bbp_pds_acc,
  wa_it_account like line of it_account.
*tables for holding the final list of approvers bsed on the SC  criteria.
  data : it_rule type standard table of zrule,
         wa_it_rule like line of it_rule,
         it_approvers type standard table of zapprovers,
         wa_it_approvers like line of it_approvers.
  case object_type.
    when c_shop.
----------------------------- shopping cart-------------------------------- *
*get the details of the shopping cart
      call function 'BBP_PD_SC_GETDETAIL'
        exporting
          i_object_id = object_id
        importing
          e_header    = wa_header
        tables
          e_item      = it_item
          e_account   = it_account.
      clear w_total.
      if sy-subrc = 0.
*move the total value fo SC to w_total.
        move wa_header-total_value to w_total.
      endif.
      clear : w_category,
              w_ccenter,
              w_group.
*reading the item table for the Product category
*Here the first record is read only since all the items will necessarily
*have the same  Product category
      read table it_item into wa_it_item index 1.
      if sy-subrc = 0.
*set the product category
        move wa_it_item-category_id to w_category.
      endif.
Found out to which cost center the items belong
      read table it_account into wa_it_account
                                with key p_guid = wa_it_item-guid.
      if sy-subrc = 0.
        move wa_it_account-cost_ctr to w_ccenter.
      endif.
*to select the Proper Product Group from the maintained Z-table
*ZGROUP for the Product category of the SC items.
      select single zprodgrp
      from zgroup
      into w_group
      where zprodcat = w_category.
      if sy-subrc = 0.
        clear it_rule.
        refresh it_rule.
*selecting the proper approval Levels for the Product Group retrieved from
*the previous step as  well as based on the range in which the total value
*of the shopping cart falls in form the maintained Z-table ZRULE
        select  zrule
                zprodgrp
                zlevel
        into corresponding fields of table it_rule
        from zrule
        where zprodgrp = w_group
            and  zval1 le w_total
            and zval2 ge w_total.
        if sy-subrc = 0.
          clear it_approvers.
          refresh it_approvers.
*selecting the List of Approvers based on the previously retrieved
*Product Group,Approval Level and the Cost Center value from the
*maintained Z-table ZAPPROVERS
          if it_rule[] is not initial.
            select zindex
                   zrule
                   zprodgrp
                   zlevel
                   zccnetre
                   zuser
                   zname
            into corresponding fields of table it_approvers
            from zapprovers
            for all entries in it_rule
            where zrule = it_rule-zrule
             and zprodgrp = it_rule-zprodgrp
             and zlevel = it_rule-zlevel
             and zccnetre = w_ccenter.
          endif.
        endif.
      endif.
      if w_total eq  0.
        no_further_approval_needed = 'X'.
      endif.
*Based on the Current approval step,the values for the corresponding
*Approvers is exported
      clear approval_table.
      refresh approval_table.
*Actual approval index represents the current WF approval step
        case actual_approval_index.
*WF not started
          when 0.
*At each and every approval step we need to pass the Approvers from that step onwards
            loop at it_approvers into wa_it_approvers where zindex = 1.
              wa_approver-approval_index = 1.
              wa_approver-approval_agent = wa_it_approvers-zuser.
              wa_approver-name = wa_it_approvers-zname.
              wa_approver-approval_description = c_step1.
              append wa_approver to approval_table.
            endloop.
            loop at it_approvers into wa_it_approvers where zindex = 2.
              wa_approver-approval_index = 2.
              wa_approver-approval_agent = wa_it_approvers-zuser.
              wa_approver-name = wa_it_approvers-zname.
              wa_approver-approval_description = c_step2.
              append wa_approver to approval_table.
            endloop.
*1st step approval
          when 1.
            loop at it_approvers into wa_it_approvers where zindex = 1.
              wa_approver-approval_index = 1.
              wa_approver-approval_agent = wa_it_approvers-zuser.
              wa_approver-name = wa_it_approvers-zname.
              wa_approver-approval_description = c_step1.
              append wa_approver to approval_table.
            endloop.
            loop at it_approvers into wa_it_approvers where zindex = 2.
              wa_approver-approval_index = 2.
              wa_approver-approval_agent = wa_it_approvers-zuser.
              wa_approver-name = wa_it_approvers-zname.
              wa_approver-approval_description = c_step2.
              append wa_approver to approval_table.
            endloop.
2nd step approval
          when 2.
            loop at it_approvers into wa_it_approvers where zindex = 2.
              wa_approver-approval_index = 2.
              wa_approver-approval_agent = wa_it_approvers-zuser.
              wa_approver-name = wa_it_approvers-zname.
              wa_approver-approval_description = c_step2.
              append wa_approver to approval_table.
            endloop.
          when others .
            no_further_approval_needed = 'X'.
        endcase .
  endcase.
endmethod.
The above code is for the header level approval but in your case you will have to modify the code for item level approval.
The field "actual_approval_index" is the Approval step while the field "approval_index"  is the levels of approval for each approval step.i.e. Total no of approvals can be 3 but at each indidvidual aproval step there can be 2 approvals.
  Also you just need to populate the APPROVAL_TABLE and not the approval_administrators  table for Approvers.
BR,
Disha.
P. S.  Pls reward points for useful answers.

Similar Messages

  • Std Workflow events for HR Scenarios

    Hi I am looking for standard workflows for the following scenarios. Can someone tell me if there are any standard workflow events or should I go for creating a new WF event.
    1.Legal Name change---Is there a Wf that triggers some notification.
    2.Hire Action in SAP--Is there a Wf that triggers some notification to HR team and Dept mgr.
    3.Hire Action in SAP--Is there a Wf that triggers some notification to HR team and Dept mgr.
    4.Leave of Absence--Sap notifying HR team.
    5.Initial change(IT 105)--Payroll Admin sends notification to associate as well as security team.
    6.Marital Status Change.
    7.Termination(Voluntary and Involuntary)--Notification to Security team.
    8.Probation--Sap reminds the HR team that date is due for employee to return.
    I was thinking that for every scenario we have to create a new wf event. I may be wrong but is there a standard wf for the above.
    Thanks in advance.

    There are std. workflows for this, but it will depend upon your configuration. You can trace whether a workflow is getting triggered from txn: SWEL.
    The better option is to use the MAIL feature of dynamic actions. Here's the process:
    Enter the name of the feature which defines the characteristics of the mail.
    Example
    Infotype  Field  .....  Ind.    Var.function part
    0001     SACHP         M       M0001
    A mail is sent when the field SACHP is changed. The characteristics of the mail are defined in feature M0001.
    In the standard system, feature M0001 is provided as a model. The documentation on feature M0001 explains how to define the characteristics of a mail.
    Thanks
    Sankhadip
    <b>Reminder: Points should be awarded on answers</b>

  • Std workflow for Parked Invoices?

    hi guys
    are there any std workflows for parked invoices? Our requirement is that once the Finance clerk creates a customer or vendor invoice he should only be able to park it and not post the invoice. Once the invoice is parked then the system should trigger a workflow and a notification neeeds to be sent to the approver to approve the invoice. Once it is done the finance clerk will post the invoice.
    I switched on the event trace and did a trace on while creating a parked invoice. No event is triggered when the document is parked. If i post the document the event POSTED of object FIPP is triggerd. So since we dont have any std events raised when a document is parked is it possible to have a workflow?

    Hi,
    The event FIPP.CREATED is raise via the customizing (SPRO)
    Financial Accounting -> Financial Accounting global setting -> document -> document parking -> create workflow variant for parking documents.
                                      Assign co.code to a workflow variant for parking documents.
    Have a look at ws10000051.
    Regards,
    Ronit.

  • How to search for std workflows

    hi
    what is the best way to search for std workflows in SAP. I tried the tcode SWDM( Business Workflow Explorer ) but it does not bring correct results.
    can any one guide me on which is the best way to search for std workflows?
    thanks
    Sameer

    Hi,
    SWDM should yield the correct results, make sure you're defining your search correctly.
    Another way is to look directly in table HRS1201 (I think, im not in an SAP environment now).
    But here you also have to know the business objects related to the functional area where you are looking for standard workflows.
    Another thing is to use the search functionality in SDN with your query ike "standard workflow for ..."
    Kind regards, Rob Dielemans

  • Std Workflow Values in MM

    Hi MM Gurus
    Could any one share the Std Workflow Values available in MM. Ex: 9, 1, etc., and uses of the same
    Thanks

    Hi,
    Chekc on it:-
    www.erphome.net/wdb/upload/forum26_f_21.pdf
    http://help.sap.com/printdocu/core/print46c/en/data/pdf/BCBMTWFMMM/BCBMTWFMMM.pdf
    pherasath

  • How to transport changes made on Workflow Template to other cleint

    We have make changes to Workflow template via tcode PFTC_CHG (Change Task), with workflow builder screen, we make changes on the standard task, work item text etc, save the changes to workflow template WS90000XXX. However the changes we make is not save under a Transport Request number.
    How to make the changes on workflow template to save under a transport request and transport it to other client. ?

    Hi Eric,
    All development and customization of workflwo are saved in a transport request.
    If while making the changes it did not prompt you for a TR then check the TR in whcih the task was created.
    To port TRs follow the below procedure:
    1. Go to t-code SCC1.
    2. Select the transport request number and enter the source system (client)
    3. Click on 'Including Request Subtasks.
    4. Click on button 'Start immediately'
    This would port the TR.
    Please note to port workbench TRs before the customizing TRs.
    Regards,
    Saumya

  • How change subtitute of workflow through dynpro application

    Hi,
    i need to show facility to change subtitute of workflow in dynpro application . So Is there any ready to use i view for that or any Configuration settion for uwl connections.
    Regards,
    Gurprit Bhatia

    Thanks Enrique,
    The URL is changed, however I face another problem, it stated, 'DNS error - cannot find server' when browser started.
    Actually the test environment do not hv domain  , so I use the workgroup name as the domain. is this not possible ?
    Rgds,
    Janice

  • How change subtitute of workflow through portal

    Hi,
    i need to show facility to change subtitute of workflow in dynpro application . So Is there any ready to use i view for that or any Configuration settion for uwl connections.
    Regards,
    Gurprit Bhatia

    Hi,
    i need to show facility to change subtitute of workflow in dynpro application . So Is there any ready to use i view for that or any Configuration settion for uwl connections.
    Regards,
    Gurprit Bhatia

  • Std workflow for document distribution.

    Hi Gurus,
    Scenario is I donot have a workflow resource for customization. I need to send the document for Approval to a list of 4 Approvers after I set the status to "For Approval". Can we achieve it through document distribution with any std workflow avalaible which can be triggered after I set the status to " For Approval"?
    Thanks
    Pad

    Hi Sri,
    Thanks for the reply. I had the Workflow WS 20000104 inserted at the " For Approval " status. Then I created a new DIR and before setting this status I created the receipient list with my user Id . After I set the status "For Approval" I cannot see any work item in SBWP. Am I missing any step?
    If in case its because of the Workflow linkage inactive, could any of the Workflow experts guide me
    on how to do that.
    Thanks,
    Paddy

  • Change settings for workflow operation

    Hi,
    I am trying to change the settings and choose a custom workflow for the workflow operation 'Upload Document' in a folder in content services. However i cannot change the settings as the 'Workspaces' container has 'Do not allow subfolders to modify this operations workflow settings' checked, and i cannot edit this as it is all greyed out (even though i have admin rights?). Could anyone tell me how I can change the containers workflow settings?
    Many Thanks
    Dave

    If you upgrade to Workspaces 10.1.2.2 you can relax this restriction. As a user with administration privs on the workspaces container (likely the orcladmin by default), switch into administration mode (with link in the top right hand corner of the UI) and edit the properties of the workspaces container to allow subfolders to override the workflow settings.
    regards,
    -sancho

  • Change in Std SAP Program

    BW Experts,
    At my client I have changed a Std SAP program LRRSVF20. This was transported up all the way to production. Now that we did a Support pack upgrade in dev, This configuration is lost in development. What is the best approach to get it back. Reconfigure it which will give me a new transport request and retransport all the way till production. Or is there a better way.

    Hi,
    You need to redo the changes and then transport it again.
    Anyways as a Best Practice, don't change Std SAP programs. You can copy them to a Z or Y pgm and then modify them. Usually if you need to change them ask SAP for a correction and then insert/delete that in the program either by applying the note or using SNOTE.
    Cheers,
    Kedar

  • How do i change the Std. confirm key from 'AB' to 'Z1', receiving ACK IDOC.

    Hi,
    How do i change the Std. confirm key from 'AB' to 'Z1', when loading ACK IDOC.
    Thanks

    Hi Jorge,
    Thanks for your help.
    I change the output mode to "Collect IDocs" method, if I use SAP standard function POIM (RCCLMDAT), it will depend on change pointer to generate IDoc, and it includes function: RSEOUT00 ( and MASS_RSEOUT00 ) to collect and send IDoc.
    The collect table is BDCP.
    BR,

  • Changes done in workflow

    Hi all,
    I had done some changes in workflow template with English login to SAP. When it is tested with English login,  output can be seen according to changes made in workflow. But when I log in in dutch language, output doesn't refect the changes made in workflow.
    Please advice what could be done in this case?
    KR
    Vithalprasad

    hi Vittal,
                  As Mr.samy had said Logon languare is diffrent from maintanance language. Use USE EXTRAS->Translation
    Regards,
    Dheepak

  • Changing the std structure

    hi
    I am changing the std structure PRODHS
    so I have created the domain zprodh1and I need to add it to std data element prodh1.
    I have given the access key and entered in change mode for the data element ,then it is showing in display mode ,I am unable  to change it to change mode to do necessary changes to the data element(toreplace std  domain with customized domain zprodh1)
    plz advice me
    thanks
    karna

    hi
    it is reqt of changing the product hierarchy level from 3 to 5.(PRODHS)
    it is a 18 character word with 5/5/8. Now I need to change to 3/3/3/4/5.
    so for that system already define 9 std data elements.I created teh respective domains with required lengths,now I am changing the data elements with these domains ,I am having the access key for  changing the data elements,but it is displaying in display mode,I am unable to replace  the std domain with customed one.
    regds
    karna

  • Manual changes of Std price in Material master

    Dear friends,
    I am updating the price in material master monthly by std. cost estimate,
    Can it be possible to change the price manually.
    If it can changed manually ..........can anyone tell me how to do it...........
    I tried it by MR21, but it is not allowed in my system..............
    I am in urgent need............
    Thanks & Regards
    Shailesh

    hi shailesh
    To change the std price manually first u have to delete the std cost estimate for that month which has been marked & released . To do that use t- code CKR1 then change the std price using MR21.
    This should work.
    Regards
    Prasad
    Reward if useful

Maybe you are looking for

  • Delivering two videos at same time

    I am trying to simulate a software-instructional classroom by showing two (720x480) videos at the same time. One video showing the instructor in the classroom and the other of the instructor's computer screen. The first video (of the classroom) would

  • After updating to iOS 6.1.2 hear my partner call me anymore

    Hello, After updating to iOS 6.1.2 hear my partner call me anymore, can someone help me?

  • Hibernate Error in JDeveloper

    Hi, I am developing a Hibernate based application, and I have been going thru some sample application to understand how to go about it. While running one of the sample applications, I get the following error. I have tried placing the slf4j-api-1.5.2.

  • Run code when a radio button is clicked

    I have a radio group with various radio buttons in there named date, time, reg etc When I click on a button I need the following: Which radio button was pressed The value of that button eg date, time, reg etc Then run some code (I will use the value

  • Import Mail Wont Work

    I just purchased a new MacBook Pro and did a set up using a time machine backup.  When opening the mail program, I am prompted to import mail. I click continue and the import starts, but the import keeps locking about 3/4 of the way through.  Please