Getting aggregated values on disaggregated level...

Hi all,
For example I have the following selection in my query:
Query 1.
City     Store     Item     Sales @ UOM
City1     Store 1     Item1     100
          Item2     150
     Store 2     Item1     200
          Item2     125
Item sales quantity on the City level will be the following:
Query 2.
City     Item     Sales @ UOM
City1     Item1     300
     Item2     275
And I need to use this data in the first query, so I could access the aggregated city sales data in each disaggregated row, like this:
Query 3.
City     Store     Item     Sales @ UOM     Sales @ UOM (City lvl)
City1     Store 1     Item1     100          300
          Item2     150          275
     Store 2     Item1     200          300
          Item2     125          275
Does anyone have an idea how this could be achieved?
I've already tried restricted and calculated key figures, and it seems that this isn't an option in this case...
Thanks.
Best regards,
Andrey

Hi Andrey,
I have tried the same at my end. And yes you are right. It is coming as you have showed here.
But i have tried the same requirement around a year back and I had achieved it, unfortunately I am not able to completely recall the same.
However there is one way which you can achieve a similar display.
You could view the report to this level
City     Item     Store     Sales @ UOM     Sales @ UOM (City lvl)
City1     Item 1     Store1     100          300
          Store2     200          300
     Item 2     Store1     150          275
          Store2     125          275
You can achieve the above display by doing the below
for the second key figure (city level) - use formula (sumct (base KF) )
With this we will get the above view, but one disadvantage is we have to let the result rows for "store" be displayed. If it is removed the second KF will change.
But I am still trying at my end and will let you know as soon as I figure it out.
Regards,
Joe

