Condition Group Routines

Hello,
I was asked by my functional analyst to implement the ABAP code for the following scenario:
A header pricing condition type's amount, say ZHDR, needs to be populated by the largest amount found in certain item pricing condition type (say all ZDTL conds) on all items within a sales order.
Is the solution for this condition group routines?
Thanks,
John

Hi,
This depends on your requirement. If you have defined the condition at the material pricing group level, then no need. The routine is used only if you want the condition to be read differently for each item (with the scale base value being total of all the items).
You can find some help in the below link:
http://help.sap.com/saphelp_erp2005/helpdata/en/de/7a8534c960a134e10000009b38f83b/frameset.htm
There are some helpful SAP Notes if you need further clarifications:
39034     Group condition routine
854978     Function of cumulated scale base values (in SD)
109708     Scale processing for group conditions
Hope this helps.
Regards
Nikhilesh

Similar Messages

  • PR/ Sales order value not coming in condition value routine

    As per the requirement while creating a PO I need to add a new condition type and need to calculate condition price for this newly added condition based on some matrix.
    For this requirement PO will always be created with reference to PR and with account assignment category as 'E' .
    (Hence sales order number /item will be copied from PR to PO in account assignment tab  )
    Now I have created a new pricing requirement routine ( To add the condition type ) and new condition routine to calculate and update the price.
    These routines are working fine if i check them with hard coded price values.
    But the problem is that I need the PR number(which we put in item overview ) / Sales order item number (from account assignment ). these values are not coming in pricing tables in the routine...structure EKPO come blank, KOMP-AUBEL is also blank).
    Please give your suggestions how i can i get PR/ SO in the condition values routine .
    Please reply

    resolved my self

  • Conditional GROUP BY

    Hi
    I need a SQL report to conditionally display fields based on the value of a bind variable.
    I can achieve this via the interactive reports feature conditional display but I need to remove the GROUP BY for that field at the same time.
    How can I have a conditional GROUP BY clause based a value of a bind variable?
    Regards
    Adam

    >
    If :SHOW_FIELD3 was NOT 'TRUE' then what would
    the statement GROUP BY??? ...The statement would group by field1 and field2 in that case.
    test@ora>
    test@ora> var FIELD1_SHOW varchar2(5)
    test@ora> var FIELD2_SHOW varchar2(5)
    test@ora> var FIELD3_SHOW varchar2(5)
    test@ora>
    test@ora> exec :FIELD1_SHOW := 'TRUE';
    PL/SQL procedure successfully completed.
    test@ora> exec :FIELD2_SHOW := 'TRUE';
    PL/SQL procedure successfully completed.
    test@ora> exec :FIELD3_SHOW := 'FALSE';
    PL/SQL procedure successfully completed.
    test@ora>
    test@ora> --
    test@ora> with t as (
      2    select 'true' as f1, 'true' as f2, 'true' as f3, 1 as num from dual union all
      3    select 'true', 'true',  'true',  2  from dual union all
      4    select 'true', 'false', 'true',  9  from dual union all
      5    select 'true', 'false', 'true',  10  from dual union all
      6    select 'true', 'true',  'false', 20 from dual union all
      7    select 'true', 'true',  'false', 21 from dual)
      8  --
      9  select
    10    decode(:FIELD1_SHOW, 'TRUE', f1) as f1,
    11    decode(:FIELD2_SHOW, 'TRUE', f2) as f2,
    12    decode(:FIELD3_SHOW, 'TRUE', f3) as f3,
    13    sum(num) as total
    14  from t
    15  group by decode(:FIELD1_SHOW, 'TRUE', f1),
    16           decode(:FIELD2_SHOW, 'TRUE', f2),
    17           decode(:FIELD3_SHOW, 'TRUE', f3);
    F1   F2    F3         TOTAL
    true false               19
    true true                44
    test@ora>
    test@ora>which is the same as:
    test@ora>
    test@ora> --
    test@ora> with t as (
      2    select 'true' as f1, 'true' as f2, 'true' as f3, 1 as num from dual union all
      3    select 'true', 'true',  'true',  2  from dual union all
      4    select 'true', 'false', 'true',  9  from dual union all
      5    select 'true', 'false', 'true',  10  from dual union all
      6    select 'true', 'true',  'false', 20 from dual union all
      7    select 'true', 'true',  'false', 21 from dual)
      8  --
      9  select f1, f2, sum(num) as total
    10  from t
    11  group by f1,f2;
    F1   F2         TOTAL
    true false         19
    true true          44
    test@ora>
    test@ora>with the exception of field3 being SELECTed and shown as NULL.
    isotope

  • Condition value routine getting value zero at header level.

    Hi Gurus,
    I am trying to create one condition value routine in which I am passing xkwert = ( wa_vbap-cmpre * komp-mglme ) / 1000.
    The condition works fine at item level where I get condition value as desired but at the header level, where it should show sum for all line items, it is showing 0. When I debugged, I found that somewhere in standard program, where it sums for line item, it is changing to negative and that is why it is getting zero but I was not able to correct it.
    I am writing the code as follows.
    DATA: wa_tab TYPE c LENGTH 1000,
          I_VBAP TYPE STANDARD TABLE OF VBAP,
          lv_komv like xkomv,
          WA_VBAP TYPE VBAP.
    FIELD-SYMBOLS <f1> TYPE ANY TABLE.
      UNASSIGN <f1>.
    wa_tab = '(SAPMV50A)XVBAP[]'.
    ASSIGN (wa_tab) TO <f1>.
    IF sy-subrc = 0.
       i_vbap[] = <f1>.
    ENDIF.
    READ TABLE i_vbap INTO wa_vbap WITH KEY posnr = komp-kposn.
    IF sy-subrc = 0.
       xkwert = ( wa_vbap-cmpre * komp-mglme ) / 1000.
       CLEAR wa_vbap.
    ENDIF.
    CLEAR: I_VBAP,
            lv_komv.
    What should I do? please help.
    Regards,
    Manish

    I found the solution.
    If xkwert is initial.
    xkwert = gkomv-xkwert.
    endif.
    Regards,
    Manish

  • Condition Groups in Contracts

    Hi,
    Is it possible to default few condition types in contracts transaction types in CRM under the Sales Agreeement tab?
    The issue is that, there is a condition group assiged to the transaction type instead of pricing procedure.
    Can some one help me to get the some default condition types?
    Regards
    Kamalesh

    Hi,
    Did n't really get the scenerio & problem? could you elaborate little more? What conditions & condition group is being used under the tab you mentioned?
    you can control the customizing of conditions & condition group visible in a TR in SPRO. Try following:
    1. check condition group being used to the application SAP CRM in SPRO > Customer Relationship Management> Master Data> Products> Special Settings for Sales Operations--> Assign Condition Group to Application CRM
    2.Assign the condition types in your pricing procedure to the above condition group by choosing SPRO>Customer Relationship Management> Master Data --> Conditions and Condition Technique --> Condition Technique: Basics Create Maintenance Group
    Let me know if this works....!!
    Best Regards,
    VIshant Jain

  • Condition Base Routine not transported properly

    Hi Gurus,
    I have created a Condition base Routine (For e.g 602) in T.code: <b>VOFM</b>
    and written logic for Round off which is as follows.
    <b>
    FORM FRM_KONDI_WERT_602.
    *{   INSERT         DEVK905117                                        1
    CALL FUNCTION 'J_1I6_ROUND_TO_NEAREST_AMT'
      EXPORTING
        I_AMOUNT                 = xkomv-kwert
    IMPORTING
       E_AMOUNT                  = xkomv-kwert.
      modify table xkomv transporting kwert.
      xkwert   = xkomv-kwert.
    *}   INSERT
    ENDFORM.</b>
    While creating it, it prompted for an accesskey. I given it and requested created.
    The problem is the INCLUDE program is not appearing inside another program
    <b>SAPLV61A</b>
    How to include that INCLUDE program.
    Please help.
    Regards,
    Anbu

    Hi,
    Have you activated the routine through  program RV80HGEN.
    In SE38 run this program to activate the routine.
    Reward points if useful
    Regards,
    Amrish Purohit

  • What is the Procedure to Create "Condition Value" Routine Using VOFM

    Dear Guru,
    I want to know Step-By-Step Procedure to Create "Condition Value" Routine Using VOFM.
    Give me guideline how it will link to program RV64ANNN.
    and if it doesnot link to RV64ANNN
    what might be the possible reason and how to make it link with RV64ANNN.

    Dear Guru.
    I have encountered a technical issue related to Creation of User Routine for pricing procedure
    (Routine :: RV64A978).
    Before coming to issue I want to give you slight glance on my requirement.
    I have got two requirements to write two routines for a new condition type -->> packing type .
    >>Routine Number  One First  I Have wrote  Requirement Routine         RV61A943
    Routine Number two  Other I Have wrote  calculate condition value  RV64A978
    So as usual normal procedure of writing a routine I followed VOFM for writing routine for pricing procedure and routine for calculation (condition value).
    I performed above respective process for both routines in VOFM.
    And I have activated both routine from going VOFMMenu bar edit  Activate.
    After activation automatic include is generated in both case .
    INCLUDE RV61A943 .  "FAMD PAckage Wt        
    Is generated in RV61ANNN
    INCLUDE RV64A978 .  "FAMD Package-Rate     
    Is generated in RV64ANNN
    In case of Routine  RV61A943
    I can able to find the main include routine RV61ANNN from where used function in SE38 and able to trace it.        
    And I am able to find it in the lists of Includes of RV61ANNN.
    But In case of Routine  RV64A978
    I can not able to find the main include routine RV64ANNN from where used function and able to trace it. Pls refer below picture.
    But in RV64ANNN it is showing that routine RV64A978 is there 
    So Guru I want to know following things >
    1.     What might be the main reason in case of RV64A978 ??
    2.     How I should approach to solve this issue??
    Because what I understood unless routine RV64A978 is traceable  from u201Cwhere usedu201D to find out its main routine RV64ANNN , the routine RV64A978 wont work in pricing procedure (I believe).

  • Automatic determination of condition group

    Hi
    My client has the following requirement:
    - For 3rd party items, in few situations we might have to supply the items immediately.
    - In such situations we request our supplier to supply the item directly to the customer (instead of bringing the item into our plant and then shipping)
    - In the existing sales orders we change the item category of the item from ZTAN to ZTAS (3rd party item).
    Customer wants to have automatic determination of the condition group 2 field at the item level (to some specified CG2 values) whenever we have the change in the item category.
    Let me know how we can do this.
    Regards
    Jagadish

    Hi Jagadish,
    The field Condition group 2 will be depend upon the Customer not based on the Material or Item or itemcategory,
    So I dodn't think system will change the data in this field when you change itemcategory alone.
    If you change the customer it will change accordingly
    I hope it will help you,
    Regards,
    Murali.
    Edited by: Murali Mohan.Tallapaneni on Jul 12, 2008 6:37 AM

  • Condition Groups in Purchase info record

    Hi SAP Folks
    Can you please in undertsanding the usage of the Field : Condition Groups in Purchase info record .
    How can this be used and what are the required set up to be done  in the system.
    We are SAP ECC 6.0
    Thanks for the help.
    Achu

    Hi,
    Click F1 on field Cond. Grp which gives the infomation about the Condition groups.
    Check  links : http://help.sap.com/saphelp_47x200/helpdata/en/75/ee1fa755c811d189900000e8322d00/frameset.htm
    Condition group comes under strategic sourcing and it is used to group together vendor  & mass changes for vendor masters.
    e.g to change tax condition for certain group. Check the T-code MEKG.
    Hope it will help U...
    Regards
    Vikrant

  • Conditional GROUP BY clause

    Hi,
    I have four columns in group by clause. I want to add conditional group by clause.
    Case 1 : If one of the  column's value is null, I don't want to include it in group by clause. Means, Now GROUP BY clause will have only 3 columns.
    Case 2 : If not null, then GROUP BY clause with all four columns.
    Please help me out on this.
    Thanks in advance.  

    Hi
    I think it won't matter, all group functions by default ignore NULLs so your result won't differ.
    select  dept, loc, sum(sal)
    from (
    select 'A' emp , 1 dept , 'P' loc , 100 sal from dual union all
    select'B',1,'P',200 from dual union all
    select'C',2,'P',300 from dual union all
    select'D',2,'P',400 from dual union all
    select'E',3, 'P',500 from dual union all
    select'F',3, 'P',600 from dual union all
    select'G',4, 'Q',700 from dual union all
    select'H', null,'Q' , 1000 from dual union all
    select'I',null ,'Q', 2000 from dual union all
    select 'J' ,null, 'Q',300 from dual)
    group by dept,loc;
    Output
    DEPT      LOC      SUM(SAL)
    1                P      300
    2                P      700
    3                P      1100
                    Q      3300
    4                Q      700
    Now by doing grouping only for NOT NULL values,
    select dept,loc, sum(sal)
    from (
    select 'A' emp , 1 dept , 'P' loc , 100 sal from dual union all
    select'B',1,'P',200 from dual union all
    select'C',2,'P',300 from dual union all
    select'D',2,'P',400 from dual union all
    select'E',3, 'P',500 from dual union all
    select'F',3, 'P',600 from dual union all
    select'G',4, 'Q',700 from dual union all
    select'H', null,'Q' , 1000 from dual union all
    select'I',null ,'Q', 2000 from dual union all
    select 'J' ,null, 'Q',300 from dual)
    where dept is not null          --------------NOT NULL Condition
    group by dept, loc;
    Output
    DEPT     LOC      SUM(SAL)
    1           P           300
    2           P           700
    3           P           1100
    4           Q           700
    Now by doing grouping only for NULL values,
    select dept,loc, sum(sal)
    from (
    select 'A' emp , 1 dept , 'P' loc , 100 sal from dual union all
    select'B',1,'P',200 from dual union all
    select'C',2,'P',300 from dual union all
    select'D',2,'P',400 from dual union all
    select'E',3, 'P',500 from dual union all
    select'F',3, 'P',600 from dual union all
    select'G',4, 'Q',700 from dual union all
    select'H', null,'Q' , 1000 from dual union all
    select'I',null ,'Q', 2000 from dual union all
    select 'J' ,null, 'Q',300 from dual)
    where dept is null               --------------NULL Condition
    group by dept, loc;
    Output
    DEPT      LOC         SUM(SAL)
                    Q           3300
    The output is same for both the conditions.

  • Condition group in Sales order

    Hi Experts,
    I need help in maintaining the <b>condition group 1</b> value in tab <b>additional dataA</b>  in sales order item level. Right now we are getting the values based on the sold to customer of the sales order but we need it based on the ship to customer.
    Even a way to approach it will be really appreciated.
    Thanks,
    Surya

    Hi,
    You can proceed as follows:
    Procedure for copying customer master fields to a sales document
    Copying customer master fields to a sales document is carried out in two steps:
    1. A field in the customer master table (KNA1 or KNVV) is first copied by INCLUDE (KUAGVZ, KUWEVZ, KURGVZ and KUREVZ) to the sold-to party, ship-to party or payer view (KUAGV, KUWEV, KURGV or KUREV). A value is assigned to the field via a user exit (V05...).
    2. The field is copied to the sales order table (VBAK, VBKD or VBAP) from the respective customer view (KUAGV, KUWEV, KURGV or KUREVZ). A value is assigned to the field via a user exit in program MV45AFZZ (USEREXIT_MOVE_...).
    In your case it will be:
    The following communication structures are relevant for using customer master record fields in SD documents:
    KUWEV (Ship-to party view of customer master record)
    Transport from customer view to the sales document table
    USEREXIT_MOVE_FIELD_TO_VBAP
    Regards
    Shounak

  • Increasing condition groups for a customer

    Hi all,
    There is a business requirement wherein a customer needs to be associated with more than 5 condition groups configurable in customer master data under extra (additional data) settings.  Since SAP has a limitation of  only 5 condition groups, I am not sure how can this requirement be met without undertaking a Z enhancement. Is there any other way/method in SAP by which this objective can be achieved?
    Would be greatful if anyone could share their experience on the same.
    Thanks
    Aashish

    hi,
    that means there are only 5 customer groups in standard SAP.
    if you want to increase you can do it technically only by capturing the program name.
    SAPLV02Z, screen number 0200.
    i think you have to for screen modification.
    other than this there is no any alternative.
    balajia

  • Please provide Solution for Customer Condition Group when defining 2 Chrt's

    Dear Guru's,
    Please provide Solution for Customer Condition Group when defining 2 Charecters or 2 digits.
    I have Completed all possible Combinations like AA,BA,1A,A1,01 to 99 etc.. Total Enteries reach upto 1200+ so I am unble to find no more Combinations( without Special Characters & no chance to increase other than 2 Char/digt)..
    Any body Suggest me any Good Combinations or Proper Alternative....
    Thanks,
    Panduranga

    Hi panduranga
    A Customer Condition Group is maintained in only 2 digits .If you want to go for more than 2 digits then you need to take the help of ABAP'er and you need to go for enhancement
    Regards
    Srinath

  • Customer condition group 1 - 5 on VF02/VF03???

    Hi folks
    In the invoice position table - VBRP - we have the Customer condition group fields (1-5) But unfortunally I can't see them in the trabnsaction VF02/VF03!
    How or what to do?
    Best regards
    Carsten

    Hi
    At item level, you have see the additional data of the reference sales order at the item level.. You can see that in Additional Data1 of the item.
    Reward if this helps.

  • Group Condition types & routines - pricing

    Do we have to code the group condtion routines all the time? If I just have the group condition box checked without any routine coded, I am seeing that SAP is grouping all the items in the sales order using the same access. Please let me know. Thanks.

    Hi,
    This depends on your requirement. If you have defined the condition at the material pricing group level, then no need. The routine is used only if you want the condition to be read differently for each item (with the scale base value being total of all the items).
    You can find some help in the below link:
    http://help.sap.com/saphelp_erp2005/helpdata/en/de/7a8534c960a134e10000009b38f83b/frameset.htm
    There are some helpful SAP Notes if you need further clarifications:
    39034     Group condition routine
    854978     Function of cumulated scale base values (in SD)
    109708     Scale processing for group conditions
    Hope this helps.
    Regards
    Nikhilesh

Maybe you are looking for