Workflow Approver Agent

Hi All,
I am working on a work flow scenario, where an a letter is generated as a PDF and is sent for approval to the manager. Once the manager (i.e. approver) accepts the letter, we send the letter to create a spool to be printed and in addition archive the letter to the contact object of a business partner.
Whenever the contact is created from the workflow, the user name of the creator of the contact (ERNAM) is updated as 'WF-BATCH'. The requirement is to get the name of the approver as the creator of the contact instead of 'WF-BATCH'. I can modify the filed ERNAM by using some function modules.
However, my problem is where to find the name of the user who approved the letter? I can get the initiator of the workflow in the field WFINITIATOR. Could you please let me know the field that stores the name of the agent who approved the letter?
Thanks in advance.
Regards,
Manohar Dubbaka.

Hi Manohar
WF-BATCH is getting assigned to the ERNAM field because you are not assigning anything to the same explicitly. I'll suggest you to create a new Wf Container Element and assign _ACTUALAGENT (The Task Container Element) to it. Do it after the contact is created from the workflow.
And as already mentioned by Karri, in case you want to use the same in a FM/program then call FM: SAP_WAPI_READ_CONTAINER within it. Let me know in case you need its sample code.
Hope this helps.
Harsh

Similar Messages

  • Conditions for contract workflow approval  agent.

    Y'all,
    I would like to know if its possible to have conditions in the WS14000088 contract workflow to assign the approval agent/user depending on contract values, for example i mean:
    "if the contract has an specific value at item level then assign the approval to the business unit manager... or if the contract has an specific value at header level then assign the approval to the category manager..." etc.. etc..
    Is it possible? if yes, how do you commit it into the system?
    Regards,
    Gerardo.

    Hi Jerry,
    Yes it is possible to have a conditions to assign and determine the approval agents depending on the value of the contract.
    Goto tcode SWDD and for the appropriate task in the workflow 'WS14000088' create the condition. The work item for this step can be executed when this condition for work item generation is met. If there is a requested start for this work item, this is checked separately when the condition is met.
    Reward points if the answer is helpful.
    Regards,
    Andy.

  • Confirmation - workflow approval agent change not reflected in BI Report

    Hi Experts,
    We have implemented SRM 5.0 and have enabled confirmations for POs and this is a classic scenario.
    When a original approver for the confirmation approval workflow was subsititued by an another user, this information is not part of the BI reports. when I checked the document, there was no change document initiated due to the agent change in the workflow. Due to this the delta upload process for BI, is not uploading this information to the BI system for reporting.
    If I run the full or regenerative mode, then the data is getting populated into the BI system. But I would like the delta process to pick it up.
    1. please let me know how to enable the change document for a confirmation, even when the agent is changed in the workflow.
    2. or if delta process to capture the agent changes within the workflow for confirmation.
    Your help is much appreciated.
    Vijay

    Hi,
    On Which Service Pack are you on?WAD has this feature of re arranging the keyfigures in BI 7.0 for SPS 14...
    Regards,
    Bhagyarekha.

  • Change Approval Agent in Workflow WS10400002 (SRM)

    Hi Gurus,
    My expertise in Workflow is very low and I have a requirement where I need to copy standard Workflow WS10400002 to a Z one and change the Approval Agent Determination. They do not want to use the Organizational Structure or Roles for this but instead they would like to have a Z table with the different users and determine the agents using ABAP. Is this possible? If so, how can I achieve this (I am not interested in the ABAP Code itself, but how can I call a routine or FM or program from the Step)?
    I searched the Web and SDN but only found explanation on how this works in standard workflow.
    Any help will be much appreciated.
    Regards,
    Ernesto.

    Hi Ernesto,
    You might get more help by posting your question in the workflow forum:
    SAP Community Network Forums » SAP NetWeaver » SAP Business Workflow
    Brenda

  • Regarding Approver agent determination

    Hi,
            I am new to SRM and i have a requirement to change the Workflow which is trigerred whenever a shopping cart is created and mail is sent to the approver for approval of the same.
           Here on creation of shopping cart i need to do some changes while determining the approver and i dont know exactly in where is this approver determined. Business object BUS2121 has been customised.
           Can any one please let me know the place exactly where this Approver Agent is determined, i need the method and the business object.
    Regards,
    Ravi G

    Hi,
    Whcih Workflow are you using for the Shopping cart approval?Based on the workflow used,teh agent determination varies e.g. for the Std 1step  ,2 step approval workflow,agent assignement is done at the task level but for N step approval workflow the agent determination is done thorugh the BADI "BBP_WFL_APPROV_BADI".
    See teh foll link for more details:
    SRM Business Workflow
    http://help.sap.com/saphelp_srm50/helpdata/en/8b/4fa9585db211d2b404006094b92d37/frameset.htm
    Setting Up SAP Business Workflow
    http://help.sap.com/saphelp_srm50/helpdata/en/ee/277e3c281f1817e10000000a114084/frameset.htm
    Related links ->
    Re: SRM workflow doubts....
    Triggering SRM workflow from a  web-based form (HTML)
    Workflow debugging
    Re: Triggering an alert
    Depending on the Approval Workflow, you are using, there are Binding Events under the Triggering Events tab of the Workflow inside the Workflow Builder (Transactions - SWDM / PFTC ).
    There the event can be defined, depending on the Business Object Type methods avaiable in SWO1 Transaction for BUS2121 in our case. (SAVED => Reqt cov. request Shop. cart created )
    Refer to this link for more details.
    http://help.sap.com/saphelp_srm50/helpdata/en/2c/e68d406b305537e10000000a1550b0/frameset.htm
    BR,
    Disha.
    <b>Pls reward points for useful answers.</b>

  • Select the approval Agent for Modeled Deadline Monitoring for WF WS14000133

    I have setup a deadline monitoring for WF WS14000133 using the modeled approach and added the "Send Mail" Test along with a Loop so that the the appover will get an email every day after three days of not approving a shopping cart.
    I noticed in task "109 Subworkflow n-step over Value" there is a task container element "&APPROVALAGENTS.ACT_AGENT&" which contains the approver. I am tring to put it in a Workflow container element that I created referencing "WFSYST-AGENT". When I try to setup a binding to import the value from the task container to the workflow container I get the following error:
    "Data object 'APPROVALAGENTS' is elementary )component 'ACT_AGENT' does not exist)
    Does anyone know how to fix this or does anyone know another way I can get the approval agent to the WF container so that I can send the email to them in the "send email" step?
    According to SAP this can be done....this is what they say on help.sap.com:
    "Actual agent: Element WIActual_Agent in the task container
    If you want to transfer the actual agent of a work item (available under the element ID WIActual_Agent in the task container) to the workflow container for further use, you define an appropriate element in the workflow container to contain this information.
    You create this element with a reference to the ABAP Dictionary field WFSYST-AGENT."
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c5/e4b06d453d11d189430000e829fbbd/frameset.htm

    hi ,
    the field actual agent gets will filled once the responsible agent completes / performs an action on it. Hence it is suggested to use some method / rule to get the responsible agent and create one local workflow container variable (table) to fill up the agents instead of manipulating the workflow variables directly.
    In this way, you can check if the table of agents and then send accordingly the deadline messages.
    Hope this helps.
    Best Regards,
    Saujanya

  • Approving agents of an item in SC ?

    Hi  :{),
    I am trying to get the list of agents who approved an item in a shopping cart.
    ( Item based workflow)
    I know how to get the agent list for the SC itself, using the FM SAP_WAPI_WORKITEMS_TO_OBJECT, OBJTYPE = 'BUS2121',OBJKEY ='10000001319'
    ,  but I don't know how to get the approvers for specific items inside the SC.
    can anyone help??
    thanks
    Ofer

    Hi
    <u>Please refer to this Sample code for Line-item Approval - SRM workflow.</u>
    <b>* This code gives idea about of how line item approval should work</b>
      INCLUDE <swfcntn01>.                  "Workflow
      DATA:
       ls_header         TYPE bbp_pds_sc_header_d,
    * approval object related structures
       ls_approver       TYPE bbp_wfl_approval_table_badi,
       ls_approver_a     TYPE bbp_wfl_approval_table_badi,
       ls_approver_b     TYPE bbp_wfl_approval_table_badi,
       lt_approver       TYPE TABLE OF bbp_wfl_approval_table_badi,
       ls_item_app_obj   TYPE bbps_wfl_item_approval_obj,
       ls_approval_def   TYPE bbpt_wfl_lia_def,
    * tables for different approval criteria
       lt_appr_def       TYPE TABLE OF bbpt_wfl_lia_def,
       lv_call_crit1     TYPE bbp_wfl_app_criterion,
       lv_call_value1    TYPE bbp_wfl_app_property,
    * approval item fields and structures
       ls_approval_item  TYPE bbps_wfl_item_approval,
       lt_approval_items TYPE TABLE OF bbps_wfl_item_approval,
       lv_approval_index TYPE bbp_wfl_approval_table_badi-approval_index,
       lv_guid           TYPE crmt_object_guid,
       ev_app_obj_guid   TYPE bbp_guid_32,
       lv_object_value   TYPE bbp_wfl_lia_value,
       lv_def_value      TYPE bbp_wfl_lia_value,
       lv_object_found   LIKE syst-subrc,
       lv_ob_tbx         LIKE syst-tabix,
    * item fields and structures
       ls_item           TYPE bbp_pds_sc_item_d,
       lt_item           TYPE TABLE OF bbp_pds_sc_item_d,
       ls_account        TYPE bbp_pds_acc,
       lt_account        TYPE TABLE OF bbp_pds_acc.
    * purchase order special...
      DATA:
      lt_approval_agent_obj       TYPE TABLE OF swf_bor_object,
      lt_approval_init_agents     TYPE TABLE OF bbp_wfl_approval_table,
      ls_wa_agent_obj             TYPE swf_bor_object,
      ls_approval_agent           TYPE bbp_wfl_approval_table,
      ls_wa_approval_init_agents  TYPE bbp_wfl_approval_table,
      ls_wa_approval_history      TYPE bbps_wfl_history_line_badi,
      lv_index                    TYPE syindex,
      lv_usr01_name               TYPE ad_namtext,
      lo_new_instance             TYPE swf_bor_object,
      lo_user                     TYPE swf_bor_object.
    * Business objects (local)
      CONSTANTS:
       c_po            TYPE crmt_subobject_category_db VALUE 'BUS2201',
       c_biddingdoc    TYPE crmt_subobject_category_db VALUE 'BUS2200',
       c_quotation     TYPE crmt_subobject_category_db VALUE 'BUS2202',
       c_grse          TYPE crmt_subobject_category_db VALUE 'BUS2203',
       c_invoice       TYPE crmt_subobject_category_db VALUE 'BUS2205',
       c_shop          TYPE crmt_subobject_category_db VALUE 'BUS2121',
       c_contract      TYPE crmt_subobject_category_db VALUE 'BUS2000113',
       c_salescontract TYPE crmt_subobject_category_db VALUE 'BUS2000114',
       c_avl           TYPE crmt_subobject_category_db VALUE 'BUS2206',
       c_invoicegrp    TYPE crmt_subobject_category_db VALUE 'BUS2207',
       c_vendor_obj    TYPE crmt_subobject_category_db VALUE 'BUS1006200'.
    * Approval Criteria and properties used (local)
      CONSTANTS:
        c_3_step_limit     TYPE i VALUE 510000000,
        c_no_approval      TYPE i VALUE 501000000,
        c_item_value       TYPE bbp_wfl_app_criterion  VALUE 'ITEM_VALUE',
        c_item_value_desc  TYPE bbp_step_description
                           VALUE 'Item Vaue Approval',
        c_cost_centre      TYPE bbp_wfl_app_criterion  VALUE 'COST_CTR',
        c_cost_centre_desc TYPE bbp_step_description
                           VALUE 'Cost Centre Approval',
        c_prod_categ       TYPE bbp_wfl_app_criterion  VALUE 'PROD_CAT',
        c_prod_categ_desc  TYPE bbp_step_description
                           VALUE 'Product Category'.
      CONSTANTS:
          c_agent_is_user TYPE otype VALUE 'US'.
    *** workflow approval states
      CONSTANTS:
       c_wf_approved           TYPE  bbp_wfl_approvalstate VALUE '0',
       c_wf_rejected           TYPE  bbp_wfl_approvalstate VALUE '1',
       c_wf_not_instanced      TYPE  bbp_wfl_approvalstate VALUE '2',
       c_wf_changed            TYPE  bbp_wfl_approvalstate VALUE '3',
       c_wf_partialapproved    TYPE  bbp_wfl_approvalstate VALUE '4',
       c_wf_step_in_process    TYPE  bbp_wfl_approvalstate VALUE '5'.
    * map char32 to raw16
      MOVE guid TO lv_guid.
      CASE object_type.
        WHEN c_shop.
    * -----------   shopping cart ---------------------------------- *
    *** get the nevessary field entries from the shopping cart
          CALL FUNCTION 'BBP_PD_SC_GETDETAIL'
            EXPORTING
              i_guid      = lv_guid
              i_object_id = object_id
            IMPORTING
              e_header    = ls_header
            TABLES
              e_item      = lt_item
              e_account   = lt_account.
          IF ls_header-total_value LT c_no_approval.
    *** we define a threshold value of 501 000 000 that means, if the
    *** shopping cart value is below that, ther's no approval required
            no_further_approval_needed = 'X'.
          ELSE.
    * read definition table
            CLEAR lt_appr_def.
            SELECT *  FROM bbpt_wfl_lia_def
                      INTO CORRESPONDING FIELDS OF ls_approval_def.
              APPEND    ls_approval_def TO lt_appr_def.
            ENDSELECT.
    *** We build up the item_approval_table and coplete approval object.
    *** For that we loop over the items, investigate if it belongs to
    *** one of the approval definitions we have made in the data base
    *** table " BBPT_WFL_IA_DEF ". I.e. if we have defined an approver
    *** for cost centre '1000' and the line item is assigned to cost
    *** centre '1000' the approver can be set - also, if there is no
    *** specific definition for the costcentre, but there is a definition
    *** for cost centre 'OTHERS'. However, if there is no entry with
    *** value 'OTHERS' in the cost centre table, there is no approval
    *** for that item
            LOOP AT lt_item INTO ls_item WHERE del_ind IS INITIAL.
    *** the item guid is set to all 'approval item' entries - this table
    *** provides a link between the approval object (defined by its GUID)
    *** and the line item in the shopping cart
              ls_approval_item-approval_item_guid = ls_item-guid.
    * 1st approval step executed for indices 1 and 0
              IF actual_approval_index LE 1.
                CLEAR ls_item_app_obj.
                ls_item_app_obj-sc_guid = ls_header-guid.
    *** 1st level: distinguish according to item value:
    *** for items with price less than 1000 we have a different approver
    *** - or none if none is defined - than for items costing more than 1000
                IF ls_item-value LT 1000.
                  lv_call_value1 = 'LOW'.
                ELSE.
                  lv_call_value1 = 'HIGH'.
                ENDIF.
    *** the following function now creates a GUID and an entry in the item
    *** approval object table if the criterion/value pair does not yet have
    *** a definition in that table - otherwise it returns the GUID already
    *** defined. The table lt_item_app_obj is updated in that function and
    *** there is no other modification to this table necessary in the BADI.
    *** The only important thing is, that the function has to be called with
    *** exactely the same key in order to identify the correct entry.
                CALL FUNCTION 'BBP_WFL_DIN_APP_OBJ_GET'
                  EXPORTING
                    sc_guid           = ls_header-guid
                    criterion1        = c_item_value
                    value1            = lv_call_value1
                  IMPORTING
                    approval_obj_guid = ev_app_obj_guid
                  TABLES
                    item_app_obj      = item_approval_obj.
    *** now we can also complete the approval item table with the approval
    *** object number and append it. The approver(s) for that object will be
    *** completed in a second step after this loop over the items.
                ls_approval_item-approval_object_guid = ev_app_obj_guid.
                APPEND ls_approval_item TO lt_approval_items.
              ENDIF. " 1st approval step
    * 2nd approval step executed for indices 1 and 0
              IF actual_approval_index LE 2.
                CLEAR ls_item_app_obj.
                ls_item_app_obj-sc_guid = ls_header-guid.
    * 2nd level: cost centre approval
    *** read cost centre in the account table (filled in the getdetail)
                READ TABLE lt_account INTO ls_account
                              WITH KEY p_guid = ls_item-guid.
    *** try to find an approver definition for the cost centre found
                READ TABLE lt_appr_def INTO ls_approval_def
                            WITH KEY  app_crit_name1 = c_cost_centre
                                     app_crit_value1 = ls_account-cost_ctr.
                IF sy-subrc = 4.
    *** if no cost centre found, check if there's an aprover for others
                  lv_call_value1 = 'OTHERS'.
                  READ TABLE lt_appr_def INTO ls_approval_def
                             WITH KEY  app_crit_name1 = c_cost_centre
                                      app_crit_value1 = lv_call_value1.
                ELSE.
                  MOVE ls_account-cost_ctr TO lv_call_value1.
                ENDIF.
                IF sy-subrc = 0.
    *** as in the 1st step, we call the function that filles the approval
    *** object table. Now we would also like this function fo add the values
    *** of the items belonging to a specific approval object to be
    *** summarised in the field APP_CRIT_VALUE3. For that we provide the
    *** item value and fill the flag 'iv_add_value'
    *** the item table is filled in the interface in order to check if an
    *** item exists for the approver before inserted
                  CALL FUNCTION 'BBP_WFL_DIN_APP_OBJ_GET'
                    EXPORTING
                      sc_guid           = ls_header-guid
                      criterion1        = c_cost_centre
                      value1            = lv_call_value1
                      iv_item_value     = ls_item-value
                      iv_add_value      = 'X'
                    IMPORTING
                      approval_obj_guid = ev_app_obj_guid
                    TABLES
                      item_app_obj      = item_approval_obj.
                  ls_approval_item-approval_object_guid = ev_app_obj_guid.
                  APPEND ls_approval_item TO lt_approval_items.
                ENDIF.
              ENDIF. "2nd approval step
    *** 3 step approval - 3rd step executed
    ***   we want to execute the 3rd step only for shopping carts with a
    ***   value exceeding a certain limit
              IF actual_approval_index LE 3
                       AND ls_header-total_value GE c_3_step_limit.
    * 3rd level: item category is evaluated
                CLEAR ls_item_app_obj.
                ls_item_app_obj-sc_guid = ls_header-guid.
    * find out if there's a specific definition for that product category
                READ TABLE lt_appr_def INTO ls_approval_def
                            WITH KEY  app_crit_name1 = c_prod_categ
                                     app_crit_value1 = ls_item-category_id.
                IF sy-subrc = 4.
    *** ceck if there is a default entry (similar to 2nd step)...
                  lv_call_value1 = 'OTHERS'.
                  READ TABLE lt_appr_def INTO ls_approval_def
                             WITH KEY  app_crit_name1 = c_prod_categ
                                      app_crit_value1 = lv_call_value1.
                ELSE.
                  MOVE ls_item-category_id TO lv_call_value1.
                ENDIF.
                IF sy-subrc = 0.
    *** if a definition (either specific or not) is found and we can fill a
    *** new entry in the approval object table or find the corresponding one
                  CALL FUNCTION 'BBP_WFL_DIN_APP_OBJ_GET'
                    EXPORTING
                      sc_guid           = ls_header-guid
                      criterion1        = c_prod_categ
                      value1            = lv_call_value1
                      iv_item_value     = ls_item-value
                      iv_add_value      = 'X'
                    IMPORTING
                      approval_obj_guid = ev_app_obj_guid
                    TABLES
                      item_app_obj      = item_approval_obj.
                  ls_approval_item-approval_object_guid = ev_app_obj_guid.
                  APPEND ls_approval_item TO lt_approval_items.
                ENDIF.
              ENDIF. " 3rd approval step
            ENDLOOP.
    * now fill the approver for the different approval definitions
    * 1st approval step executed for indices 1 and 0
            IF actual_approval_index LE 1.
    *** fill the approver table lt_approver using the guid/key combination
    *** from the item approval object table to assign the approval object
    *** guid to the approvers specified for the key in the definition table
    *** the hide items flag specifies, that for those steps where it is set
    *** the approver can only see the items of their responsibility
              CALL FUNCTION 'BBP_WFL_DIN_FILL_APPROVER'
                EXPORTING
                  iv_approval_index   = 1
                  ic_step_description = c_item_value_desc
                  iv_criterion1       = c_item_value
                  iv_hide_items_flag  = 'X'
                TABLES
                  it_approval_def     = lt_appr_def
                  it_approval_object  = item_approval_obj
                  et_approver         = lt_approver
                  it_approval_items   = lt_approval_items.
            ENDIF.
    * 2nd aproval step executed for actual indices 1, 2 and 0
            IF actual_approval_index LE 2.
    *** fill approvers for 2nd step
              CALL FUNCTION 'BBP_WFL_DIN_FILL_APPROVER'
                EXPORTING
                  iv_approval_index   = 2
                  ic_step_description = c_cost_centre_desc
                  iv_criterion1       = c_cost_centre
                TABLES
                  it_approval_def     = lt_appr_def
                  it_approval_object  = item_approval_obj
                  et_approver         = lt_approver
                  it_approval_items   = lt_approval_items.
            ENDIF.
            IF actual_approval_index GT 2 AND
               ls_header-total_value LT c_3_step_limit.
    *** 2 step approval if value is less than c_3_step_limit
              no_further_approval_needed = 'X'.
            ELSEIF actual_approval_index LE 3
               AND ls_header-total_value GE c_3_step_limit.
    *** 3 step approval - 3rd step executed
              CALL FUNCTION 'BBP_WFL_DIN_FILL_APPROVER'
                EXPORTING
                  iv_approval_index   = 3
                  ic_step_description = c_prod_categ_desc
                  iv_criterion1       = c_prod_categ
                TABLES
                  it_approval_def     = lt_appr_def
                  it_approval_object  = item_approval_obj
                  et_approver         = lt_approver
                  it_approval_items   = lt_approval_items.
            ELSEIF actual_approval_index GT 3.
    *** we don't define more than 3 steps
              no_further_approval_needed = 'X'.
            ENDIF.
            item_approval_table[] = lt_approval_items[].
            approval_table[]      = lt_approver[].
          ENDIF. " value less than "c_no_approval"
        WHEN c_po.
    * ---------------------   purchase order ---------------------------- *
    ** 08/15 implementation - well at least this shows it's not the
    ** auto-approval work flow ruinning
    *      IF actual_approval_index LE 1.
    *        ls_approval_agent-approval_branch = 1.
    *        ls_approval_agent-initial_index = 1.                " Index = 1
    *        ls_approval_agent-initial_agent = 'MANAGER2'.
    *        ls_approval_agent-approval_state = c_wf_not_instanced.
    *        APPEND ls_approval_agent TO lt_approval_init_agents.
    *      ENDIF.
    *      IF actual_approval_index LE 2.
    *        ls_approval_agent-approval_branch = 1.
    *        ls_approval_agent-initial_index = 2.                " Index = 2
    *        ls_approval_agent-initial_agent = 'MANAGER10'.
    *        ls_approval_agent-approval_state = c_wf_not_instanced.
    *        APPEND ls_approval_agent TO lt_approval_init_agents.
    *        ls_approval_agent-approval_branch = 1.
    *        ls_approval_agent-initial_index = 2.                " Index = 2
    *        ls_approval_agent-initial_agent = 'MANAGER5'.
    *        ls_approval_agent-approval_state = c_wf_not_instanced.
    *        APPEND ls_approval_agent TO lt_approval_init_agents.
    *      ENDIF.
    *      IF actual_approval_index LE 3.
    *        ls_approval_agent-approval_branch = 1.
    *        ls_approval_agent-initial_index = 2.                " Index = 3
    *        ls_approval_agent-initial_agent = 'MANAGER44'.
    *        ls_approval_agent-approval_state = c_wf_not_instanced.
    *        APPEND ls_approval_agent TO lt_approval_init_agents.
    *      ENDIF.
    ** 1) Evaluate the list of spending limit approvers from BOR
    **    attributes
          swf_create_object  lo_new_instance  object_type   guid.
          swf_get_property   lo_new_instance 'SLManagerUserList'
                                              lt_approval_agent_obj[].
          lv_index = 1.
          LOOP AT lt_approval_agent_obj INTO ls_wa_agent_obj.
            swf_get_property ls_wa_agent_obj 'User' lo_user.
            swf_get_property lo_user 'NameWithLeadingUS'
                                    ls_approval_agent-approval_agent.
            swf_get_property lo_user 'Name' lv_usr01_name.
            MOVE lv_usr01_name TO ls_approval_agent-name.
            ls_approval_agent-approval_index = lv_index.
            ls_approval_agent-approval_branch = 1.
            ls_approval_agent-initial_index = lv_index.
            ls_approval_agent-initial_agent =
                                 ls_approval_agent-approval_agent.
            ls_approval_agent-approval_state = c_wf_not_instanced.
            APPEND ls_approval_agent TO lt_approval_init_agents.
            lv_index = lv_index + 1.
          ENDLOOP.
    *** 2) Evaluate the list of remaining approvers. The actual approver
    ***    belongs to the list as well.
          LOOP AT approval_history_table INTO
                       ls_wa_approval_history WHERE type <> 'I'.
            LOOP AT lt_approval_init_agents INTO
                                      ls_wa_approval_init_agents.
              IF ls_wa_approval_init_agents-approval_index LT
                        ls_wa_approval_history-approval_index.
                DELETE lt_approval_init_agents.
              ENDIF.
            ENDLOOP.
          ENDLOOP.
    * fill the import table
          CLEAR ls_wa_approval_init_agents.
          LOOP AT lt_approval_init_agents INTO
                                    ls_wa_approval_init_agents.
            CLEAR ls_wa_approval_history.
            MOVE-CORRESPONDING ls_wa_approval_init_agents TO
                                              ls_wa_approval_history.
            APPEND ls_wa_approval_history TO approval_table.
          ENDLOOP.
          IF approval_table[] IS INITIAL.
            no_further_approval_needed = 'X'.
          ENDIF.
    * fill administrators for WIs with missing approver assignment:
          CLEAR ls_approver.
          ls_approver-approval_agent = 'USADMIN1'.
          APPEND ls_approver TO approval_administrators.
          ls_approver-approval_agent = 'USADMIN2'.
          APPEND ls_approver TO approval_administrators.
    *      approval_table[]      = lt_approver[].
    * -----------------------   contract -------------------------------- *
        WHEN c_contract.
    *   to be implemented
          CALL FUNCTION 'BBP_WFL_DIN_EXAMPLE_APPROVAL'
            IMPORTING
              et_approval_agents = approval_table[].
    * ---------------------  quotation ---------------------------------- *
        WHEN c_quotation.
          ls_approver-approval_description = '1st Approval'.
          ls_approver-approval_index = 1.
          ls_approver-approval_branch = 1.
    *      ls_approval_agent-initial_index = 1.
          ls_approver-approval_agent = 'USMANAGER11'.
          ls_approver-name = 'Karina Manager11'.
    *      ls_approval_agent-approval_state = c_wf_not_instanced.
          APPEND ls_approver TO lt_approver.
          ls_approver-approval_index = 1.
          ls_approver-approval_branch = 1.
    *      ls_approval_agent-initial_index = 1.
          ls_approver-approval_agent = 'USMANAGER10'.
          ls_approver-name = 'Armin Manager10'.
    *      ls_approval_agent-approval_state = c_wf_not_instanced.
          APPEND ls_approver TO lt_approver.
          ls_approver-approval_description = '2nd Approval'.
          ls_approver-approval_index = 2.
          ls_approver-approval_branch = 1.
    *      ls_approval_agent-initial_index = 2.
          ls_approver-approval_agent = 'USMANAGER44'.
          ls_approver-name = 'Paola Manager44'.
    *      ls_approval_agent-approval_state = c_wf_not_instanced.
          APPEND ls_approver TO lt_approver.
          ls_approver-approval_description = '3rd Approval'.
          ls_approver-approval_index = 3.
          ls_approver-approval_branch = 1.
    *      ls_approval_agent-initial_index = 2.
          ls_approver-approval_agent = 'USMANAGER2'.
          ls_approver-name = 'Arnold Manager2'.
    *      ls_approval_agent-approval_state = c_wf_not_instanced.
          APPEND ls_approver TO lt_approver.
          approval_table[]      = lt_approver[].
      ENDCASE.
    Hope this will help.
    Please reward suitable points, incase it suits your requirements.
    Regards
    - Atul

  • How to use a pwa group in CREATE A TASK PROCESS in SPD 2013 for project server workflow approval process

    I am working on a Project Server 2013 workflow. I am creating this using Sharepoint Designer 2013. In this workflow I am using approval process at one stage. I have created a security group SalesManagers in PWA. I want to use this group for workflow approval
    process. I want all users of this group get approval tasks. 
    For this I used START A TASK PROCESS activity in the SP Designer. I clicked on
    this user and created task process. But here I could not find SalesManager group which I created in PWA. I was only able to find the users. I can also see
    Administrators for PWA . But couldnot find SalesManager or any other security group created in pwa.
    Can anyone suggest how I can get the security group created in pwa.

    NBDevelopment,
    I believe SPD only recognizes the SharePoint Groups and not the project server security groups.
    The Administrators for PWA, and few other groups like Project Managers for PWA etc., are synced SharePoint Groups with the security groups, which is why they show up in SPD.
    You could create a SharePoint Group for the Sales Managers group and use that in SPD.
    Cheers,
    Prasanna Adavi, Project MVP
    Blog:
      Podcast:
       Twitter:   
    LinkedIn:
      

  • Reminder mail for workflow approval

    Hi All,
    We have a scheduled task which sends Reminder mails for workflow approval which has been pending for more than 5 days.
    Recently I created new workflow definitions and reminder task stopped sending mails.
    I checked task and it has IapiTaskIfc Class com.frictionless.custom.wkfreminder.sendWorkflowReminder.
    How to check this class and do i need to make changes somewhere else to send reminder mails?
    Regards,
    Prabhat

    Hi Prabhat,
    I am working on creating a scheduled task for sending reminder emails. I need help on IapiTaskIfc Class com.frictionless.custom.wkfreminder.sendWorkflowReminder. Can you please share sendWorkflowReminder class to me, so that I can get idea about the code written for sending reminder emails? It would be great help.
    To check the class, you need to get the jar from server and decompile it. You can get some idea by looking at the java class file then.
    Thanks,
    Saloni

  • How to call workflow approve service in loop for multiple documents.

    i have created a serviceHandler for approving the document and i post the comma separated dIDs as a string from workflow approval template(custom template). And in serviceHandler program i pass the did for approving and only first document is approved and for other document its throwing error, Its showing error document revision is not a latest revision but document is having only one revision.
    my code is: can anyone help me.
    public void SendAllDocuments()
            throws DataException, ServiceException{
        try{
        String [] ContentDids;
        System.out.println("+++++++here we are the all SendAllDocuments++++++++++++++");
        String workflowIds = m_binder.getLocal("workflowIds");
        if(!workflowIds.isEmpty()){
             ContentDids = workflowIds.split("\\,");
        }else{
            throw new ServiceException("document are not selected from users, workflowIds"+workflowIds);
        int arrayLength = ContentDids.length;
        for(int iterator=0;iterator<=arrayLength-1;iterator++){
            SendDocumentToUserQueue(ContentDids[iterator]);
        }}catch(Exception e){ e.printStackTrace();}
        m_workspace.releaseConnection();
    //DocMeta table varible which are coming from Internal assignment page
    //xWF_SentFrom",xWorkflowStepAlias",xWF_SendTo",xPurposeForSubmission",xPurposeForRejection",xDocApproval",xWorkflowComments"
    //xInternalAssignment",togroup",xWF_SendToSend",xWF_SendToSend12",xPurposeForSubmissionSend",xWF_SendToApprove",wfSendApproveComments"
    //Revision table variable which can get from getRevisionsTableValueFromDid
    // dDocName", dDocType",dRevLabel",dSecurityGroup",dDocAccount"
    public void SendDocumentToUserQueue(String approvalId) throws DataException, ServiceException{
        try{
            DataResultSet resultset =getRevisionsTableValueFromDid(approvalId);
            String sendToName = m_binder.getLocal("sendToName");
            String sender="takuma";
        //String workflowComments = m_binder.getLocal("workflowComments");
        String workflowReason = m_binder.getLocal("workflowReason");
        m_binder.putLocal("IdcService", "WORKFLOW_Approve");
        m_binder.putLocal("idcToken", m_binder.getLocal("idcToken"));
        m_binder.putLocal("dID", approvalId);
        m_binder.putLocal("xWF_SendTo", sendToName);
        m_binder.putLocal("xPurposeForSubmission","108");
        m_binder.putLocal("xWF_SentFrom", sender);
        m_binder.putLocal("xWorkflowStepAlias", "");
        m_binder.putLocal("xPurposeForRejection", "");
        m_binder.putLocal("xDocApproval", "");
        m_binder.putLocal("xWorkflowComments", "");
        m_binder.putLocal("xInternalAssignment", "");
        m_binder.putLocal("xWF_SendToSend", "");
        m_binder.putLocal("dDocName", getData(resultset,"dDocName"));
        m_binder.putLocal("dDocType", getData(resultset,"dDocType"));
        m_binder.putLocal("dRevLabel", getData(resultset,"dRevLabel"));
        m_binder.putLocal("dSecurityGroup", getData(resultset,"dSecurityGroup"));
        m_binder.putLocal("dDocAccount", getData(resultset,"dDocAccount"));
        executeService(m_binder, sender);
    }catch(Exception e){ e.printStackTrace();}
    public DataResultSet getRevisionsTableValueFromDid(String documentId) throws DataException, ServiceException{
        DataResultSet drs = new DataResultSet();
        try{
            /*String sqlDocType="select dDocType from revisions where dId ='"+documentId+"'";
        ResultSet documentRset = getSystemWorkspace().createResultSetSQL(sqlDocType);
        //handle null pointer exception for DocumentValue
        String DocumentValue = ResultSetUtils.getValue(documentRset, "dDocType");*/
        String sql="select dDocName,dDocType,dRevLabel,dSecurityGroup,dDocAccount from Revisions where dId ='"+documentId+"'";
        ResultSet rset = getSystemWorkspace().createResultSetSQL(sql);
        if (rset == null || rset.isEmpty()) {
            SystemUtils
                    .info("Resultset is null please check database query and Did ="+documentId);
        drs.copy(rset);
        catch(Exception e){
            System.out.println("in catch of getRevisionId Method");
            e.printStackTrace();}
        //handle null pointer exception for DocumentValue       
        return drs;       
    public String getData(DataResultSet dataSet, String value) {
        String fieldValue = "";
        fieldValue = ResultSetUtils.getValue(dataSet, value);
        System.out.println(fieldValue+"value is null in getData Method=======");
        return fieldValue;
    public UserData getFullUserData(String userName, ExecutionContext cxt,
            Workspace ws) throws DataException, ServiceException {
        if (ws == null)
            ws = getSystemWorkspace();
        UserData userData = UserStorage.retrieveUserDatabaseProfileDataFull(
                userName, ws, null, cxt, true, true);
        //ws.releaseConnection();
        return userData;
    public Workspace getSystemWorkspace() {
        Workspace workspace = null;
        Provider wsProvider = Providers.getProvider("SystemDatabase");
        if (wsProvider != null)
            workspace = (Workspace) wsProvider.getProvider();
        return workspace;
    public void executeService(DataBinder binder, String userName)
            throws DataException, ServiceException {
        // obtain a connection to the database
        Workspace workspace = getSystemWorkspace();
        // check for an IdcService value
        String cmd = binder.getLocal("IdcService");
        if (cmd == null)
            throw new DataException("!csIdcServiceMissing");
        // obtain the service definition
        ServiceData serviceData = ServiceManager.getFullService(cmd);
        if (serviceData == null)
            throw new DataException(LocaleUtils.encodeMessage(
                    "!csNoServiceDefined", null, cmd));
        // create the service object for this service
        Service service = ServiceManager.createService(serviceData.m_classID,
                workspace, null, binder, serviceData);
        // obtain the full user data for this user
        UserData fullUserData = getFullUserData(userName, service, workspace);
        service.setUserData(fullUserData);
        // binder.m_environment.put("REMOTE_USER", userName);
        ServiceException error = null;
        try {
            // init the service to not send HTML back
            service.setSendFlags(true, true);
            // create all the ServiceHandlers and implementors
            service.initDelegatedObjects();
            // do a security check
            service.globalSecurityCheck();
            // prepare for the service
            service.preActions();
            // execute the service
            service.doActions();
            // doany cleanup
            service.postActions();
            // store any new personalization data
            service.updateSubjectInformation(true);
            service.updateTopicInformation(binder);
        } catch (ServiceException e) {
            varTrueFalse = false;
            error = e;
            SystemUtils.info("exception in second location=" + e);
            e.printStackTrace();
        } finally {
            // Remove all the temp files.       
            service.cleanUp(true);       
        // handle any error
        if (error != null) {
            error.printStackTrace();
            if (binder.getLocal("StatusCode") == null) {
                binder.putLocal("StatusCode", String.valueOf(error.m_errorCode));
                binder.putLocal("StatusMessage", error.getMessage());
            } else {
                throw new ServiceException(error.m_errorCode,
                        error.getMessage());

    I guess it is caused by the fact that some of variables in the binder refer to the first workflow item. My bet would be dDocName.
    Try to find out what's in the binder if you approve the second item from GUI and what's there when you do it from your program. That should give you enough info what you need to change.

  • Workflow approval from mobile in ECC5

    Hi All
      We are already having workflow approval in R/3 where it happening from SAP inbox now my client want to migrate to mobile phone. Its it possible from ECC5 we dont have portal. How to implement it. Do we need to install any 3rd party like sybase or other. The main module is MM and PS and also they should be online always ie latest data should send and should update immediately ie should be syn with R/3. How it can be achieved. And also it should be device independet approval can be happend from iphone or blackbarry. Is any link or note are available to share with our client. Awaiting for your thoughts.
    Regards
    Vijay

    Hi Vijay,
    May be you should check the following WiKi link on SDN.  This might answer some of your questions.
    http://wiki.sdn.sap.com/wiki/display/mobile/SybaseMobileWorkflow
    Hope this helps.
    Best Regards,
    Kranti

  • Some Users cannot Open Workflow Approval Task

    We have a SPD workflow published to our production site and it includes a 'Start Approval Process' task which involves a number of users (determined by a lookup to another list) this worked brilliantly until we republished the workflow with some minor changes,
    none of which were to this particular approval task. Now we are seeing some strange behaviours. When some users click the task to approve they are seeing 'This from cannot be opened in a browser, To open this form use Microsoft Infopath'. Now strangely it's
    only certain users, if you're a site collection admin you never have this error. So if a user previously had the error and i then add them to the site collection administrators list the error goes away and they can complete the task.
    Obviously not a solution! giving users full control permissions on the task list or task item doesnt fix the error either. The same workflow on our UAT works without any issues. The task forms in SPD have not been customised either. Its a SP2010 Standard
    farm with no infopath services obviously. Bizarrely there are some users with only Contribute rights to the task list who can open approve tasks, so it's looking like a permissions issue to me but I'm at a loss to find a fix. I've tried totally removing
    the worklows and republishing, regenerating the .xsn task forms in SPD by deleting them and republishing, removing and re-adding the task related content types to site, Changing the Approval Task settings 'only allow users to edit their tasks...' to false
    and then back to true, the works, but to no avail.
    Anybody any ideas?
    TIA
    Chris

    Hi,
    According to your post, my understanding is that Some Users cannot Open Workflow Approval Task.
    I recommend that you can create a new list and workflow to check whether it works.
    Then use the user who get the error to open task.
    If he can open the task in the brower, the issue is related to the older list.
    Then you can use the new created list and assgin the task.
    Here is a similar thread for your reference:
    https://social.msdn.microsoft.com/Forums/en-US/67dc8577-f248-4d6c-bb82-3aca0f084d24/this-form-cannot-be-opened-in-a-web-browser-error-not-an-infopath-form?forum=sharepointcustomizationprevious
    Thanks,
    Linda Li                
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • Self Registration without Company or Workflow approval

    Hello,
    We have NW2004s SP 10.  Is it possible to allow a very simple self registration without using Companies or Workflow approval?  The online help seems to imply that this is possible, but I've tried to configure our Portal as such but nothing shows up on our welcome page. 
    What I've done is the following:
    User Admin UI settings:
    Enable Self-Registration of Guest Users=true
    Display Contact Information Form During Self-Registration = true
    All the rest are set to false/blank or default
    Visual Admin settings:
    Server ->Service -> UME Provider -> ume.logon.selfreg = true
    Thanks,
    T

    You also need to assign the UME Action UME.Selfregister_User to the Everyone group. Use /useradmin to create a UME role called something useful and add the UME action specified.
    Now grant that role to the Everyone group.
    Cheers

  • Redirection not working as expected after workflow approval

    Hi,
    We are migrating our application from Stellent 7.1 to WCC 11g and finding a strange issue in 11g with respect to a functionality that is working perfectly in 7.1.
    We have two services for workflow approval. If the approval is happening from the QA workflow, the service being called is WORKFLOW_APPROVE_SUBMIT_QA and if it is happening from other workflows, the service being called is WORKFLOW_APPROVE_SUBMIT.
    The actions for these two services are the same except the prepareRedirect action as given below:
    1. WORKFLOW_APPROVE_SUBMIT redirects to IdcService=GET_PORTAL_PAGE&Action=GetTemplatePage&Page=WF_INQUEUE_LIST, which displays the workflow assignments for the user from all workflows.
    3:prepareRedirect:IdcService=GET_PORTAL_PAGE&Action=GetTemplatePage&Page=WF_INQUEUE_LIST
    2. WORKFLOW_APPROVE_SUBMIT_QA redirects to IdcService=QA_WORKFLOW_LIST (a custom service written that will display the contents in the user's queue from the QA workflow)
    3:prepareRedirect:IdcService=QA_WORKFLOW_LIST::null
    For WORKFLOW_APPROVE_SUBMIT service, the redirection is happening as expected.
    But, WORKFLOW_APPROVE_SUBMIT_QA service is redirecting to IdcService=GET_DOC_PAGE&Action=GetTemplatePage&Page=HOME_PAGE instead of the specified redirect.
    We tried changing the redirect action for the service WORKFLOW_APPROVE_SUBMIT_QA to IdcService=GET_PORTAL_PAGE&Action=GetTemplatePage&Page=WF_INQUEUE_LIST, but still it is redirecting to the HOME_PAGE.
    Highly appreciate any solution for this issue or any suggestions on the possible cause.
    Thanks,
    Manjusha

    I have version 33.0.1 and i still have this problem, any other help ? Thanks!

  • Workflow Approval for CTS+ for NON ABAP Transport

    Hi
    We have a NW Portal system currently using CTS+ for transport.
    We would like to incorporate a workflow approval for transport across the different landscape (DEV -> TEST -> QA -> PRD) with CTS+. The workflow approval would work in such a way that when someone approves a transport request from DEV->TEST, the Basis Admin will then perform the import to TEST. So this approval will also be needed from TEST -> QA and QA -> PRD.
    Does Solution Manager provide such workflow approval for NON ABAP transport?
    I do hope anyone has such experience to share.
    Thanks.
    Regards
    mike

    Hi Mike
    Yes solution Manager CHARMS or Change request managment functionality uses CTS+ to move the Non ABAP requests
    it uses IBASE as identifier for systems and for more can search sdn
    check this link too
    http://www.sdn.sap.com/irj/sdn/alm-change-management
    Hope it helps
    Regards
    Prakhar

Maybe you are looking for