5 Replies Latest reply on Dec 12, 2012 12:47 PM by Giuseppe Bonavita

    Can we customize costing Process?

      We have configured costing process at different leave and working fine. However, we have to incorporate additional condition base on location which are.

      Suppose for basic element system get GL code from element link screen and the cost center take from Organization window, but at the same time we have to check location as well which are.

      For Head Office      (HO)
      Element GL : xx9993333
      Organization : xx101     (Take from Organization for HOd Office Employee)
      Location : Head Location

      Other then Above
      Element GL : xx9993333
      Organization : xx100 (Set it condition base other then HO)
      Location : North Location

      In above example, system will take Cost-center from Organization window but if location is not Head office of that employee than it’ should take condition base.

      Pls advice.
        • 1. Re: Can we customize costing Process?
          Giuseppe Bonavita
          You need to define a link for any combination ( Organization and Location )

          If you have Organization = (xx100, xx101) and Location = (HQ, North), you need to define the link for all the combinations

          Depending on your structure, it might become complex as the number of possible combinations grows with the number of Organizations and Locations.
          You can define links through API - meaning create custom code to create and maintain the links according to your logic.

          Finally, you could create links only for the majority of cases (e.g. based on Organization only), then handle exceptions through a batch programm setting the costing at element level.
          • 2. Re: Can we customize costing Process?
            Dear Giuseppe Bonavita,

            I would like to request you to share idea of "batch programm setting the costing at element", might it resolve out problem.

            • 3. Re: Can we customize costing Process?
              Giuseppe Bonavita
              please find some sample code we used for a similar issue, it might give an idea.
              we used it to create links for every people group - and store the costing segment in a valueset XX_PEOPLE_GROUP
              create or replace procedure create_element_link (p_element_name varchar2) is
                v_element_type_id number;
                v_effective_Date  date := to_date('1-JAN-1900', 'DD-MON-YYYY');
                v_payroll_id      number;
                select element_type_id
                into   v_element_type_id 
                from   pay_element_types_f
                where  v_effective_Date between effective_start_date and effective_end_Date
                and    element_name     like p_element_name;
                select payroll_id
                into   v_payroll_id
                from   pay_payrolls_f
                where  v_effective_Date between effective_start_date and effective_end_Date
                and    payroll_name     = 'XX Monthly';
                for i in (
                  select ffv.*
                  from   fnd_flex_value_sets   ffvs
                        ,fnd_flex_values       ffv
                  where  ffvs.flex_value_set_id   = ffv.flex_value_set_id
                  and    ffvs.flex_value_set_name = 'XX_PEOPLE_GROUP'
                ) loop
                    v_people_group_id              number;
                    v_cost_allocation_keyflex_id   number;
                    v_balancing_keyflex_id         number;
                    v_cost_concat_segments         varchar2(10000);
                    v_balance_concat_segments      varchar2(10000);
                    -- API output variables
                    v_element_link_id               number;
                    v_comment_id                      number;
                    v_object_version_number      number;
                    v_effective_start_date      date;
                    v_effective_end_date           date;
                    v_people_group_id              := get_people_group_id (i.flex_value);
                    v_cost_allocation_keyflex_id   := get_cost_allocation_keyflex_id(i.attribute1, v_cost_concat_segments);
                    v_balancing_keyflex_id         := get_balancing_keyflex_id(i.attribute1, v_balance_concat_segments);
                      (p_effective_date                  => to_date('1-JAN-1900', 'DD-MON-YYYY')
                      ,p_element_type_id                 => v_element_type_id 
                      ,p_business_group_id               => 101
                      ,p_costable_type                   => 'C' -- 'F'?
                      ,p_payroll_id                      => v_payroll_id
                      ,p_people_group_id                 => v_people_group_id
                      ,p_cost_segment1                   => 'XX'
                      ,p_cost_segment2                   => 'ZZZZZ'
                      ,p_cost_segment3                   => 'ZZZZZZZZZZZZZ'
                      ,p_cost_segment4                   => i.attribute1
                      ,p_cost_segment5                   => 'ZZZZZ'
                      ,p_cost_segment6                   => 'ZZZZ'
                      ,p_balance_segment1                => 'XX'
                      ,p_balance_segment2                => 'ZZZZZ'
                      ,p_balance_segment3                => 'ZZZZZZZZZZZZZ'
                      ,p_balance_segment4                => '1000'
                      ,p_balance_segment5                => 'ZZZZZ'
                      ,p_balance_segment6                => 'ZZZZ'
                      ,p_cost_concat_segments            => 'OT.ZZZZZ.ZZZZZZZZZZZZZ.'|| i.attribute1 ||'.ZZZZZ.ZZZZ'
                      ,p_balance_concat_segments         => 'OT.ZZZZZ.ZZZZZZZZZZZZZ.1000.ZZZZZ.ZZZZ'
                      ,p_element_link_id                      => v_element_link_id
                      ,p_comment_id                               => v_comment_id
                      ,p_object_version_number             => v_object_version_number
                      ,p_effective_start_date               => v_effective_start_date
                      ,p_effective_end_date                    => v_effective_end_date
                end loop;
              end create_element_link;
              • 4. Re: Can we customize costing Process?
                First i want to say thanks for you comprehensive support.

                I am going to amend script as per our structure, but i am little confuse passing list of segment. we have chart-Of-Account up to 6 Segments and have enabled Company and Natural Account at Costing Level. However, For balancing only Natural account appeared.

                What about rest of segments should i pass as null or not include in scripts.

                • 5. Re: Can we customize costing Process?
                  Giuseppe Bonavita
                  You are very welcome especially if you mark my replies as correct or helpful as appropriate.

                  Regarding the other segment, I beleive you should be able to pass null for the other segments.
                  the concatenated structure should be derived accordingly.