Calculated attributes in WDA

Hi people,
I'm new in WebDynpro for Abap. Is it possible to declare a calculated attribute like in WebDynpro for Java? I can't find a attribute-property for doing that.
Is this concept not available in WDA?
Regards,
Thomas

Hi,
in WD4Java you have the possibility to declare an attribute as "calculated". The framework generates then 2 methodes, a getter and a setter method, which the application developer can use to put in his coding.
A use case can be the following: You have a Inputfield with a simple value help (i.e. from the domain of the data element). The value you can see, after the selection is the key (of the key-value list). Now I want to show near the inputfield the value of the selected key. In this case I can declare (in WD4Java) a calculated attribute which i bind to a TextView element near the Input field. The getter methode of the attribute (implemented by the application developer) determines the value of the selected key.
If this wasn't clear enough, visit this [link|http://help.sap.com/erp2005_ehp_03/helpdata/EN/7f/a0384162316532e10000000a1550b0/frameset.htm], where the concept of calculated attributes is described in detail.
Regards,
Thomas

Similar Messages

  • Problem with calculated attribute

    I have created a calculated attribute on an Entity that derives its value from two persistent attributes.
    I am only interested in displaying the calculated attribute and not the attributes it is derived from.
    If I put the calculated attribute in a View object without the other attributes I will get an error ( (oracle.jbo.DMLException) JBO-26080: Error while selecting entity for AccountPosting) when displaying data from the View object.
    This error does not occur if I add the other attributes to the View object and it all works OK.
    Why is this? Surely the calculated attribute is only calculated at the Entity object layer, so what does the View object have to do with this?

    The Java datatype for the two Number attributes is Number
    When I switch to Integer or Long, I get an error but the stack is different.
    oracle.jbo.DMLException: JBO-26080: Error while selecting entity for SLEO
         at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelect(BaseSQLBuilderImpl.java:658)
         at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:5025)
         at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:3386)
         at oracle.jbo.server.EntityImpl.setAttributeValueInternal(EntityImpl.java:2148)
         at oracle.jbo.server.EntityImpl.setAttributeValue(EntityImpl.java:2079)
         at oracle.jbo.server.AttributeDefImpl.set(AttributeDefImpl.java:1774)
         at oracle.jbo.server.EntityImpl.setAttributeInternal(EntityImpl.java:1032)
         at mypackage2.SLEOImpl.setDETAIL(SLEOImpl.java:113)
         at mypackage2.SLEOImpl.setAttrInvokeAccessor(SLEOImpl.java:144)
         at oracle.jbo.server.EntityImpl.setAttribute(EntityImpl.java:945)
         at oracle.jbo.server.ViewRowStorage.setAttributeValue(ViewRowStorage.java:1241)
         at oracle.jbo.server.ViewRowStorage.setAttributeInternal(ViewRowStorage.java:1150)
         at oracle.jbo.server.ViewRowImpl.setAttributeInternal(ViewRowImpl.java:1111)
         at oracle.jbo.server.ViewRowImpl.setAttrInvokeAccessor(ViewRowImpl.java:1086)
         at oracle.jbo.server.ViewRowImpl.setAttribute(ViewRowImpl.java:833)
         at oracle.jbo.jbotester.JboTesterUtil.setData(JboTesterUtil.java:173)
         at oracle.jbo.jbotester.JBOFieldHelper.setDataValue(JBOFieldHelper.java:114)
         at oracle.jbo.jbotester.JBOFieldHelper.applyEdit(JBOFieldHelper.java:175)
         at oracle.jbo.jbotester.JBOFieldHelper.applyEditAndValidate(JBOFieldHelper.java:205)
         at oracle.jbo.jbotester.JBOFieldHelper$DefaultJBOFocusListener.focusLost(JBOFieldHelper.java:239)
         at java.awt.AWTEventMulticaster.focusLost(AWTEventMulticaster.java:172)
         at java.awt.Component.processFocusEvent(Component.java:5006)
         at java.awt.Component.processEvent(Component.java:4888)
         at java.awt.Container.processEvent(Container.java:1569)
         at java.awt.Component.dispatchEventImpl(Component.java:3615)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1713)
         at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:777)
         at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:497)
         at java.awt.Component.dispatchEventImpl(Component.java:3506)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    ## Detail 0 ##
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]FOR UPDATE cannot be specified on a READ ONLY cursor.
         at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
         at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest.openCursor(Unknown Source)
         at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.execute(Unknown Source)
         at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
         at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
         at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
         at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelect(BaseSQLBuilderImpl.java:533)
         at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:5025)
         at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:3386)
         at oracle.jbo.server.EntityImpl.setAttributeValueInternal(EntityImpl.java:2148)
         at oracle.jbo.server.EntityImpl.setAttributeValue(EntityImpl.java:2079)
         at oracle.jbo.server.AttributeDefImpl.set(AttributeDefImpl.java:1774)
         at oracle.jbo.server.EntityImpl.setAttributeInternal(EntityImpl.java:1032)
         at mypackage2.SLEOImpl.setDETAIL(SLEOImpl.java:113)
         at mypackage2.SLEOImpl.setAttrInvokeAccessor(SLEOImpl.java:144)
         at oracle.jbo.server.EntityImpl.setAttribute(EntityImpl.java:945)
         at oracle.jbo.server.ViewRowStorage.setAttributeValue(ViewRowStorage.java:1241)
         at oracle.jbo.server.ViewRowStorage.setAttributeInternal(ViewRowStorage.java:1150)
         at oracle.jbo.server.ViewRowImpl.setAttributeInternal(ViewRowImpl.java:1111)
         at oracle.jbo.server.ViewRowImpl.setAttrInvokeAccessor(ViewRowImpl.java:1086)
         at oracle.jbo.server.ViewRowImpl.setAttribute(ViewRowImpl.java:833)
         at oracle.jbo.jbotester.JboTesterUtil.setData(JboTesterUtil.java:173)
         at oracle.jbo.jbotester.JBOFieldHelper.setDataValue(JBOFieldHelper.java:114)
         at oracle.jbo.jbotester.JBOFieldHelper.applyEdit(JBOFieldHelper.java:175)
         at oracle.jbo.jbotester.JBOFieldHelper.applyEditAndValidate(JBOFieldHelper.java:205)
         at oracle.jbo.jbotester.JBOFieldHelper$DefaultJBOFocusListener.focusLost(JBOFieldHelper.java:239)
         at java.awt.AWTEventMulticaster.focusLost(AWTEventMulticaster.java:172)
         at java.awt.Component.processFocusEvent(Component.java:5006)
         at java.awt.Component.processEvent(Component.java:4888)
         at java.awt.Container.processEvent(Container.java:1569)
         at java.awt.Component.dispatchEventImpl(Component.java:3615)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1713)
         at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:777)
         at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:497)
         at java.awt.Component.dispatchEventImpl(Component.java:3506)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    ----- LEVEL 1: DETAIL 0 -----
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]FOR UPDATE cannot be specified on a READ ONLY cursor.
         at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
         at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest.openCursor(Unknown Source)
         at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.execute(Unknown Source)
         at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
         at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
         at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
         at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelect(BaseSQLBuilderImpl.java:533)
         at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:5025)
         at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:3386)
         at oracle.jbo.server.EntityImpl.setAttributeValueInternal(EntityImpl.java:2148)
         at oracle.jbo.server.EntityImpl.setAttributeValue(EntityImpl.java:2079)
         at oracle.jbo.server.AttributeDefImpl.set(AttributeDefImpl.java:1774)
         at oracle.jbo.server.EntityImpl.setAttributeInternal(EntityImpl.java:1032)
         at mypackage2.SLEOImpl.setDETAIL(SLEOImpl.java:113)
         at mypackage2.SLEOImpl.setAttrInvokeAccessor(SLEOImpl.java:144)
         at oracle.jbo.server.EntityImpl.setAttribute(EntityImpl.java:945)
         at oracle.jbo.server.ViewRowStorage.setAttributeValue(ViewRowStorage.java:1241)
         at oracle.jbo.server.ViewRowStorage.setAttributeInternal(ViewRowStorage.java:1150)
         at oracle.jbo.server.ViewRowImpl.setAttributeInternal(ViewRowImpl.java:1111)
         at oracle.jbo.server.ViewRowImpl.setAttrInvokeAccessor(ViewRowImpl.java:1086)
         at oracle.jbo.server.ViewRowImpl.setAttribute(ViewRowImpl.java:833)
         at oracle.jbo.jbotester.JboTesterUtil.setData(JboTesterUtil.java:173)
         at oracle.jbo.jbotester.JBOFieldHelper.setDataValue(JBOFieldHelper.java:114)
         at oracle.jbo.jbotester.JBOFieldHelper.applyEdit(JBOFieldHelper.java:175)
         at oracle.jbo.jbotester.JBOFieldHelper.applyEditAndValidate(JBOFieldHelper.java:205)
         at oracle.jbo.jbotester.JBOFieldHelper$DefaultJBOFocusListener.focusLost(JBOFieldHelper.java:239)
         at java.awt.AWTEventMulticaster.focusLost(AWTEventMulticaster.java:172)
         at java.awt.Component.processFocusEvent(Component.java:5006)
         at java.awt.Component.processEvent(Component.java:4888)
         at java.awt.Container.processEvent(Container.java:1569)
         at java.awt.Component.dispatchEventImpl(Component.java:3615)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1713)
         at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:777)
         at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:497)
         at java.awt.Component.dispatchEventImpl(Component.java:3506)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

  • How to change sql expression of SQL-Calculated Attribute of view object ?

    Hi
    jdev 11.1.1.5
    I have a view object with a SQL-Calculated Attribute (sumAnalytic) how can I change sql expression of this attribute in runtime?
    for example in application module method??

    Hi Mr Timo
    Thanks for your reply but I do not need dynamic vo because I can not change all of my vo
    I only need to change expression of SQL-Calculated Attribute of view object in run time.
    For this I set expression in view object something like this 'select 2 from dual' and in run time in my AM method I get the vo query and replace 'select 2 from dual' with something like 'selet sum(amnt) over (partition by 1)' and set new query.
    But I think the better solution must exist
    Thanks

  • BC4J: Updating calculated attributes

    We're working on some web services with BC4J. For querying data, we have various tags which are calculated. I'm looking for the best practice for receiving updates to those calculated values.
    For example, the web service needs to work with the <countyFIPSCode> element, which might have a value of 55043. Internally, that might relate to our county_code = 21.
    It's easy enough to build a BC4J calculated attribute for countyFIPSCode, and that's perfect for queries. But I'm looking for the best approach for handling an update or insert that has a value for countyFIPSCode.
    For example, one way would be to absorb the XML document, find the <countyFIPSCode> element, get the value, call a database function to get my internal county_code, and use it for the update. I can see lots of approaches, though, and I certainly haven't plumbed the depths of what BC4J can do, so I'm wondering what would be best approach.
    -- jim

    If you allow the transient CountyFIPSCode attribute to be updateable, then in the setCountyFIPSCode() method in the view row class (or optionally at the entity level if you want to enable this CountyFIPSCode->NormalCountyCode mapping), just after invoking the setAttributeInternal() method to set the value of the transient attribute, you can remap the value, then invoke the setCountyCode() method with the remapped value.
    How you accomplish the mapping would depend on how many different county-codes there are. If you have an existing stored function that does the mapping, you could just write an expert-mode view object that looks like:
    select yourfunction.map_fips_to_county(:0) as county_code from dualThen you can use this VO to set a value for the zero-th bind variable with the value of the FIPS code, then retrieve the value of the "CountryCode" attribute in the resulting row.

  • 9.0.5 loses ViewObject's Calculated Attributes ?!

    We have an existing BC4J application and we try to migrate from 9.0.3.2 to 9.0.5 Beta.
    When opening a ViewObject under 9.0.5, JDeveloper warns that the object will be migrated.
    However, when doing so, custom calculated attribute's SQL is lost.
    Here is an example: suppose you have a view with
    SELECT EMPNO, PCK_MYFUNCTION.FUG_GET_SOMETHING(EMPNAME) AS CALCULATED_ATTR FROM
    EMPLOYEES as a SQL (Expert mode is irrelevant)
    After 9.0.5 migration, SQL becomes:
    SELECT EMPNO, CALCULATED_ATTR AS CALCULATED_ATTR FROM EMPLOYEES as a SQL
    The aliased name of the attribute becomes also the code for the attribute ! Of course, SQL is wrong and you can detect it straight from the wizard.
    Anyone with such experience, workaround ?
    Best regards, Stephane

    I have 9.0.5.2 up and running and created the classes exactly like I think you have said in 9.0.3. I took the liberty of assuming that the purpose of IFormContext was to return a FormContext object.
    package test;
    import java.io.Serializable;
    public class FormContext implements Serializable {
      public FormContext() {}
    package test;
    import oracle.jbo.ViewObject;
    public interface BaseViewObject extends ViewObject  {
      public void baseVOMethod();
    package test;
    import oracle.jbo.server.ViewObjectImpl;
    public class BaseViewObjectImpl extends ViewObjectImpl  {
    public void baseVOMethod() { }
    package test;
    public interface FormContextView extends BaseViewObject  {
    public void   formContextMethod();
    package test;
    public class FormContextViewImpl extends BaseViewObjectImpl implements FormContextView, IFormContext {
      public void   formContextMethod() { }
      public FormContext getFormContext() {
         return null;
    package test;
    public interface IFormContext  {
        FormContext getFormContext();
    }Then, I created a DeptView and set FormContextViewImpl as its Object class and (OK)'d the wizard.
    When I go back into the wizard, I see:
    test.FormContextView
    test.IFormContext
    in the list of Available interfaces.

  • SetAttribute at calculated attribute at prev next binding

    I use JDev version 10.1.2.1.0 (Build 1913). I try to set attribute at calculated attribute.. that all row divide some page using prev next binding. The result was disorder. I think i must set attribute repeat every i click prev next button.. but i don't know where i must overwrite method form prev next binding.. or any other solution... please give me advice.. thank you

    Dimitar, thank you for your response.
    If I am trying to insert a new row (not update an existing one), I believe I need to create a Managed Property bomEditChild under the Managed Bean bomCRUD, and then set the binding of the af:InputText to +#{bomCRUD.bomEditChild}+ as seen below:
    <af:popup id="p1" ... >
    <af:dialog id="d2" dialogListener="#{DialogListenerCollection.editDialogListener}" title="BOM Edit">
    <af:inputText label="Child" id="it1" binding="#{BomCRUD.bomEditChild}"/>
    </af:popup>
    From adfc-config.xml
    <managed-bean id="__11">
    <managed-bean-name id="__9">BomCRUD</managed-bean-name>
    <managed-bean-class id="__12">erp.view.framework.BomCRUD</managed-bean-class>
    <managed-bean-scope id="__10">request</managed-bean-scope>
    <managed-property id="__2">
    <property-name id="__3">bomEditChild</property-name>
    <property-class>oracle.adf.view.rich.component.rich.input.RichInputText</property-class>
    <value id="__1"></value>
    </managed-property>
    </managed-bean>
    However, when I print the value of the String Child variable of the createChildren class, I get the following:
    System.out.println("Child: " + Child); // output command gets me the text below
    +Child: RichInputText[UIXEditableFacesBeanImpl, id=it1]+
    The createChildren method is detailed below in the pages definition file and implemented in the AppModuleImpl class.
    <methodAction id="createChildren" ...>
    <NamedData NDName="Child" NDValue="#{BomCRUD.bomEditChild}" NDType="java.lang.String"/>
    </methodAction>
    It appears the value being passed into my createChildren class is the container ID, not the value entered into the container by the customer. The output is the same whether I declare bomEditChild as a Managed Property under the Managed Bean bomCRUD or not. I am still unsure how to grab the value of the inputted text and/or if the managed property is updating before the createChildren method is being called via the editDialogListener.
    Any further ideas?

  • Why i am not able to see calculated Attribute in Context

    Hi all,
      I am not able to see <b>calculated Attiribute</b> in Context...our NWDS version is 2.0.16..Could anyone tell me the reason...

    Hi
    if you have not created value attibute?
    Create a value attribute by right clicking the context.Right click the newly created value attribute there you can see the calculated attribute property
    Regards,
    Arun

  • How recalc buffered value in calculated attribute?

    Hi everyone
    I have created some calculated context attribute and set the Buffer Mode to Buffered. As I understand this means that the value of attribute will calculated once, will buffered in memory and next will recalc "on demand".
    My question is - how can I invalidate the attribute value and call recalc function ?
    P.S. NW CE 7.2

    Hi,
    You can find out more details of [Calculated Context Attribute|http://help.sap.com/saphelp_tm80/helpdata/de/7f/a0384162316532e10000000a1550b0/content.htm] and [Calculated Attributes in Web DynproJava|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e093a9d8-c00e-2b10-7dae-b72c3a8c5536]
    Hope this helps!!
    Regards
    Vijay K

  • Calculated attribute?

    Hi,
    Wat is the actual use of this and also giv me some sample for this..when and wher we use it?
    **Helpful answers will be appreciated...
    GS

    Hi
    The values of context attributes are normally saved in node elements of a controller context at runtime, and with data binding are displayed in the UI using a generic formatting mechanism (for Dictionary-based types).
    In many cases, saved context data should be transferred identically, instead it should be converted before the display. A typical example is displaying an address text based on name and gender. Using the two context attributes Name=’Maier’ and Gender=’male’, the standardized address text 'Dear Mr. Maier!’ should be displayed in the user interface. This text can be saved by defining an additional value attribute Address in the controller context. In multiple context nodes, each individual node element would then have the additional context attribute called Address, where the name would be saved redundantly as part of the address.
    Calculated context attributes are a more elegant way of handling the example. These are not saved specially in the context, they are calculated (read) where necessary by the controller instead. “Where necessary” can mean that UI elements should display the content of a calculated attribute, or that the value is accessed by the program in the controller coding. The calculation method is called automatically by the Web Dynpro runtime environment. A calculated context attribute is calculated in an automatically generated access method using signature
    <CalcAttrType> get<NodeName><CalcAttrName>(<NodeName>Element element).
    For a calculated context attribute called FullNameCalc of type String in node UserData in the context of the FormView view, this results in access method
    java.lang.String getUserDataFullNameCalc(
    IPrivateFormView.IUserDataElement element).
    The calculation method is called automatically where necessary by the Web Dynpro runtime environment. It passes a reference to the node element to which the calculated context attribute refers. If this method were defined in a multiple node with cardinality 0..n, for example, then the access method would be called for each node element that is available in the node at runtime. In this way, the full name of a customer could be displayed in a third table column, consisting of first and last names. The access method would be called for each row (each node element) in the table.
    It is expected that the access method for calculating a calculated context attribute is based on the same node element’s other attributes.
    Within the generated access method for a context attribute, the context attribute to be calculated should not be accessed, as this results in the access method being called recursively. A recursion termination occurs only if you implement a recursion condition.
    According to the Web Dynpro naming convention, calculated context attributes should contain the ending Calc for Calculated in the name, such as SalutationCalc or TotalPriceCalc. This makes the application coding easier to read with respect to the components from the calculated context attributes.
    Regards
    Kalyan

  • Calculated attribute: Concatenated String not possible ?

    Hi,
    whats the syntax to make a concatenated String view in a calculated attribute of an analytical view ?
    For Example in metasyntax:
    <CONST> = 'EDF'
    CHANNEL_DESCRIPTION  = 'Internet'
    <CONST> || CHANNEL_DESCRIPTION  =  'EDF Internet'
    Is this possible ?
    How ?
    ThanXs
    Martin

    Hi,
    You can use the "+" operator to concat two strings.This will call the CONCAT function of NewDB Engine to concatenate the strings.
    (String1 + String2 in a Calc Attribute)
    Rgds,
    Murali

  • Calculated attribute setter & getter methods

    Hi,
    i want more information on Calculated Attribute setter method & Calculated Attribute getter method.
    i have a value attribute, to which properties of  CalculatedAttributeGetter &  CalculatedAttributeSetter values are given with the method names.
    Is it like whenever we try to set a value for that attribute the setter is called and getter is called whever tries to get value.?
    Please give more info on this.
    Attribute: Emp
    Setter: setEmp
    getter: getEmp
    Thanks
    Hussain

    hi,
        hope this link will help you.
    If we create a value attribute then there will be a property called "calculated",set that property as true then we get two methods called "getter" and "setter".This is to be used for setting some values to our variables and getting that.In java .
    ( used for Encapsulation purpose.)
    [http://help.sap.com/saphelp_nw70/helpdata/en/7f/a0384162316532e10000000a1550b0/frameset.htm]

  • How are calculable attributes influence on a performance

    Hi WD Experts
    I have recently faced with a small dilemma. Is it a good idea to use calculated attributes everywhere where it's possible? For example, I have a view with table. I can implement almost all logic in the view based on calculated attributes which will return values for icons, values for controls' visibility, values for textual labels in the table and so on.
    How does the approach influence on a overall performance of my UI when user interacts with such controls? Here I suppose that each calculated attribute itself does not take any valuable time.
    Thanx
    Sergei

    Roberto,
    They are recalculated on every access. Whenever UI should be rendered, they are recalculated.
    Some calculation are extremely cheap and do not impact performance:
    1.
    return element.getIsInProcessed() ? WDVisibility.VISIBLE : WDVisibility.BLANK;
    2.
    switch ( element.getSeverity() ) {
      case -1: return WDTextViewSemanticColor.DIMINISHED;
      case 0:  return WDTextViewSemanticColor.POSITIVE;
      case 1:  return WDTextViewSemanticColor.CRITICAL;
      case 2:  return WDTextViewSemanticColor.NEGATIVE;
      default: throw new IllegalArgumentException();
    3.
    final private static String[] STATE_ID2STATE_NAME = {"stopped", "starting", "running", "stopping"};
    return STATE_ID2STATE_NAME[ element.getState() ];
    On other hand, you have some large number of calculated attributes, that depends on the same condition, then it is better to create 1..1 non-singleton value sub-node, define all attributes here and populate them at once using supply function. Also you will not win a lot in terms of performance, the code will be far more maintanable while related calculations are not scattered across several methods.
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net
    Message was edited by:
            Valery Silaev

  • View link between calculated attributes

    Hi all,
    I'm having a problem with a view link. See, I'm linking two view objects on attributes that are calculated. The two view objects are result of sql query (not EO based) - plus, this attribute is present in the SQL query and in the db table for both view object.
    The SQL query is like, for both view object :
    select to_char(DATE_FO, 'dd/MM/yyyy), a, b, from ...
    And, as I said, I made a view link on these attributes. The cardinality is 1 to *.
    When testing the ApplicationModule, I'm getting
    (oracle.jbo.SQLStmtException) JBO-27122: SQL error during statement preparation. SELECT ....... ) QRSLT WHERE DATETOCHAR = :Bind_ToCharGdaCrahDateCrahDdMm
    ----- Level 1: Detail 0 -----
    (java.sql.SQLException) ORA-00904: "DATETOCHAR" : identificateur non valide
    DATETOCHAR is the alias of the calcultated attribute in detail vo.
    Please help ! Also I've been reading Steve's article : urlhttp://radio.weblogs.com/0118231/2003/11/13.html[url] ; what is jbo.viewlink.consistent property exactly ?
    Regards
    Luc

    Hi again,
    ok I found it ... I needed to add an alias in the SQL query and override the default sql where clause in the view link. Something weird btw, because the alias in the sql query seems to be not bind to the alias property in the attribute properties... and it add another attribute. But it works fine.
    Therefore, if Steve muench might explain jbo.viewlink.consistent property, I'm stil interested in knowing that :)
    Luc

  • Order calculating attribute dimension

    Hi all,I have an outine with 4 dimensions measure ( dimension tagged as accounts and desnse )Scenario (dimension tagged as dense)Year (dimension tagged as sparse) (Y02,Y03, Y04)store (dimension tagged as sparse)society (attribute dimension) ( soc1,soc2,soc3)The base dimension of the attribute is store.The dimension are displayed in the outline as described above.The dimension measure has a the following members price pieces number""medium price"= price/"pieces number" (tagged as dynamic and Two-pass calculations )the dimension Scenario has 2 members Actual , "Previous year" (tagged as dynamic and Two-pass calculations) with the following formula:if (@ismbr(Y03) ) Actual->Y02;elseif (@ismbr(Y04) ) Actual->Y03;endif;when I display from excel the memberssoc1 "medium price" Y03 "Previous year" Essabase produces incorrect results ( "medium price" is not price/"pieces number") why?Thanks, lucia

    1) Is year tagged as 'Time'?2) Why is the year formula two-pass?Rich SullivanBeacon Analytics

  • Trying to set a calculated attribute in an entity implementation java file

    Hi,, im working in Jdeveloper 9.0.3.2 in a web application and the problem is as follow:
    I have one table, This table has an attribute which value is calculated from another attribute in the same table. Take in account That it is not a trascient column, it is a real entity column in the entity object.
    First i tried this by using custom code in the validateEntity method but it was impossible because of the error: "JBO-28200: Validation threshold limit
    reached. Invalid Entities still in cache".
    next, i try the same by using custom code in the setter and getter methods by using the populateAttribute method and seems that transaction is successful but this result is only reflected in the entity cache so when im query directly the database this attribute is empty.
    I have not idea what to do.. im bored trying to get solution to this problem.
    Please help me!!!
    Thank u
    Orlando Acosta
    Infogroup Team
    Colombia South America

    Thank you very much for the answer.
    I tried to do what you suggested, but I get an error message when I tried to put session data into the user session object on my JSP page.
    Here is part of my codes in the JSP page.
    <%
    // Retrieve all request parameters using our routine to handle multipart encoding type
    RequestParameters params = HtmlServices.getRequestParameters(pageContext);
    String dsParam = params.getParameter("datasource");
    String formName = dsParam + "_form";
    String rowAction = "Current";
    String event = "Update";
    String userName = (String) session.getAttribute("userName");
    if (!(getDBTransaction().getSession().getUserData().containsKey("user")))
    getDBTransaction().getSession().getUserData().put("user",userName);
    %>
    And here is my error message.
    Error(16,16): method getDBTransaction not found in class _DecalDataEditComponent
    I got the other half working where I retrieved the session data in a setter method of an Entity Object Class as below.
    public void setDestroy(Date value)
    if (value!=null)
    setDestroyedBy((String)getDBTransaction().getSession().getUserData().get("user"));
    setAttributeInternal(DESTROY, value);
    Your help is very appreciated.

Maybe you are looking for