1 Reply Latest reply on Jun 18, 2009 3:09 PM by user615883

    AME rules does not seem to be working properly

    user615883
      Hi ,

      Product : EBS --11.5.10.2 AME B rollup 2 .
      In AME B Transaction type -Purchase Requisition Approval.

      I created custom attribute :Line Item : Calc_reqline_total :
      Calculate requisition line total group by category segment1 and attribute7 as below
      select suma from
      (
      select sum(prl.unit_price * prl.quantity) suma,prl.attribute7 attr,mck.segment1 cat1
      from mtl_categories_b_kfv mck,
      po_requisition_lines_all prl ,
      po_req_distributions_all prd
      where mck.category_id = prl.category_id and
      prl.requisition_header_id = po_ame_setup_pvt.get_new_req_header_id(:transactionId)
      and prl.requisition_line_id = prd.requisition_line_id
      group by prl.attribute7,mck.segment1
      ),
      po_requisition_lines_all prl1,
      mtl_categories_b_kfv mck1
      where prl1.requisition_header_id =po_ame_setup_pvt.get_new_req_header_id(:transactionId)
      and prl1.attribute7 = attr
      and mck1.category_id = prl1.category_id
      and mck1.segment1 = cat1
      order by prl1.requisition_line_id

      No I defined condition : Category Segment1 in "Med Supplies"
      Category Segment1 in " Furniture"
      30,000=<Requisition total =<50,000
      30,000=<Calc_reqline_total =<50,000
      1000 =<Calc_reqline_total=<5,000
      1000 =<Requisition total =<5,000

      Approval Group : Approver 1 --
      Approver 2.

      Created Rules :
      List Creation : Rule 1 for Header: Requsition_total >30K and has Line item : Med supplies as segment1 and has Line Item : Calc_reqline_total> 30K --Add approver 1
      List creation : Rule 2 for header :requisition >1K and has Line Item "Furniture" as segment1 of cat and has Line Item :calc_reqline_total > 1K--Add approver 2

      When I create a requisition with multiple line
      3 Lines have Category segment1 as Med Supplies-- Sum of all the line amounts for these lines 32,400
      2 Lines have category segment1 as Furniture --sum of all the line amounts for these lines is 600 which is less then 1K limit .
      and Requisition total is 33K

      When i see the final result -- Approver 1, Approver 2 are getting added to the list .

      I can see the Calc_reqline_total populated properly against each line ...but when the rules are getting applied I feel its not considering this value ..
      Actually speaking if the line amount grouped total is > 30K and Med Supplies is the line amount then it should add approver 1
      But it is looking at Furniture also and even thogh the line grouped total is < 1K it some how is adding the approver 2 .

      How shuld i Define the rule so that I get only Approver 1 when my custom attribute as in query at line level should be considered for Approver addition .

      Please let me know if you wanted any clarification so that I can send sceen shots to your email if you could help.

      --Chandra

      Edited by: user615883 on Jun 17, 2009 11:35 AM