Getting the values in separate columns

Hello Everyone
I am new to Bex, i have the sales data of 2008,2009,2010. now my requirement is to display the sales order(key figure) for 2008,2009,2010 in separate columns for each customer(dimension) in a single report , can any one help me how to get this done in bex.
Thanks
Gupta

Hi Rohit,
To do that you should have calyear in dimennsion, if so simple you can do it else do the following.
Edit your cube add calyear in time dimension and map it accordingly. 
Go To Bex Designer :
Select required free char, row and column (KF),
Drag and drop calyear on top of kf (Extreem top to KF). 
when you run your query it will display all the value according to relavant year. 
Note :  Suppose you have 4kf in your colum and having three years data in the target then there will be 12 columns will be displayed in report, ie number of kf  X  number of year
So, for better view or perfomance please do not forget to give restriction of year by giving variable to user. 
Thanks
BVR

Similar Messages

  • How to get the values in separate columns

    Hello Everyone
    I am new to Bex, i have the sales data of 2008,2009,2010. now i have to display the sales order(key figure) for 2008,2009,2010 in separate columns for each customer(dimension) in a single report , can any one help me how to get this done in bex.
    Thanks
    Gupta

    Hi ,
    You can achieve this either creating New Selections or Restricted Key Figures.
    Right click on the structute>>>> New selcection>>> drag the year to right [  Right Click on it >>restrict it with 2008}>>>Drag the respected Key figure.
    So u will get the values 2008 in seperate column.
    COpy the New Selecten that u created and paste on the structure , chage the descriprion and year to 2009.
    do the same for 2010.
    Note:you can also achieve this by creating variable offsets.Check the following link
    http://help.sap.com/saphelp_bw33/helpdata/en/3f/89533e5ff4d064e10000000a114084/content.htm
    Regards,
    Ranganath

  • How can I get the value of "Warehose" column in a form

    How can I get the value of "Warehouse" column in the form below (I mean what table that contain this value):
    Production Supervisor >> Batches >> (Button) Material Details >> (Button) Line Allocations
    Well, for more clearly! My problem is I must have the Unit Cost of Items, so I've got it in the cm_cmpt_dtl (table), but if I want to, I must create a relation that require 2 filed, they're Item_ID and Whse_Code.
    There's no problem with Item_ID, but Whse_Code seem to be the Mission Impossible (hix, I hate that film!!!!)
    I wonder if It was right to post this topic here. But anyway I just post my question here, hope I could get some help.

    wow, many, many, many.... and many thanks!
    Just add a tiny modify to check out the Batch_type
    doc_id = (select batch_id from gme_batch_header where batch_no='&batch_number' and batch_type = 0)
    Because the batch_no can be duplicated as we also create Batch and Filrm Planned Order.
    Many thanks for your support!
    P/S: Sorry for my terrible English :P

  • Update one column while getting the value in another column

    Is it possible to in one single SQL statement update two columns in a table while at the same time obtaining the value of another column, on the same row, in the same table, and independently (that is, the update of the columns has nothing to do with the data that I want from another column)*?* Of course, I can do this in two operations, one being a "select" and the other one being an "update", but since I am in the same table and even on the same row, is it really necessary to make TWO database calls? That's why I want to combine the the two SQL-statements, for reasons of presumed effiency.

    jsun wrote:
    Is it possible to in one single SQL statement update two columns in a table while at the same time obtaining the value of another column, on the same row, in the same table, and independently (that is, the update of the columns has nothing to do with the data that I want from another column)*?* Of course, I can do this in two operations, one being a "select" and the other one being an "update", but since I am in the same table and even on the same row, is it really necessary to make TWO database calls? That's why I want to combine the the two SQL-statements, for reasons of presumed effiency.Two statements != two database calls.
    At least not in terms of SQL.
    JDBC requires a 'statement' but in SQL (depending on the data source) that can include multiple statements. An obvious example of this is a stored proc but there are other ways as well.

  • If i select a check box i cant able to get the values in language columns in datagird??.......whats

    <?xml version="1.0"?>
    <!-- dpcontrols\ModifyDataGridData.mxml -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="500"
                    height="600" >
        <mx:Script>
            <![CDATA[
                import mx.collections.*;
                import mx.controls.*;
                import mx.events.*;
                import mx.utils.object_proxy;
                // Add event information to a log (displayed in the TextArea).
                public function collectionEventHandler(event:CollectionEvent):void {
                    switch(event.kind) {
                        case CollectionEventKind.ADD:
                            addLog("Item "+ event.location + " added");
                            break;
                        case CollectionEventKind.REMOVE:
                            addLog("Item "+ event.location + " removed");
                            break;
                        case CollectionEventKind.REPLACE:
                            addLog("Item "+ event.location + " Replaced");
                            break;
                        case CollectionEventKind.UPDATE:
                            addLog("Item updated");
                            break;
                // Helper function for adding information to the log.
                public function addLog(str:String):void {
        //        log.text += str + "\n";
                // Add a person to the ArrayCollection.
                public function addPerson():void {
                    var s:String;
                    var l:String;
                    if(rg1.selected)
                        s=rg1.label;
                    else
                        s=rg2.label;
                    if(ENG.selected)
                        l=ENG.label;
                    else
                        l=TAM.label;
                    if(ENG.selected && TAM.selected)
                        l=ENG.label.toString()+'&'+TAM.label.toString();
                    ac.addItem({Name:NameInput.text, Age:AgeInput.text,Sex:s ,Languagesknown:l});
                    clearInputs();
                // Remove a person from the ArrayCollection.
                public function removePerson():void {                // Make sure an item is selected.
                    if (dg.selectedIndex >= 0) {
                        ac.removeItemAt(dg.selectedIndex);
                // Update an existing person in the ArrayCollection.
                public function updatePerson():void {
                    var s:String;
                    var l:String;
                    if(rg1.selected)
                        s=rg1.label;
                    else
                        s=rg2.label;
                    if(ENG.selected)
                        l=ENG.label;
                    if(TAM.selected)
                        l=TAM.label;
                    if(ENG.selected && TAM.selected)
                        l=ENG.label.toString()+'&'+TAM.label.toString();
                    // Make sure an item is selected.
                    if(dg.selectedItem !== null) {
                        ac.setItemAt({Name:NameInput.text, Age:AgeInput.text,Sex:s,languageknown:l},dg.selectedIndex);
                // The change event listener for the DataGrid.
                // Clears the text input controls and updates them with the contents
                // of the selected item.
                public function dgChangeHandler():void {
                    var s:String;
                    var l:String;
                    if(rg1.selected)
                        s=rg1.label;
                    else
                        s=rg2.label;
                    if(ENG.selected)
                        l=ENG.label;
                    if(TAM.selected)
                        l=TAM.label;
                    if(ENG.selected && TAM.selected)
                        l=ENG.label.toString()+'&'+TAM.label.toString();
                    clearInputs();
                    NameInput.text = dg.selectedItem.Name;
                    AgeInput.text = dg.selectedItem.Age;
                    s=dg.selectedItem.Sex;
                    l=dg.selectedItem.Languageknown;
                // Clear the text from the input controls.
                public function clearInputs():void {
                    var s:String;
                    var l:String;
                    if(rg1.selected)
                        s=rg1.label;
                    else
                        s=rg2.label;
                    if(ENG.selected)
                        l=ENG.label;
                    if(TAM.selected)
                        l=TAM.label;
                    if(ENG.selected && TAM.selected)
                        l=ENG.label.toString()+'&'+TAM.label.toString();
                    NameInput.text = "";
                    AgeInput.text = "";
                    s="";
                    l="";
            ]]>
        </mx:Script>
        <!-- The ArrayCollection used by the DataGrid and ComboBox. -->
        <mx:ArrayCollection id="ac"
                            collectionChange="collectionEventHandler(event)">
        </mx:ArrayCollection>
        <mx:DataGrid width="450" id="dg" dataProvider="{ac}"
                     change="dgChangeHandler()">
            <mx:columns>
                <mx:DataGridColumn dataField="Name" headerText="Name"/>
                <mx:DataGridColumn dataField="Age" headerText="Age"/>
                <mx:DataGridColumn dataField="Sex" headerText="Sex"/>
                <mx:DataGridColumn dataField="Languageknown" headerText="Languageknown"/>
            </mx:columns>
        </mx:DataGrid>
        <!-- Form for data to add or change in the ArrayCollection. -->
        <mx:Form>
            <mx:FormItem label="Name">
                <mx:TextInput id="NameInput"/>
            </mx:FormItem>
            <mx:FormItem label="Age">
                <mx:TextInput id="AgeInput"/>
            </mx:FormItem>
            </mx:Form>
        <mx:Form width="300" height="90">
            <mx:RadioButtonGroup id="radiogroup1"/>
            <mx:FormItem width="53" label="Sex">
            </mx:FormItem>
            <mx:RadioButton id="rg1" label="Male"  groupName="radiogroup1"/>
            <mx:RadioButton id="rg2" label="Female" groupName="radiogroup1"/>
        </mx:Form>
        <mx:Form x="98" width="304" height="150">
            <mx:FormItem label="Languages known" >
            </mx:FormItem>
            <mx:CheckBox id="ENG" label="English" 
                         />
            <mx:CheckBox id="TAM" label="Tamil" />
            </mx:Form>
        <mx:HBox>
            <!-- Buttons to initiate operations on the collection. -->
            <mx:Button label="Add New" click="addPerson()"/>
            <mx:Button label="Update Selected" click="updatePerson()"/>
            <mx:Button label="Remove Selected" click="removePerson()"/>
            <!-- Clear the text input fields. -->
            <mx:Button label="Clear" click="clearInputs()"/>
        </mx:HBox>
    </mx:Application>

    Hi gayathriguru,
    You just need to correct the name for Languageknown while inserting object into array collection.
    ac.addItem({Name:NameInput.text, Age:AgeInput.text,Sex:s ,Languagesknown:l});
    You have by mistaken written it as Languagesknown instead of Languageknown. (<mx:DataGridColumn dataField="Languageknown" headerText="Languageknown"/>)
    Thanks and Regards
    Pooja Kuber | [email protected] | www.infocepts.com

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • How to get all the values in one column of a JTable

    How to get all the values in one column of a JTable as a Collection of String.
    I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column.

    I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column. You could always write a custom TableModel that stores the data in the format you want it. It would probably be about 50 lines of code. Or you could write a loop in 3 lines of code. I'll let you decide which approach you want to take.

  • How to get the value of an outputLabel (part of a header in a table col)?

    Hello,
    i am trying to write some code in a method in a bean that is called when a button is pressed in a page (actually is an ActionListener method), which is part of a Table. I want to get the value of the outputLabel of the column. The jspx part of the page to get the idea follows:
    <af:column id="TrsTransactionsTradeDateColumn" sortable="true" noWrap="true" sortProperty="TradeDate" >
    <f:facet name="header">
    <af:outputLabel value="#{nls['TRSTRANSACTIONS_TABLE_TRADEDATE']}" styleClass="af_column_header-text"/>
    </f:facet>
    <af:selectInputDate id="TrsTransactionsTradeDate" value="#{row.TradeDate}"
    required="#{bindings.TrsTransactionsTradeDate.mandatory}" readOnly="true" >
    <af:convertDateTime pattern="dd/MM/yyyy HH:mm:ss"/>
    </af:selectInputDate>
    </af:column>
    As you see, the header part which is actually an outputLabel, is not actually part of the column object but in a separate facet, and the header property of the column is not used. Also, i can't change that, as this code is produced by generator. Actually i can access the every column of the Table with CoreColumn class, as these are children of the Table, but it does not give me access to the corresponding outputLabel of the column, because it is neither child or property of the column! An extract of the code to show my situation and give an idea follows:
    DCIteratorBinding dcib;
    RowSetIterator rsi;
    HttpServletRequest hq;
    String iterName;
    PrintWriter out = null;
    Row currentRow = null;
    CoreTable tTable;
    String [] attNames, realNames;
    Boolean[] isNum;
    int isFirst = 1;
    List childList, childList2;
    CoreColumn csi;
    // Find the Component-Table and the Real names of the Columns
    tTable = (CoreTable) actionEvent.getComponent().getParent().getParent();
    System.out.println("CoreTableSelectOne:"+tTable.toString());
    System.out.println("CoreTableSelectOne Parent:"+tTable.getParent().toString());
    childList = tTable.getChildren();
    attNames = rsi.getRowAtRangeIndex(0).getAttributeNames();
    realNames = new String[attNames.length];
    isNum = new Boolean[attNames.length];
    System.out.println("attrNames:"+attNames.length);
    System.out.println("childList:"+childList.toString());
    System.out.println("childList size:"+childList.size());
    // The next loop puts in the realNames for each row set column the component column name
    // if the column is rendered otherwise null.
    for (int i = 0; i < attNames.length; i++) {
    System.out.println("attrName:"+attNames);
    realNames[i] = null;
    for (int k = 0; k < childList.size(); k++) {
    if (childList.get(k) instanceof CoreColumn){
    csi = (CoreColumn) childList.get(k);
    System.out.println("csi:"+csi.getSortProperty());
    if (csi.getSortProperty() == attNames[i]){
    childList2 = csi.getChildren();
    System.out.println("csi.childrencount:"+csi.getChildCount());
    System.out.println("csi.getshortdesc:"+csi.getShortDesc());
    System.out.println("csi.getFacetCount():"+csi.getFacetCount());
    csi.getFacet()
    for(int m=0; m<childList2.size(); m++) {
    //System.out.println("childList2.get(m).toString():"+childList2.get(m));
    if(childList2.get(m) instanceof CoreSelectInputDate)
    CoreSelectInputDate csid = null;
    csid = (CoreSelectInputDate)childList2.get(m);
    System.out.println("Label:'"+csid.getLabel());
    System.out.println("csi.getHeaderText()"+csi.getHeaderText());
    realNames[i] = new String(csi.getHeaderText());
    if (csi.isRendered() == false)
    realNames[i] = null;
    System.out.println(csi.getFormatType());
    if (csi.getFormatType() == "number")
    isNum[i] = true;
    else
    isNum[i] = false;
    System.out.println("After loop In attName: "+i);
    // Print the titles
    if (realNames[i] != null) {
    if (isFirst == 1)
    isFirst = 0;
    else
    out.print(";");
    out.print(realNames[i]);
    Part of the output produced follows:
    2008-07-18 18:49:13,699 INFO [STDOUT] iteratorNameTrsTransactionsIterator
    2008-07-18 18:49:13,699 INFO [STDOUT] 1
    2008-07-18 18:49:13,699 DEBUG [com.sun.faces.el.ValueBindingImpl] getValue(ref=bindings)
    2008-07-18 18:49:13,699 DEBUG [com.sun.faces.el.VariableResolverImpl] resolveVariable: Resolved variable:TrsTransactionsPageDef
    2008-07-18 18:49:13,699 DEBUG [com.sun.faces.el.ValueBindingImpl] getValue Result:TrsTransactionsPageDef
    2008-07-18 18:49:13,699 INFO [STDOUT] 2
    2008-07-18 18:49:13,699 INFO [STDOUT] 3
    2008-07-18 18:49:13,699 INFO [STDOUT] 4
    2008-07-18 18:49:13,699 INFO [STDOUT] CoreTableSelectOne:CoreTable[UIXFacesBeanImpl, id=TrsTransactionsTable]
    2008-07-18 18:49:13,699 INFO [STDOUT] CoreTableSelectOne Parent:CorePanelGroup[UIXFacesBeanImpl, id=TrsTransactionsTableGroup]
    2008-07-18 18:49:13,699 INFO [STDOUT] attrNames:56
    2008-07-18 18:49:13,699 INFO [STDOUT] childList:[CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsTradeDateColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsLkpBiccodeColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsLkpBicnameColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsLkpInstrumentIsincodeColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsLkpInstrumentNameColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsBuySellColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsTradeCapacityColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsQuantityColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsUnitPriceTypeColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsUnitPriceColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsLkpCurrencyIsoSymbolColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsVenuetypeColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsLkpVenueMicCodeColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsLkpVenueBicCodeColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsCtypeColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsLkpCounterpartyMicCodeColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsLkpCounterpartyBiccodeColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsCcodeccColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsClienttypeColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsLpkClientBicCodeColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsClientinternalColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsTradeStatusColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsLastUpdateDateColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsCancelDateColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsOrigTrnColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsSourceColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsSourceNumberColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsTransTypeColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsTradeDateOnlyColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsExchangeReasonColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsTransTrnColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsCancSourceNumberColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsCauniqueidColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsRoutingColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsHubSentDateColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsOtherRcaColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsOutOfDateFlagColumn], CoreColumn[UIXFacesBeanImpl, id=TrsTransactionsMultipleFlagColumn], CoreColumn[UIXFacesBeanImpl, id=_id89]]
    2008-07-18 18:49:13,699 INFO [STDOUT] childList size:39
    2008-07-18 18:49:13,699 INFO [STDOUT] 5
    2008-07-18 18:49:13,699 INFO [STDOUT] 6
    2008-07-18 18:49:13,699 INFO [STDOUT] 7
    2008-07-18 18:49:13,699 INFO [STDOUT] 8
    2008-07-18 18:49:13,699 INFO [STDOUT] 9
    2008-07-18 18:49:13,699 INFO [STDOUT] 10
    2008-07-18 18:49:13,699 INFO [STDOUT] attrName:BicId
    2008-07-18 18:49:13,699 INFO [STDOUT] csi:TradeDate
    2008-07-18 18:49:13,699 INFO [STDOUT] csi:LkpBiccode
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:LkpBicname
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:LkpInstrumentIsincode
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:LkpInstrumentName
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:BuySell
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:TradeCapacity
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:Quantity
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:UnitPriceType
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:UnitPrice
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:LkpCurrencyIsoSymbol
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:Venuetype
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:LkpVenueMicCode
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:LkpVenueBicCode
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:Ctype
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:LkpCounterpartyMicCode
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:LkpCounterpartyBiccode
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:Ccodecc
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:Clienttype
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:LpkClientBicCode
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:Clientinternal
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:TradeStatus
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:LastUpdateDate
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:CancelDate
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:OrigTrn
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:Source
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:SourceNumber
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:TransType
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:TradeDateOnly
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:ExchangeReason
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:TransTrn
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:CancSourceNumber
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:Cauniqueid
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:Routing
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:HubSentDate
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:OtherRca
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:OutOfDateFlag
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:MultipleFlag
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:null
    2008-07-18 18:49:13,714 INFO [STDOUT] After loop In attName: 0
    2008-07-18 18:49:13,714 INFO [STDOUT] attrName:TradeDate
    2008-07-18 18:49:13,714 INFO [STDOUT] csi:TradeDate
    2008-07-18 18:49:13,714 INFO [STDOUT] csi.childrencount:1
    2008-07-18 18:49:13,714 INFO [STDOUT] csi.getshortdesc:null
    2008-07-18 18:49:13,714 INFO [STDOUT] csi.getFacetCount():1
    2008-07-18 18:49:13,714 INFO [STDOUT] Label:'null
    2008-07-18 18:49:13,714 INFO [STDOUT] csi.getHeaderText()null
    2008-07-18 18:49:13,714 ERROR (irrelevant)
    Any idea how to achieve to get the value of the corresponding outputLabel ?
    TIA

    Hi,
    the fastes option is to create a JSF binding from the output text to a managed bean and directly access the component. So unless you like parsing the table for this information, it seems unnecessary if you frequently use the information stored in the header
    Frank

  • Get the value from a selected row in a table

    Hi all,
    My table contains a tree structure.
    When I select a single row, I need to get the value of a particular column.
    I created an action on the leadSelect of the table and gave the following code:
    public void onActionleadValue(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionleadValue(ServerEvent)
        String strLeadValue = wdContext.nodeAttribute_View_Out().currentAttribute_View_OutElement().getAttributeAsText("<MyModelAttributename>");
        wdComponentAPI.getMessageManager().reportSuccess("selected lead value "+strLeadValue);
        wdContext.currentContextElement().setLeadselectedvalue(strLeadValue);
        //@@end
    My Bapi returns me 6 records. and when I click on any row its always pointing to the last record value.
    What could be the problem?
    Thanks
    Anjana

    Hi Anjana,
    Try this.
    try
         IWDMessageManager msg = wdComponentAPI.getMessageManager();
         int leadselect = wdContext.nodeSChild1().getLeadSelection();
          for(int i=0;i<wdContext.nodeSChild1().size();i++)
              if(leadselect == i)
              //Displaying output in diff table
    //           IPublicTestComp.ITableNodeElement tabelm = wdContext.createTableNodeElement();
    //           tabelm.setAttribute1(wdContext.nodeSChild1().getSChild1ElementAt(i).getAttribute1());
    //           tabelm.setAttribute2(wdContext.nodeSChild1().getSChild1ElementAt(i).getAttribute2());
    //           tabelm.setAttribute3(wdContext.nodeSChild1().getSChild1ElementAt(i).getAttribute3());
    //           wdContext.nodeTableNode().addElement(tabelm);
              String att1 = wdContext.nodeSChild1().getSChild1ElementAt(i).getAttribute1();
              String att2 = wdContext.nodeSChild1().getSChild1ElementAt(i).getAttribute2();
              String att3 = wdContext.nodeSChild1().getSChild1ElementAt(i).getAttribute3();
                     msg.reportSuccess("Row ("i") : "att1"====="att2"======"+att3);
    } catch (WDDynamicRFCExecuteException e) {
         wdComponentAPI.getMessageManager().reportException("Message : "+ e.getMessage(),true);
    Regards,
    Mithu

  • Getting the Values from a Tiled View

    Hi,
    I have a TiledView and I have checkbox in the tiled view. I am trying
    to get the values of the checked boxes.
    I have coded like this.
    Object[] links = getRSystemLinks().getCbSystemUrl().getValues();
    if I see the links.length i get only one. In html If I see the code
    it appends the TileIndex in brackets. If I replace the TileIndex with
    0 in all the fields in endCbSystemUrl method I get the correct values.
    In the TiledView beginDisplay() method my code is like this.
    if (getPrimaryModel() == null) throw new ModelControlException
    ("Primary model is null");
    super.beginDisplay();
    resetTileIndex();
    pgCustomizeLinksViewBean parentBean = (pgCustomizeLinksViewBean)
    getParent();
    ((DatasetModel) getDefaultModel()).setSize
    (parentBean.SystemChoicesValue.size());
    Any Suggestions on this.
    Thanks
    Namburi

    Namburi--
    Remember, the getValues() method does not return the values from a column in
    a TiledView. It is strictly for use by fields that can have multiple
    values, like multi-select list boxes.
    DO NOT remove the indexing feature from the field names, especially in the
    case of checkboxes, because checkboxes aren't submitted back to the server
    unless they are checked. By overriding the automatic checkbox tracking
    feature JATO provides, you won't be able to tell which checkboxes were
    actually checked by row--you'll simply get back a list the same size as the
    number of checkboxes that were checked, without any placeholders for the
    ones that weren't checked.
    Instead, on submit, you simply need to move through the tiledView and check
    the value of checkbox on each row:
    tiledView.beforeFirst();
    while (tiledView.next())
    if (getDisplayFieldBooleanValue("myCheckBox"))
    You can use the same construct to build up an array or list:
    List checkedList=new LinkedList();
    tiledView.beforeFirst();
    while (tiledView.next())
    if (getDisplayFieldBooleanValue("myCheckBox"))
    checkedList.add(new Boolean(true))
    else
    checkedList.add(new Boolean(false))
    Todd
    Todd Fast
    Senior Engineer
    Sun Microsystems, Inc.
    todd.fast@s...
    ----- Original Message -----
    From: <vnamboori@y...>
    Sent: Wednesday, October 17, 2001 3:49 PM
    Subject: [iPlanet-JATO] Getting the Values from a Tiled View
    Hi,
    I have a TiledView and I have checkbox in the tiled view. I am trying
    to get the values of the checked boxes.
    I have coded like this.
    Object[] links = getRSystemLinks().getCbSystemUrl().getValues();
    if I see the links.length i get only one. In html If I see the code
    it appends the TileIndex in brackets. If I replace the TileIndex with
    0 in all the fields in endCbSystemUrl method I get the correct values.
    In the TiledView beginDisplay() method my code is like this.
    if (getPrimaryModel() == null) throw new ModelControlException
    ("Primary model is null");
    super.beginDisplay();
    resetTileIndex();
    pgCustomizeLinksViewBean parentBean = (pgCustomizeLinksViewBean)
    getParent();
    ((DatasetModel) getDefaultModel()).setSize
    (parentBean.SystemChoicesValue.size());
    Any Suggestions on this.
    Thanks
    Namburi
    [email protected]

  • 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.

  • Get millisecond values from timestamp column in v$logmnr_contents

    Hello
    How do we get millisecond values from timestamp column in v$logmnr_contents.
    I tried with following query.
    select scn,To_Char(timestamp,'DD-MON-YYYY HH24:MI:SS:FF') from v$logmnr_contents WHERE OPERATION NOT IN('START') and username ='SCOTT' and sql_redo is not null and (seg_owner is null or seg_owner not in('SYS'));
    it says ORA-01821: date format not recognized. I want to find the relation of scn with timestamp. In forums i found, scn is derived from timestamp value. I dont know its correct or not.
    if i query with out FF in time format i get like
    scn timestamp
    808743 27-NOV-2007 00:12:53
    808743 27-NOV-2007 00:12:53
    808743 27-NOV-2007 00:12:53
    808744 27-NOV-2007 00:12:53
    808744 27-NOV-2007 00:12:53
    808744 27-NOV-2007 00:12:53
    if scn is derived from timestamp with milliseconds, each scn should be different right?More help please

    May be there's an easy way solving your problem, I did it like that:
    CREATE TABLE quota_test (test VARCHAR2(50))
    INSERT INTO quota_test
    VALUES ('update "SCOTT"."NEWTAB1" set a="34" and b="45"')
    SELECT test normal, REPLACE(SUBSTR(test,INSTR(test,'"',1),INSTR(test,'.',1)+2),'"','') changed
    FROM quota_test
    Result is :
    NORMAL
    update "SCOTT"."NEWTAB1" set a="34" and b="45"      
    CHANGED
    SCOTT.NEWTAB1
    If you didn't understand, I can explain what I wrote

  • "How to get distinct values of sharepoint column using SSRS"

    Hi,
        I have integrated sharepoint list data to SQL Server reporting services. I am using the below to query sharepoint list data using sql reporting services.
    <Query>
       <SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
       <Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
          <Parameters>
             <Parameter Name="listName">
                <DefaultValue>{GUID of list}</DefaultValue>
             </Parameter>
             <Parameter Name="viewName">
                <DefaultValue>{GUID of listview}</DefaultValue>
             </Parameter>
             <Parameter Name="rowLimit">
                <DefaultValue>9999</DefaultValue>
             </Parameter>           
          </Parameters>
       </Method>  
    <ElementPath IgnoreNamespaces="True">*</ElementPath>
    </Query>
    By using this query, I am getting a dataset which includes all the columns of sharepoint list. Among these columns, I wanted to display only 2 columns (i.e Region and Sales type) using chart. I have created a Region parameter but when I click preview, the drop down box is giving me all the repeatative values of region like RG1,RG1,RG1,RG2,RG2,RG2,RG2,RG3.......... I wanted to display only distinct values of Region parameter so that whenever end user select region from the parameter drop down, it will display the respective value of Sales type column.
    Also when I select only RG1 parameter, it is giving me a chart including the sales type of all the Regions. (it should display me only the sales type of RG1) How can I link these 2 columns so that they will display the values respectively.
              I would really appreciate if anyone can help me out with this.
    Thanks,
    Sam.

    Hi Sam,
    By code, the CAML language doesn’t have any reserved word (or tag) to set this particular filter to remove duplicate results.
    In this case, we could use the custom code to get distinct records.
    Here are the detailed steps:
    1.         Create a hidden parameter that gets all the records in one field.
    Note: Please create another dataset that is same of the main dataset. This dataset is used for the parameter.
    2.         Create a function that used to remove the duplicate records.
    Here is the code:
    Public Shared Function RemoveDups(ByVal items As String) As String
    Dim noDups As New System.Collections.ArrayList()
    Dim SpStr
    SpStr = Split(items ,",")
    For i As Integer=0 To Ubound(Spstr)
    If Not noDups.Contains(SpStr(i).Trim()) Then
    noDups.Add(SpStr(i).Trim())
    End If
    Next
    Dim uniqueItems As String() = New String(noDups.Count-1){}
    noDups.CopyTo(uniqueItems)
    Return String.Join(",", uniqueItems)
    End Function
    3.         Create another parameter that will be used for filtering the maindata.
    Please set the available value to be =Split(Code.RemoveDups(JOIN(Parameters!ISSUE_STATUS_TEMP.Value, ",")), ",")
    And the default value to be the value you what such as the first value:
    =Split(Code.RemoveDups(JOIN(Parameters!ISSUE_STATUS_TEMP.Value, ",")), ",").(0)
    4.         Go to the main dataset. Open the property window of this dataset.
    5.         In the “Filters” tab, set the filter to be:
    Expression: <The field to be filter>
    Operator: =
    Value: =Parameters!Region.Value
    The parameter “Region” should be the parameter we created in the step3.
    Now, we should get distinct values of SharePoint columns.
    If there is anything unclear, please feel free to ask.
    Thanks,
    Jin
    Jin Chen - MSFT

  • I want to get the values from the second hiphen only

    Hey Guys,
    I have one column and the data like this
    col1 = 'AI463-901-001'
    Now,
    I want to get the values from the second hiphen only(any no. of values).
    Please can any one help me on this .
    Thanks in advance!
    Regards,
    -LK

    you have a mistake
    you result is -001
    this is right
      select substr('AI463-901-001',instr('AI463-901-001','-',1,2)+1) from dual;
      -- @user11928732 -  if you are using Oracle Database 11g, ttry this please
    with data as
      (select  'AI463-901-001'from dual)
      select substr(str,instr(str,'-',1,2)+1) from data;
      select substr(<YOUR COLUMN>,instr(<YOUR COLUMN>,'-',1,2)+1) from <YOUR TABLE>;result is : 001
    Edited by: Mahir M. Quluzade on May 3, 2011 5:37 PM

  • How to get the values of all rows in advanced table

    HI All,
    I am using an advanced table to enter the values for the service contract line (its a custom page)in that advanced table i ahave column with lov called task number for that task number once i had choosed one task number and creating one more row using add anethor row button i want to restrict the user to not to choose the task number which was entered in the previus row.
    Or if this is not possible i want to restrict the user by showing an error message when click on the submit button by saying you have choosed the duplicate task number please choose a uniqu task number
    please give some hints
    thanks
    ajay

    Hi
    your approach will have two steps
    1.) use the row refernce and get the value of task number of the row which is enterd by user .
    2.) use getRows in range and compare values of task number of every row with the user selected value ,if value match then throw error.
    Thanks
    Pratap

Maybe you are looking for