Similar Messages

  • How to get aggregation at Year-Month level??

    Hi experts,
    I've Date and Qty column in rpd. I've created the aggregated column in rpd with Sum aggregation (Sum Qty)
    My report is coming in this format..
    Date...........Sum(qty)
    1/1/2009..........5
    1/2/2009..........4
    1/6/2009..........10
    2/3/2009.........2
    2/4/2009..........6
    But I need the report like this....
    Year-Mon.........Sum(qty)
    2009-01-----------19
    2009-02-----------8
    Please help

    hi bob,
    1) Create a logical column yyyy/mm format using date col
    CAST ( EXTRACT( YEAR  FROM "Sample".""."Samplesales"."Dim-Date"."Start Date") AS CHARACTER ( 4 )) || '/' ||  CASE  WHEN  EXTRACT( MONTH  FROM "Sample".""."Samplesales"."Dim-Date"."Start Date") BETWEEN 10 AND 12 THEN  CAST ( EXTRACT( MONTH  FROM "Sample".""."Samplesales"."Dim-Date"."Start Date") AS CHARACTER ( 2 )) ELSE '0' ||  CAST ( EXTRACT( MONTH  FROM "Sample".""."Samplesales"."Dim-Date"."Start Date") AS CHARACTER ( 1 )) END
    2) Set the aggregate/content level to this column (yyyy/mm) format to the fact table
    thanks,
    saichand.v

  • Price Value  getting  aggregated

    Hey  everyone...
        Here  is  my  scenario...
    I'm   having  a  report  of  inventory  value by  material group  and storage  location...
    Matgrp                     Qty        Value               Total
      1
      Material       10        3                 5                    15
      Material        20        5                7                    35
                                                                             50
    Instead  of  the  total  showing  as  50  ,  I'm  getting   (35)*(57)= 8*12=96.  for  the  material  grp 1.
    I'm  not  showing  the  materials  on the  report...
    No, I'm not  having aggregation on the  CKF's  as After  Aggregation.
    Please  help me  out...
    any  suggestions/pointers...
    Thanks  for  your  time..
    /Travis

    Ok....sorry  for  not  able  to  explain it  better...
    Here  si  the  scenario...
    I  have  2 materials  under a  Mat  grp
    Material1  with qty 3 value 5/material  which makes  my total value @ 15 for  material1
    Material2  with qty  5 value 7/material  which makes  my total value @  35 for  material2.
    When  I have  a  report  at  Material Grp  level
    I'm  getting  the  value  as
    Matgrp  with qty 8 value 12  and  making the  total 96.  which  is  wrong. The  total  shld  be  50.
    I'm missing a  restriction  somewhere or  sth  minor....I'm not  able  to  figure out.....
    any  suggestions/pointers.
    Thanks
    /t

  • Part cost   kf values are getting aggregated ......... can any one help me?

    hello gurus....
    iam designing a infocube in which there is a keyfigure 'partcost'.when i execute a query on this infocube, the part cost values  for a particular part id are getting summed up. but the part cost ,whether for single or 100's of parts ,should be the same.
       i dont want these part cost values in the query to be aggregated.  what i should do now. declare this part cost as non cumulative kf or is there any solution for this ?
      i have gone thru the sap help site, but unable to find a solution for this?
       how to declare it as a non cumulative kf ?
      can any one suggest me a with some detailed steps what should be done for this? very urgent . my project deadline is with in 2 days. i will be really thankful to u..

    Hi Lokesh,
          Pls check your post in BI General. part cost  kf values are getting aggregated ......... can any one help me?
    Regards
    Hari
    Message was edited by: Hari Krishnan K

  • Need to get profile value defined at responlibility level

    Hi I have a procedure which have to get the profile value defind at responsibility level.
    I will be passing resp id as in parameter to that procedure.
    The thing here is, I will not be creating a concurrent program for this. And this procedure will be accessed by some other application by connecting to apps database and executing
    SO this is completly a procedure which is runned from back end.
    Now to get that profile value I used
    fnd_profile.value_specific('XXPROFILE',NULL,RESP_ID,NULL,NULL,NULL)
    BUt it is not getting any value.
    Please let me know for any other solutions.
    Thanks

    Hi;
    Please check below which could be helpful for your issue:
    How To Set A System Profile Value Without Logging In To The Applications [ID 364503.1]
    Script To List The Values Of A Profile Option At All Levels [ID 803587.1]
    How to Change Profile Option Value Without Forms [ID 943710.1]
    Regard
    Helios

  • Is there an FM by which we can get condition record values at header level

    Hi All,
    Please help Is there an FM by which we can get condition record values at header level.
    Thanks,
    Gaurav Mittal

    Hi
    There is no exact FM for this
    Take the Header level condition number from the doc (KNUMV) and pass to the KONV-KNUMV and take the respective Header level amounts(KWERT) from it based on Condition Typse (KSCHL)
    we use VBAK-KNUMV(for SO leve ol)r VBRK-KNUMV(for Billing Doc's) or EKKO-KNUMV (for PO's) to get the record values from KONV
    Regards
    Anji

  • How to format the report with the aggregated value

    Hi,
    I have 2 characteristics and 3 KFs in the infocube.
    First field is Cost Center
    Second field is creation Date
    3rd field is KF1
    4th field is KF2
    5th field is KF3
    I have put the date field( in the row) as this is required for calculating formula for KFs. But I have set that as No display.
    The date in the info cube is as follows.
    Cost Ceneter  Date( no Display)   KF1     KF2      KF3
    CC1           01/01/2006          100     150      200
    CC1           02/02/2006          75      100      95
    CC1           05/02/2006          125      95      125
    CC2           01/02/2006          75       25      85
    CC2           02/02/2006          85       65      10
    As the Date field is in query set to No display so the date appearing in the report is as follows
    CC1       100        150        200
              75         100        95
              125          95        125
    CC2       75           25        85
              85           65        10
    But I want the aggregated value at cost senter level i.e.
    CC1       300         245       420
    CC2       160         90         95
    I can not remove the Date frield from query as there is a formula variable defined on the date field.
    Please let me know how to bring the report to the required format.
    Bill
    Message was edited by:
            Bill Bryan

    If you are in new Bex, you can do it.
    You will have to create another (set of) CKF on top of the current ones (which do exception aggregation on DOCNUM) and set the exception aggregation on date.
    Say you have
    CH1--CH2CH3--CKF1
    To have a 'before aggregation' behavior for CKF1 when CH3 is not present, you will create a CKF2 = CKF1 with exception aggregation on CH3.
    Now, if you want to remove CH2 and have the 'before aggregation' behavior you will need to create another CKF3 = CKF2 with exception aggregation on CH2.
    ie for each level of aggregation, you will have to define a new CKF/Formula with corresponding exception aggregation - this is what will be needed to get you your output.
    Message was edited by:
            Ajay Das

  • To get  node value in a tree

    I have a tree with 3 level and it is working fine.. In view mode I need the First child value of the 3rd level with out clicking / Selecting from teh Tree node..
    for eg;
    A -- ist level
    Ap -- 2nd level
    Apple -- 3rd level
    So What I need is that I should get a message 'Apple' While landing teh Form itself without clicking on teh Tree
    Thanks in Advance...

    To my knowledge it is not possible to get the value of a node which is not selected.
    What you have to do is to build up a memory structure similar to your tree, then you can access any node at any time.
    Peter

  • NullPointerException - Cannot get the value from variable f_cashGiven

    In SubCheckout.java (a POS), what I want is when Payment button (f_cashPayment) is pressed, the action "Cash" is performed, get the value from Cash Given (f_cashGiven), do the subtraction and post the value as Cash Return (f_cashReturn). The code is filled in actionPerformed. But I cannot get the value by using f_cashGiven.getValue() from VNumber class. It returns NULL. This should be quite straight forward, but I do not know what is wrong. Please help!
    Enclosed please find the source code of SubCheckout.java and VNumber.java
    This is the code of SubCheckout.java :
    * The contents of this file are subject to the   Compiere License  Version 1.1
    * ("License"); You may not use this file except in compliance with the License
    * You may obtain a copy of the License at http://www.compiere.org/license.html
    * Software distributed under the License is distributed on an  "AS IS"  basis,
    * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
    * the specific language governing rights and limitations under the License.
    * The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial
    * Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke
    * are Copyright (C) 1999-2005 Jorg Janke.
    * All parts are Copyright (C) 1999-2005 ComPiere, Inc.  All Rights Reserved.
    * Contributor(s): ______________________________________.
    package org.compiere.pos;
    import java.awt.*;
    import java.awt.event.*;
    import java.math.BigDecimal;
    import javax.swing.border.*;
    import org.compiere.grid.ed.*;
    import org.compiere.swing.*;
    import org.compiere.util.*;
    *     POS Checkout Sub Panel
    *  @author Jorg Janke
    *  @version $Id: SubCheckout.java,v 1.3 2005/03/11 20:28:22 jjanke Exp $
    public class SubCheckout extends PosSubPanel implements ActionListener
          *      Constructor
          *     @param posPanel POS Panel
         public SubCheckout (PosPanel posPanel)
              super (posPanel);
         }     //     PosSubCheckout
         private CButton f_register = null;
         private CButton f_summary = null;
         private CButton f_process = null;
         private CButton f_print = null;
         private CLabel f_lcreditCardNumber = null;
         private CTextField f_creditCardNumber = null;
         private CLabel f_lcreditCardExp = null;
         private CTextField f_creditCardExp = null;
         private CLabel f_lcreditCardVV = null;
         private CTextField f_creditCardVV = null;
         private CButton f_cashPayment = null;
         private CLabel f_lcashGiven = null;
         private VNumber f_cashGiven = null;
         private CLabel f_lcashReturn = null;
         private VNumber f_cashReturn = null;
         private CButton f_creditPayment = null;
         /**     Logger               */
         private static CLogger log = CLogger.getCLogger(SubCheckout.class);
          *      Initialize
         public void init()
              //     Title
              TitledBorder border = new TitledBorder(Msg.getMsg(Env.getCtx(), "Checkout"));
              setBorder(border);
              //     Content
              setLayout(new GridBagLayout());
              GridBagConstraints gbc = new GridBagConstraints();
              gbc.insets = INSETS2;
              //     --     0
              gbc.gridx = 0;
              f_register = createButtonAction("Register", null);
              gbc.gridy = 0;
              add (f_register, gbc);
              f_summary = createButtonAction("Summary", null);
              gbc.gridy = 1;
              add (f_summary, gbc);
              f_process = createButtonAction("Process", null);
              gbc.gridy = 2;
              add (f_process, gbc);
              f_print = createButtonAction("Print", null);
              gbc.gridy = 3;
              add (f_print, gbc);
              //     --     1 -- Cash
              gbc.gridx = 1;
              gbc.gridheight = 2;
              gbc.fill = GridBagConstraints.BOTH;
              gbc.weightx = .1;
              CPanel cash = new CPanel(new GridBagLayout());
              cash.setBorder(new TitledBorder(Msg.getMsg(Env.getCtx(), "Cash")));
              gbc.gridy = 0;
              add (cash, gbc);
              GridBagConstraints gbc0 = new GridBagConstraints();
              gbc0.insets = INSETS2;
              gbc0.anchor = GridBagConstraints.WEST;
              f_lcashGiven = new CLabel(Msg.getMsg(Env.getCtx(),"CashGiven"));
              cash.add (f_lcashGiven, gbc0);
              f_cashGiven = new VNumber("CashGiven", false, false, true, DisplayType.Amount,
                   Msg.translate(Env.getCtx(), "CashGiven"));
              f_cashGiven.addActionListener(this);
              f_cashGiven.setColumns(10, 25);
              cash.add (f_cashGiven, gbc0);
              f_cashGiven.setValue(Env.ZERO);
              f_lcashReturn = new CLabel(Msg.getMsg(Env.getCtx(),"CashReturn"));
              cash.add (f_lcashReturn, gbc0);
              f_cashReturn = new VNumber("CashReturn", false, true, false, DisplayType.Amount,
                   "CashReturn");
              f_cashReturn.setColumns(10, 25);
              cash.add (f_cashReturn, gbc0);
              f_cashReturn.setValue(Env.ZERO);
              f_cashPayment = createButtonAction("Payment", null);
              f_cashPayment.setActionCommand("Cash");
              gbc0.anchor = GridBagConstraints.EAST;
              gbc0.weightx = 0.1;
              cash.add (f_cashPayment, gbc0);
              //     --     1 -- Creditcard
              CPanel creditcard = new CPanel(new GridBagLayout());
              creditcard.setBorder(new TitledBorder(Msg.translate(Env.getCtx(), "CreditCardType")));
              gbc.gridy = 2;
              add (creditcard, gbc);
              GridBagConstraints gbc1 = new GridBagConstraints();
              gbc1.insets = INSETS2;
              gbc1.anchor = GridBagConstraints.WEST;
              gbc1.gridx = 0;
              gbc1.gridy = 0;
              f_lcreditCardNumber = new CLabel(Msg.translate(Env.getCtx(), "CreditCardNumber"));
              creditcard.add (f_lcreditCardNumber, gbc1);
              gbc1.gridy = 1;
              f_creditCardNumber = new CTextField(18);
              creditcard.add (f_creditCardNumber, gbc1);
              gbc1.gridx = 1;
              gbc1.gridy = 0;
              f_lcreditCardExp = new CLabel(Msg.translate(Env.getCtx(),"CreditCardExp"));
              creditcard.add (f_lcreditCardExp, gbc1);
              gbc1.gridy = 1;
              f_creditCardExp = new CTextField(5);
              creditcard.add (f_creditCardExp, gbc1);
              gbc1.gridx = 2;
              gbc1.gridy = 0;
              f_lcreditCardVV = new CLabel(Msg.translate(Env.getCtx(), "CreditCardVV"));
              creditcard.add (f_lcreditCardVV, gbc1);
              gbc1.gridy = 1;
              f_creditCardVV = new CTextField(5);
              creditcard.add (f_creditCardVV, gbc1);
              gbc1.gridx = 3;
              gbc1.gridy = 0;
              gbc1.gridheight = 2;
              f_creditPayment = createButtonAction("Payment", null);
              f_creditPayment.setActionCommand("CreditCard");
              gbc1.anchor = GridBagConstraints.EAST;
              gbc1.weightx = 0.1;
              creditcard.add (f_creditPayment, gbc1);
         }     //     init
          *      Get Panel Position
         public GridBagConstraints getGridBagConstraints()
              GridBagConstraints gbc = super.getGridBagConstraints();
              gbc.gridx = 0;
              gbc.gridy = 3;
              return gbc;
         }     //     getGridBagConstraints
          *      Dispose - Free Resources
         public void dispose()
              super.dispose();
         }     //     dispose
          *      Action Listener
          *     @param e event
         public void actionPerformed (ActionEvent e)
              String action = e.getActionCommand();
              if (action == null || action.length() == 0)
                   return;
              log.info( "PosSubCheckout - actionPerformed: " + action);
              if (e.getSource() == f_cashGiven) {
                   f_cashGiven.setValue(f_cashGiven.getValue());
                   System.out.println("f_cashGiven"+f_cashGiven.getDisplay());
              //     Register
              //     Summary
              //     Print
              if (action.equals("Cash")) {
                   BigDecimal CashGiven, GrandTotal, CashReturn;
                   System.out.println("Cash given is "+f_cashGiven.getDisplay());
                   CashGiven = (BigDecimal)f_cashGiven.getValue();
                   GrandTotal = (BigDecimal)p_posPanel.f_curLine.getOrder().getGrandTotal();
                   CashReturn = CashGiven.subtract(GrandTotal);
                   f_cashReturn.setValue(CashReturn);
              //     Cash (Payment)
              //     CreditCard (Payment)
         }     //     actionPerformed
    }     //     PosSubCheckoutThis is the code of VNumber.java :
    * The contents of this file are subject to the   Compiere License  Version 1.1
    * ("License"); You may not use this file except in compliance with the License
    * You may obtain a copy of the License at http://www.compiere.org/license.html
    * Software distributed under the License is distributed on an  "AS IS"  basis,
    * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
    * the specific language governing rights and limitations under the License.
    * The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial
    * Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke
    * are Copyright (C) 1999-2005 Jorg Janke.
    * All parts are Copyright (C) 1999-2005 ComPiere, Inc.  All Rights Reserved.
    * Contributor(s): ______________________________________.
    package org.compiere.grid.ed;
    import java.awt.*;
    import java.awt.event.*;
    import java.beans.*;
    import java.math.*;
    import java.text.*;
    import java.util.logging.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import org.compiere.apps.*;
    import org.compiere.model.*;
    import org.compiere.swing.*;
    import org.compiere.util.*;
    *     Number Control
    *      @author      Jorg Janke
    *      @version      $Id: VNumber.java,v 1.41 2005/09/03 01:57:16 jjanke Exp $
    public final class VNumber extends JComponent
         implements VEditor, ActionListener, KeyListener, FocusListener
         /**     Number of Columns (12)          */
         public final static int SIZE = 12;
          *  IDE Bean Constructor
         public VNumber()
              this("Number", false, false, true, DisplayType.Number, "Number");
         }   //  VNumber
          *     Create right aligned Number field.
          *     no popup, if WindowNo == 0 (for IDs)
          *  @param columnName column name
          *  @param mandatory mandatory
          *  @param isReadOnly read only
          *  @param isUpdateable updateable
          *  @param displayType display type
          *  @param title title
         public VNumber(String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable,
              int displayType, String title)
              super();
              super.setName(columnName);
              m_columnName = columnName;
              m_title = title;
              setDisplayType(displayType);
              LookAndFeel.installBorder(this, "TextField.border");
              this.setLayout(new BorderLayout());
    //          this.setPreferredSize(m_text.getPreferredSize());          //     causes r/o to be the same length
    //          int height = m_text.getPreferredSize().height;
    //          setMinimumSize(new Dimension (30,height));
              //     ***     Text     ***
              m_text.setBorder(null);
              m_text.setHorizontalAlignment(JTextField.TRAILING);
              m_text.addKeyListener(this);
              m_text.addFocusListener(this);
              //     Background
              setMandatory(mandatory);
              this.add(m_text, BorderLayout.CENTER);
              //     ***     Button     ***
              m_button.setIcon(Env.getImageIcon("Calculator10.gif"));
              m_button.setMargin(new Insets(0, 0, 0, 0));
              m_button.setFocusable(false);
              m_button.addActionListener(this);
              this.add (m_button, BorderLayout.EAST);
              //     Prefereed Size
              this.setPreferredSize(this.getPreferredSize());          //     causes r/o to be the same length
              //  Size
              setColumns(SIZE, CComboBox.FIELD_HIGHT-4);     
              //     ReadWrite
              if (isReadOnly || !isUpdateable)
                   setReadWrite(false);
              else
                   setReadWrite(true);
         }     //     VNumber
          *  Dispose
         public void dispose()
              m_text = null;
              m_button = null;
              m_mField = null;
         }   //  dispose
          *     Set Document
          *  @param doc document
         protected void setDocument(Document doc)
              m_text.setDocument(doc);
         }     //     getDocument
         private String               m_columnName;
         protected int               m_displayType;     //  Currency / UoM via Context
         private DecimalFormat     m_format;
         private String               m_title;
         private boolean               m_setting;
         private String               m_oldText;
         private String               m_initialText;
         private boolean               m_rangeSet = false;
         private Double               m_minValue;
         private Double               m_maxValue;
         private boolean               m_modified = false;
         /**  The Field                  */
         private CTextField          m_text = new CTextField(SIZE);     //     Standard
         /** The Button                  */
         private CButton              m_button = new CButton();
         private MField          m_mField = null;
         /**     Logger               */
         private static CLogger log = CLogger.getCLogger(VNumber.class);
          *      Set no of Columns
          *     @param columns columns
         public void setColumns (int columns, int height)
              m_text.setPreferredSize(null);
              m_text.setColumns(columns);
              Dimension size = m_text.getPreferredSize();
              if (height > size.height)               //     default 16
                   size.height = height;
              if (CComboBox.FIELD_HIGHT-4 > size.height)
                   size.height = VLookup.FIELD_HIGHT-4;
              this.setPreferredSize(size);          //     causes r/o to be the same length
              this.setMinimumSize(new Dimension (columns*10, size.height));
              m_button.setPreferredSize(new Dimension(size.height, size.height));
         }     //     setColumns
          *     Set Range with min & max
          *  @param minValue min value
          *  @param maxValue max value
          *     @return true, if accepted
         public boolean setRange(Double minValue, Double maxValue)
              m_rangeSet = true;
              m_minValue = minValue;
              m_maxValue = maxValue;
              return m_rangeSet;
         }     //     setRange
          *     Set Range with min & max = parse US style number w/o Gouping
          *  @param minValue min value
          *  @param maxValue max value
          *  @return true if accepted
         public boolean setRange(String minValue, String maxValue)
              if (minValue == null || maxValue == null)
                   return false;
              try
                   m_minValue = Double.valueOf(minValue);
                   m_maxValue = Double.valueOf(maxValue);
              catch (NumberFormatException nfe)
                   return false;
              m_rangeSet = true;
              return m_rangeSet;
         }     //     setRange
          *  Set and check DisplayType
          *  @param displayType display type
         public void setDisplayType (int displayType)
              m_displayType = displayType;
              if (!DisplayType.isNumeric(displayType))
                   m_displayType = DisplayType.Number;
              m_format = DisplayType.getNumberFormat(displayType);
              m_text.setDocument (new MDocNumber(displayType, m_format, m_text, m_title));
         }   //  setDisplayType
          *     Set ReadWrite
          *  @param value value
         public void setReadWrite (boolean value)
              if (m_text.isReadWrite() != value)
                   m_text.setReadWrite(value);
              if (m_button.isReadWrite() != value)
                   m_button.setReadWrite(value);
              //     Don't show button if not ReadWrite
              if (m_button.isVisible() != value)
                   m_button.setVisible(value);
         }     //     setReadWrite
          *     IsReadWrite
          *  @return true if rw
         public boolean isReadWrite()
              return m_text.isReadWrite();
         }     //     isReadWrite
          *     Set Mandatory (and back bolor)
          *  @param mandatory mandatory
         public void setMandatory (boolean mandatory)
              m_text.setMandatory(mandatory);
         }     //     setMandatory
          *     Is it mandatory
          *  @return true if mandatory
         public boolean isMandatory()
              return m_text.isMandatory();
         }     //     isMandatory
          *     Set Background
          *  @param color color
         public void setBackground(Color color)
              m_text.setBackground(color);
         }     //     setBackground
          *     Set Background
          *  @param error error
         public void setBackground (boolean error)
              m_text.setBackground(error);
         }     //     setBackground
          *  Set Foreground
          *  @param fg foreground
         public void setForeground(Color fg)
              m_text.setForeground(fg);
         }   //  setForeground
          *     Set Editor to value
          *  @param value value
         public void setValue(Object value)
              log.finest("Value=" + value);
              if (value == null)
                   m_oldText = "";
              else
                   m_oldText = m_format.format(value);
              //     only set when not updated here
              if (m_setting)
                   return;
              m_text.setText (m_oldText);
              m_initialText = m_oldText;
              m_modified = false;
         }     //     setValue
          *  Property Change Listener
          *  @param evt event
         public void propertyChange (PropertyChangeEvent evt)
              if (evt.getPropertyName().equals(org.compiere.model.MField.PROPERTY))
                   setValue(evt.getNewValue());
         }   //  propertyChange
          *     Return Editor value
          *  @return value value (big decimal or integer)
         public Object getValue()
              if (m_text == null || m_text.getText() == null || m_text.getText().length() == 0)
                   return null;
              String value = m_text.getText();
              //     return 0 if text deleted
              if (value == null || value.length() == 0)
                   if (!m_modified)
                        return null;
                   if (m_displayType == DisplayType.Integer)
                        return new Integer(0);
                   return Env.ZERO;
              if (value.equals(".") || value.equals(",") || value.equals("-"))
                   value = "0";
              try
                   Number number = m_format.parse(value);
                   value = number.toString();      //     converts it to US w/o thousands
                   BigDecimal bd = new BigDecimal(value);
                   if (m_displayType == DisplayType.Integer)
                        return new Integer(bd.intValue());
                   if (bd.signum() == 0)
                        return bd;
                   return bd.setScale(m_format.getMaximumFractionDigits(), BigDecimal.ROUND_HALF_UP);
              catch (Exception e)
                   log.log(Level.SEVERE, "Value=" + value, e);
              if (m_displayType == DisplayType.Integer)
                   return new Integer(0);
              return Env.ZERO;
         }     //     getValue
          *  Return Display Value
          *  @return value
         public String getDisplay()
              return m_text.getText();
         }   //  getDisplay
          *      Get Title
          *     @return title
         public String getTitle()
              return m_title;
         }     //     getTitle
          *      Plus - add one.
          *      Also sets Value
          *     @return new value
         public Object plus()
              Object value = getValue();
              if (value == null)
                   if (m_displayType == DisplayType.Integer)
                        value = new Integer(0);
                   else
                        value = Env.ZERO;
              //     Add
              if (value instanceof BigDecimal)
                   value = ((BigDecimal)value).add(Env.ONE);
              else
                   value = new Integer(((Integer)value).intValue() + 1);
              setValue(value);
              return value;
         }     //     plus
          *      Minus - subtract one, but not below minimum.
          *      Also sets Value
          *     @param minimum minimum
          *     @return new value
         public Object minus (int minimum)
              Object value = getValue();
              if (value == null)
                   if (m_displayType == DisplayType.Integer)
                        value = new Integer(minimum);
                   else
                        value = new BigDecimal(minimum);
                   setValue(value);
                   return value;
              //     Subtract
              if (value instanceof BigDecimal)
                   BigDecimal bd = ((BigDecimal)value).subtract(Env.ONE);
                   BigDecimal min = new BigDecimal(minimum);
                   if (bd.compareTo(min) < 0)
                        value = min;
                   else
                        value = bd;
              else
                   int i = ((Integer)value).intValue();
                   i--;
                   if (i < minimum)
                        i = minimum;
                   value = new Integer(i);
              setValue(value);
              return value;
         }     //     minus
          *     Action Listener
          *  @param e event
         public void actionPerformed (ActionEvent e)
              log.config(e.getActionCommand());
              if (ValuePreference.NAME.equals(e.getActionCommand()))
                   if (MRole.getDefault().isShowPreference())
                        ValuePreference.start (m_mField, getValue());
                   return;
              if (e.getSource() == m_button)
                   m_button.setEnabled(false);
                   String str = startCalculator(this, m_text.getText(), m_format, m_displayType, m_title);
                   m_text.setText(str);
                   m_button.setEnabled(true);
                   try
                        fireVetoableChange (m_columnName, m_oldText, getValue());
                   catch (PropertyVetoException pve)     {}
                   m_text.requestFocus();
         }     //     actionPerformed
          *     Key Listener Interface
          *  @param e event
         public void keyTyped(KeyEvent e)    {}
         public void keyPressed(KeyEvent e)  {}
          *     Key Listener.
          *          - Escape           - Restore old Text
          *          - firstChange     - signal change
          *  @param e event
         public void keyReleased(KeyEvent e)
              log.finest("Key=" + e.getKeyCode() + " - " + e.getKeyChar()
                           + " -> " + m_text.getText());
              //  ESC
              if (e.getKeyCode() == KeyEvent.VK_ESCAPE)
                   m_text.setText(m_initialText);
              m_modified = true;
              m_setting = true;
              try
                   if (e.getKeyCode() == KeyEvent.VK_ENTER)     //     10
                        fireVetoableChange (m_columnName, m_oldText, getValue());
                        fireActionPerformed();
                   else     //     indicate change
                        fireVetoableChange (m_columnName, m_oldText, null);     
              catch (PropertyVetoException pve)     {}
              m_setting = false;
         }     //     keyReleased
          *     Focus Gained
          *  @param e event
         public void focusGained (FocusEvent e)
              if (m_text != null)
                   m_text.selectAll();
         }     //     focusGained
          *     Data Binding to MTable (via GridController.vetoableChange).
          *  @param e event
         public void focusLost (FocusEvent e)
         //          log.finest(e.toString());
              //     APanel - Escape
              if (e.getOppositeComponent() instanceof AGlassPane)
                   m_text.setText(m_initialText);
                   return;
              try
                   fireVetoableChange (m_columnName, m_initialText, getValue());
                   fireActionPerformed();
              catch (PropertyVetoException pve)     {}
         }   //  focusLost
          *     Invalid Entry - Start Calculator
          *  @param jc parent
          *  @param value value
          *  @param format format
          *  @param displayType display type
          *  @param title title
          *  @return value
         public static String startCalculator(Container jc, String value,
              DecimalFormat format, int displayType, String title)
              log.config("Value=" + value);
              BigDecimal startValue = new BigDecimal(0.0);
              try
                   if (value != null && value.length() > 0)
                        Number number = format.parse(value);
                        startValue = new BigDecimal (number.toString());
              catch (ParseException pe)
                   log.info("InvalidEntry - " + pe.getMessage());
              //     Find frame
              Frame frame = Env.getFrame(jc);
              //     Actual Call
              Calculator calc = new Calculator(frame, title,
                   displayType, format, startValue);
              AEnv.showCenterWindow(frame, calc);
              BigDecimal result = calc.getNumber();
              log.config( "Result=" + result);
              calc = null;
              if (result != null)
                   return format.format(result);
              else
                   return value;          //     original value
         }     //     startCalculator
          *  Set Field/WindowNo for ValuePreference
          *  @param mField field
         public void setField (MField mField)
              m_mField = mField;
              if (m_mField != null
                   && MRole.getDefault().isShowPreference())
                   ValuePreference.addMenu (this, popupMenu);
         }   //  setField
          *      Remove Action Listner
          *      @param l Action Listener
         public void removeActionListener(ActionListener l)
              listenerList.remove(ActionListener.class, l);
         }     //     removeActionListener
          *      Add Action Listner
          *      @param l Action Listener
         public void addActionListener(ActionListener l)
              listenerList.add(ActionListener.class, l);
         }     //     addActionListener
          *      Fire Action Event to listeners
         protected void fireActionPerformed()
              int modifiers = 0;
              AWTEvent currentEvent = EventQueue.getCurrentEvent();
              if (currentEvent instanceof InputEvent)
                   modifiers = ((InputEvent)currentEvent).getModifiers();
              else if (currentEvent instanceof ActionEvent)
                   modifiers = ((ActionEvent)currentEvent).getModifiers();
              ActionEvent ae = new ActionEvent (this, ActionEvent.ACTION_PERFORMED,
                   "VNumber", EventQueue.getMostRecentEventTime(), modifiers);
              // Guaranteed to return a non-null array
              Object[] listeners = listenerList.getListenerList();
              // Process the listeners last to first, notifying those that are interested in this event
              for (int i = listeners.length-2; i>=0; i-=2)
                   if (listeners==ActionListener.class)
                        ((ActionListener)listeners[i+1]).actionPerformed(ae);
         }     //     fireActionPerformed
    }     //     VNumber

    If getValue() returns null, you need to trace the execution of the code and figure out which sequence of code is leading to the return of null. This method looks complex - a lot of if statements. If you do not have a debugger, put System.out.println statements inside the method to figure out what's going on.

  • How to get real value from selectOneChoice with javascript?

    Hi,
    How to get real value from selectOneChoice with javascript? The event.getNewValue() only gets me the index of the selected item, not the value/title.
    JSF page:
    <af:resource type="javascript">
    function parseAddress(event)
    alert("new value: " + event.getNewValue());
    </af:resource>
    <af:selectOneChoice label="Location:" value="" id="soc4">
    <af:clientListener type="valueChange" method="parseAddress" />
    <f:selectItems value="#{Person.locations}" id="si7"/>
    </af:selectOneChoice>
    HTML :
    <option title="225 Broadway, New York, NY-10007" selected="" value="0">225 Broadway (Central Office)</option>
    <option title="90 Mark St., New York, NY-10007" value="1">90 Mark St. (Central Office)</option>
    Thanks a lot.

    Something I was missing ,
    You need to add valuePassThru="true" in your <af:selectOneChoice component. I have personally tested it and got the actual value in alert box. I hope this time you got the real solution. You can also test the following code by your end.
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:panelBox text="PanelBox1" id="pb1">
    <af:selectOneChoice label="Set Log Level" id="soc1"
    value="#{SelectManagedBean.loggerDefault}"
    valuePassThru="true">
    <af:selectItem label="select one" value="First" id="s6"/>
    <af:selectItem label="select two" value="Second" id="s56"/>
    <af:clientListener method="setLogLevel" type="valueChange"/>
    </af:selectOneChoice>
    <af:resource type="javascript">
    function setLogLevel(evt) {
    var selectOneChoice = evt.getSource();
    var logLevel = selectOneChoice.getSubmittedValue();
    // var logLevelObject = AdfLogger.NONE;
    alert("new value is : " + logLevel);
    //alert(evt.getSelection);
    //alert(logLevelObject);
    evt.cancel();
    </af:resource>
    </af:panelBox>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>

  • How to get the values from repeated frame?.

    Hi
    how to get the values from repeated frame?. i have to disply the first 3 digits in another place in my report.
    i have field empno in repeated frame and i want to disply first 3 digits in another place in the same report.
    thanks

    How often do you need to display it? It sounds like you might want to base a summary on that formula with a function of first or last. If it's a per page basis, it can be a page level summary. If it's at a higher level repeating frame, then you can create the summary at that level. I'd suggest taking a look at the online help for summaries using the first/last functions.
    Hope that helps,
    Toby

  • Get the values using substr

    Hi All,
    i am a comma seperated values into a variable. below are the values.
    "1234567,3,124567,3,14"
    the length of the values can vary. eg the output can also be
    "123,3,124567,443,1224"
    I need to get each value and store it a separate variable. is it possible using substr..?
    Please help me out...

    Hi,
    Here's how you can split a delimited list into parts in Oracle 9:
    WITH     got_part_cnt     AS
         SELECT     pk
         ,     csv
         ,     1 + LENGTH (csv)
                - LENGTH (REPLACE (csv, ','))     AS part_cnt
         FROM     table_x
    ,     cntr     AS
         SELECT     LEVEL     AS n
         FROM     ( SELECT  MAX (part_cnt)     AS max_part_cnt
                FROM       got_part_cnt
         CONNECT BY     LEVEL <= max_part_cnt
    ,     got_pos          AS
         SELECT     p.pk
         ,     p.csv
         ,     c.n
         ,     INSTR ( ',' || p.csv
                    , 1
                    , c.n
                    )          AS start_pos
         ,     INSTR ( p.csv || ','
                    , 1
                    , c.n
                    )      AS end_pos
         FROM    got_part_cnt     p
         JOIN     cntr          c     ON     c.n     <= p.part_cnt
    SELECT       pk
    ,       csv
    ,       n
    ,       SUBSTR ( csv
                 , start_pos
               , end_pos - start_pos
               )               AS item
    FROM       got_pos
    ORDER BY  pk
    ,            n
    ;Pk is the primary key of table_x. If you don't need it, you can omit it.
    Of course, this will work in versions later than 9, but you wouldn't want to if you could use REGEXP_SUBSTR.

  • PO Qty is getting Aggregated.

    Hi All,
    I am having a requrement like i need Invoice Accouting Doc No, GR Accouting Doc No,GR Qty.IR Qty ,PO no and PO Qty.
    I have created one cube which is getting updated from FI ODS
    for the PO No and PO Qty i have written a routine in Update rules which will update from PO ODS.
    My Problem was while updating the PO Quantity from PO ODS to Cube The PO qty is displaying for each Accounting document number (WE and RE) and in report level its getting aggregated.
    PO Number |  Item  | Accounting Doc No | Type  | PO Qty
      2520555        10       45465454                WE     100
      2520555         10      43546546                 RE      100
      2520555         20         465464                 RE       200
    this is how its coming which should not come ..
    for the PO the PO Qty is 300 but is aggregating and showing 400 in the report..
    Kindly provide me the logic how to handle this one..

    Hi All,
    We have created one Z programfor fetching the PO Qty only once for all the accouting document nos per PO and its working fine .So we copied the same code in update rules for PO Qty and its not working there its taking ZERO's for the entire PO's.
    Pls find the below Code and kindly let me know how to correct the code in the update rules .
    iam doing a lookup for PO qty.
    Code in Zprogram.
    DATA : begin of itab occurs 0,
              Doc_Num type /BI0/OIOI_EBELN,
              AC_DOC_NO type /BI0/OIAC_DOC_NO,
              Item_Num type /BI0/OIOI_EBELP,
              qty type /BI0/OIORDER_QUAN,
              end of itab.
             DATA : Temp type /BI0/OIOI_EBELN,
             Temp1 type /BI0/OIOI_EBELP.
            SELECT DISTINCT
            OI_EBELN
            AC_DOC_NO
            OI_EBELP
            ORDER_QUAN
            FROM /BIC/AYSPND_O300 INTO table itab WHERE /BIC/YSPNDIND = 'IT'.
    SORT itab BY Item_Num.
    Loop at itab.
    IF  Temp <> itab-Doc_Num OR Temp1 <> itab-Item_Num.
    write : / itab-Doc_Num, itab-AC_DOC_NO, itab-Item_Num, itab-qty.
    ELSE. write : / itab-Doc_Num, itab-AC_DOC_NO, itab-Item_Num, '0'.
    ENDIF.
    Temp = itab-Doc_Num.
    Temp1 =  itab-Item_Num.
    endloop.
    CLEAR itab.
    Thnx

  • JAXB: not able to get Attribute value

    Hi there,
    I am using oracle JAXB for XML processing. I am not able to get the value of an attribute. I ran the same code in SUN JWSDP 1.3, which worked correctly. I am not able to get the "foo" attribute for <Table> element using oracle JAXB.
    The XML schema follows:
    <?xml version='1.0' encoding='UTF-8' ?>
    <schema targetNamespace="http://www.oracle.com/iAS/aggregator"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    xmlns:ag="http://www.oracle.com/iAS/aggregator"
    xmlns="http://www.w3.org/2001/XMLSchema"
    jaxb:version="1.0"
    elementFormDefault="qualified">
    <annotation>
    <appinfo>
    <jaxb:globalBindings fixedAttributeAsConstantProperty="true"
    />
    <jaxb:schemaBindings>
    <jaxb:package name="oracle.dms.aggregator.adml"/>
    </jaxb:schemaBindings>
    </appinfo>
    </annotation>
    <complexType name="Adml_T">
    <sequence>
    <element name="Table" type="ag:Table_T" minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
    <attribute name="Version" type="token" fixed="10.1.3"/>
    </complexType> <!-- Adml -->
    <complexType name="Table_T">
    <attribute name="foo" type="Name"/>
    </complexType> <!-- Table -->
    <element name="Adml" type="ag:Adml_T"/>
    </schema>
    The XML file is:
    <?xml version='1.0' encoding='UTF-8' ?>
    <Adml xmlns="http://www.oracle.com/iAS/aggregator">
    <Table foo="foosailor">
    </Table>
    </Adml>
    The java file is:
    import javax.xml.bind.JAXBContext;
    import javax.xml.bind.Unmarshaller;
    import java.io.File;
    import java.util.List;
    import java.util.Iterator;
    import oracle.dms.aggregator.adml.Adml;
    import oracle.dms.aggregator.adml.TableT;
    public class JaxbQA
    public static void main (String[] args)
    throws Exception
    Adml adml;
    String fileName = "aggregator.xml";
    String instancePath = "oracle.dms.aggregator.adml";
    JAXBContext jc = JAXBContext.newInstance(instancePath);
    Unmarshaller u = jc.createUnmarshaller();
    u.setValidating(true);
    Object obj = u.unmarshal(new File(fileName));
    adml = (Adml)obj;
    List tables = adml.getTable();
    for (Iterator iter = tables.iterator();
    iter.hasNext();)
    TableT admlTable = (TableT)iter.next();
    String name = admlTable.getFoo();
    System.err.println("table foo=" + name);
    c:\oracle\jdk\bin\java.exe -classpath .;c:\oracle\xdk\lib\xmlparserv2.jar;c:\oracle\xdk\lib\xml.jar JaxbQA
    table foo=null

    I tested in both 10.1.0.2.0 and 10.1.0.3, which both showed the same problem. A bug #3621204 has been filed.

  • How to know when the PRICE AFTER DISCOUNT changed and get the value

    Hi,
    Everything I do to see if a value changed in the grid works except for PRICE AFTER DISCOUNT
    which seems to be inaccessible.
    Any idea how to know when exactly this value changed and do actions accordinly ?
    Also I always get 0.00 if I try to get the value of it
    This works to get in the condition of a vlaue changing but I always get 0.00 as the value of the column
    if (pVal.ItemUID == "38" && pVal.ColUID == COL_DISCOUNT.ToString() && pVal.EventType == BoEventTypes.et_VALIDATE && pVal.ItemChanged == true && pVal.ActionSuccess == true)
        try
            SAPbouiCOM.Matrix Matrix = (SAPbouiCOM.Matrix)SBO_Application.Forms.ActiveForm.Items.Item("38").Specific;
            SAPbouiCOM.EditText Editor = (SAPbouiCOM.EditText)Matrix.Columns.Item(COL_DISCOUNT).Cells.Item(pVal.Row).Specific;
            SBO_Application.MessageBox("Discount changed for : " + Editor.Value + "...", 1, "Ok", "", "");
        catch (Exception ex)
            SBO_Application.MessageBox(ex.Message, 1, "Ok", "", "");
    And this do not even get into the condition even tought I SEE the column PRICE AFTER DISCOUNT:
    if (pVal.ItemUID == "38" && pVal.ColUID == COL_PRICEAFTERDISCOUNT.ToString() && pVal.EventType == BoEventTypes.et_VALIDATE && pVal.ItemChanged == true && pVal.ActionSuccess == true)
        try
            SAPbouiCOM.Matrix Matrix = (SAPbouiCOM.Matrix)SBO_Application.Forms.ActiveForm.Items.Item("38").Specific;
            SAPbouiCOM.EditText Editor = (SAPbouiCOM.EditText)Matrix.Columns.Item(COL_PRICEAFTERDISCOUNT).Cells.Item(pVal.Row).Specific;
            SBO_Application.MessageBox("Price after discount changed for : " + Editor.Value + "...", 1, "Ok", "", "");
         catch (Exception ex)
             SBO_Application.MessageBox(ex.Message, 1, "Ok", "", "");

    just idea, maybe it will works
    Create one udf in row level and set there FS based on changes on price after discount and fill value what is in price after discount. Then the validation make on this field instead of standard SAP field.

Maybe you are looking for

  • [Solved] Update of one of the packages requires java-runtime-openjdk

    Hi. I wanted to perform a system update today but what I encountered is that one of the packages wants specifically a java-runtime-openjdk instead of java-runtime. I wonder what package and why. I don't want to install openjdk since I use an Oracle J

  • How to Set File Handling on LIghtroom CC??

    I was watching a you tube on Lightroom CC and the person is using a mac - I am on WIndows.  The insructor selected the words "lightroom" to the left of "File" to get to catalogue settins.  I don't see that option so that I can set file handling etc f

  • OracleDS9i Jar Listner not found

    Hi, I load the form in the browser but the Image Icons not display , i have put the jar icons file in the java directory and when i check the java console after loading the jar cache successfuly it give the note listenter class : not found in the Jav

  • Compatibility with 10.4.11

    I need to upgrade my 12"(Powerbook G4 1.5 Ghz 1.25 Gb Ram 80 Gb HD) as I wish to be able to install iWorks 09 family pack to complement the installation of iWorks 09 on my new 24"3.06 Ghz iMac. Can some one advise me if the following applications wil

  • Rewire Reason 2.5 with Logic 7.2.3

    Hi does anyone know how to rewire Reason 2.5 into the latest version of Logic 7 (7.2.3) I am running on an Intel iMac does this make any difference with the universal code or doesn't it make any difference?... Please advise. Richard Ginns. Intel iMac