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]

Similar Messages

  • Dynamically creating setter/getter methods

    Hi All,
    I want to created a Java Bean with setter/getter methods. I know how to do this for fixed number of items like setProduct1,setProduct2 etc . BUT in my case, I can have variabe number of Products and hence want want to create setProduct1...setProductn methods. Any help to do this will be greatly appreciated. I can know in advance how many of setter methods I have to create but they may vary with each request.
    Thanks
    Vinod

    Instead, maybe try making a bean with methods such as this:
    public void addProduct( Product product ) {
        this.products.add( product );
    public List getProducts ( ) {
        return ( this.products );
    }

  • Auto method description for setter/getter methods

    hello forum,
    iam new to JDeveloper 10.1.3.3 . It takes lot of time to write javadoc comment(method descritpion) for each and every setter/getter method.How can i set auto generated method description for setter/getter methods like action method in struts.for example to setter method :Sets value of in_empnm. How can i get like this description while creating setter method?

    Hi Frank,
    Actually i want to generate 80-85 fields getter/setter methods for one jsp page.I already created java bean by using 'Generate accessors ' option.But Now I should write java code comments for each and every setter/getter method.So for every jsp i must attempt to write 160-170 comments(method description). It will take lot of time.All setters/getters javadoc comment is simmillar, right.So i don't want to give descption for each & every method.Simply Jdeveloper will generate java doc comment.How can i do?By using
    Preferneces-->Code Editor -->Code Template
    How will i write description for methods.Because methods are not simmillar.For instance setIn_empNo(),setVr_empName(),setDe_Sal().

  • Setter/getter

    Somewhere in this forum (I can't seem to find it at the moment), someone said one should not use "setter/getter" methods because it "breaks encapsulation."
    Well, in the database world, there is a term called "normal" when describing an ideal data set. One of the properties of "normal" data is that there are no duplications but, clearly, two people can make the same salary. So, the number 38500 may appear in a table twice - making a "normal" situation a textbook situation which one strives to approach as closely as possible.
    Isn't "encapsulation" the same kinda thing?

    Well, in the database world, there is a term called "normal" when describing an ideal data set. No, in the database world there are algorithms that reduce the expression of relations upon a data set to being functional dependencies on the primary keys.
    One of the properties of "normal" data is that there are no duplications but, clearly, two people can make the same salary. In that case the functional direction would be from person to salary, so the normalised form of the relation would be to say 'two salaries cannot be made by one person'.
    So, the number 38500 may appear in a table twice The relations in the classical normal forms are injective functions, not bijective or surjective, so you can have 38500 twice in a normalised table if it is the result of the 'salary_of_employee(x)' function for more than once value of x.
    making a "normal" situation a textbook situation which one strives to approach as closely as possible.Firstly, the classical normal forms can always be achieved without loss of expressivity, so if you're striving and failing, something's in fact wrong. In this sense it's no different than saying 'getting the right answer when you add two numbers together is a textbook situation which one strives to approach as closely as possible'
    In both cases - normal forms and addition - there are reasons (eg cpu time computing joins, precision of floating point hardware) where you may choose not to get the textbook answer for performance reasons.
    Isn't "encapsulation" the same kinda thing?Not quite. Most OO languages lack the formal vigour that you could prove that encapsulation is achievable in all cases.
    But they both get misunderstood, and IME ignoring them often results in more work in the longer run.
    Whether that matters is more of a business decision than anything to do with computer science.
    Pete

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

  • Regarding setter and getter methods

    Hi,
    Can anybody tell me the use of setter and getter methods in webdynpro .
    It is generated when we set the calculate property of value attribute to true .
    Thanks a lot .

    Hi Jain
    <b>setter</b> and <b>getter </b>functions will be created when you set the calculated propertyto true
    Consider the following scenario where in you can get some basic idea
    1) First insert a Child "Image" UI Element
    2) Create a Context in a view in which you are using Image UI Element
    3) Value Node
    Name : Image
    Cardidality : 1..1
    4) create 2 Value Attributes
    4)a ImageAlt (Calculate property - true) //this will create getter and setter methods
    4)b ImageSrc (Calculate property - true) //this will create getter and setter methods
    5)Bind the properties of Image
    alt - Image.ImageAlt
    source - Image.ImageSrc
    6) in getImageSrc()
    retrun "XX.gif"
    7) in getImageAlt()
    return "Image Not Available"
    you can even achieve getter and setter methods by doing the following procedure
    goto <b>implementation</b> tab-> rightclick -> <b>source</b> -> <b>generate Getter and Setter methods...</b>
    Best Regards
    Chaitanya.A

  • MVC Problem with getter method of table attribute in model class

    Hi,
    I am on 620 SP34. I am writing a bsp application with mvc. One of the model classes has an attribute of type table. I use this attribute in a htmlb-tableview and '//MODEL/ZMY_TAB' for data binding. If I try to activate a getter method for this attribute, the application dumps with exception <i>BSP exception: Structure component with name "ZMY_TAB" does not exist</i>. I find the SAP source, that raising this exception (see below). The source code looks like: <i>"I don't support getter methods for tables in attribute path"</i>! The setter method works fine, so I am at a loss. Has anyone of you wrote a getter method for an table attribute in bsp-mvc? Have I to consider anything special?
    Thanks,
    Carsten
    Main Program CL_BSP_MODEL==================CP
    Source code of CL_BSP_MODEL==================CM00Z
    METHOD IF_BSP_MODEL_BINDING~GET_ATTRIBUTE_DATA_REF
           * check if attribute exists for binding!                                   
             if exists_attribute( l_name ) is initial.                                
               return.                                                                
             endif.                                                                               
    * setter or getter defined? Not supported for DATA REF requests            
             if get_getter( attribute_name = l_name ) is not initial.                 
               raise exception type cx_bsp_inv_component                              
                 exporting name = l_name.                                             
             endif.                                                   

    You have two options:
    1. Make your attributes public. It should work fine.
    2. If you need to process the attribute values before it is used, you can make the attribute private but will need three methods
    GET_T_ZMY_TAB that returns the table
    SET_T_ZMY_TAB that sets the values
    GET_M_T_ZMY_TAB that returns DDIC information about the attribute. The same holds good for structures(Change to GET_S_ and GET_M_S_ ) and simple attributes(Change to GET_ and GET_M_).
    The set and get methods are kind of documented at http://help.sap.com/saphelp_nw04/helpdata/en/fb/fbb84c20df274aa52a0b0833769057/content.htm but there is no mention of the GET_M_ methods. I could not find one single document on the Model part MVC.
    Once I added the GET_M_XYZ methods to my attributes, my BSPs started to work fine.
    Cheers
    Sreekanth

  • How to get the one attribute value in another attribute getter method

    Hi,
    I have a requirement to get one attribute's value in the another attribute getter or setter method.
    Help needed ASAP.
    Thanks,
    sreenivas.

    Check if both the attributes are under the same context node.
    If so directly call the getter method of the other attribute here like this:
    lv_customer_type = me->get_customer_type( attribute_path = 'STRUCT.CUSTOMER_TYPE' ).
    If it is under a different context node,check if it is available from some relation, if so
        lr_agr_rel = current->get_related_entity( iv_relation_name = 'TpmAgrre'l ).
         CALL METHOD lr_agr_rel->if_bol_bo_property_access~get_property_as_value
            EXPORTING
              iv_attr_name = 'EXTERNAL_ID'
            IMPORTING
              ev_result    = lv_cust_plan_id.
    Regards,
    Masood Imrani S.

  • Customizing order for setter and getter methods in ViewRowImpl

    I have problem to calculate value for one attribute of my viewObjectRow which depends on values of other attributes in my row and result of stored function. I menaged to do all of this except getting value one of attributes that i need. Order of calling getter methods doesn't fit me. I tried lot of things, but nothig worked! Is there some way to customize calling order for getter and setter methods in ViewRowImpl and How?
    Thanks!

    but why addign javadoc to a getter/setter anywhy?Oracle [url http://download.oracle.com/docs/cd/E16162_01/apirefs.1112/e17483/oracle/jbo/common/AccTravDefImpl.html#getAccTravQualifiers()]does, so it must be OK :)
    But as Timo says, there's no automatic way that I know of. I suppose you could do something like that by making your own code template.
    John

  • Abstract class with set and get methods

    hi
    how to write set and get methods(plain methods) in an abstartc class
    ex: setUsername(String)
    String getUsername()
    and one class is extending this abstract class and same methods existing in that sub class also..... how to write......plz provide some ideas
    am new to programming....
    asap
    thnx in advance

    yes... as i told u.... i am new to coding......
    and my problem is ..... i have 2 classes one is abstract class without abstract methods.. and another class is extending abstract class.....
    in abstract class i have 2 methods...one is setusername(string) and getusername() ..... how to write these two methods.... in abstract class i have private variables username...... when user logins ..... i need to catch the user name and i need to validate with my oracle database and i need to identify the role of that user and based on role of that user i need to direct him to appropriate jsp page.......
    for that now i am writing business process classes..... the above mentioned two classes are from business process.....
    could u help me now
    thnx in advance

  • Oracle.jbo.AttrValException: JBO-27019: Get method for attribute

    Hi Guys,
    I am trying to add a new column to Oracle quoting.It has already been customized by some consultant few years back. I followed the note 392728.1 on metalink and also have the documentation by the previous consultant but getting the error oracle.jbo.AttrValException: JBO-27019: Get method for attribute Draft in HeaderVO could not be resolved after adding my column, when I try to print the quote.
    Here are the steps I took
    1) added a column to the query (at the end) in HeaderVO.xml
    2) added the below code in the HeaderVO.xml
    <ViewAttribute
    Name="DRAFT"
    IsQueriable="false"
    IsPersistent="false"
    Precision="100"
    Type="java.lang.String"
    AliasName="DRAFT"
    ColumnType="VARCHAR2"
    Expression="DRAFT"
    SQLType="VARCHAR" >
    <DesignTime>
    <Attr Name="_DisplaySize" Value="100" />
    </DesignTime>
    </ViewAttribute>
    3). Modify HeaderVORowImpl.java file to add setters and getters for the newly added view attribute. For example,
    a) case 67: //
    setDRAFT((String)obj);
    return;
    b) case 67:
    return getDRAFT();
    c) ublic void setDRAFT(String s)
    setAttributeInternal(67, s);
    public String getDRAFT()
    return (String)getAttributeInternal(67);
    d) protected static final int DRAFT = 67;
    Everything is dont exactly as per the manual but not sure why I am getting this issue. Any help will be appreciated.

    a) case 67: //
    setDraft((String)obj);
    return;
    b) case 67:
    return getDraft();
    c)public void setDraft(String s){
    setAttributeInternal(67, s);
    public String getDraft(){
    return (String)getAttributeInternal(67);
    d) protected static final int DRAFT = 67;
    can u change it as explained above.. setDRAFT should be setDraft.. and getDRAFT should be getDraft..
    and make sure that the index.. number is exactly matching with the attribute order in the VO

  • Accessing Custom Controller from setter and Getter methods

    Hi Gurus
    How can we access the custom controller from setter and getter methods,is there any way to do that.
    Thanks & Regards
    Rajasekhar

    Hi Steve.
    Thanks very much for valuable information,  the main controller class is getting tracked in mo_owner which is declared as  CL_BSP_WD_VIEW_CONTROLLER, and I'm getting the reference through
    mo_owner ?= owner. (since mo_owner = owner is not getting converted of type mo_owner ). After doing this on whatever the contexnode class (say zl_xxxx_xxx_cnxx) the corressponding context node values are getting turned as  <#ERROR IN METADATA.
    I mean when I'm checking the configuration in bsp_wd_cmpwb configuration tab -> Available Fields->Enlarge the contex node->BTSTATUS (say for Example) there the values are showing as <#ERROR IN METADATA , After executing the above procedure
    I cross checked several times before and after redefining the context node method IF_BSP_MODEL~INIT, before redefining this method UI is working fine, after redefintion UI is throwing below error .
    Exception Details
    CX_SY_REF_IS_INITIAL - Dereferencing of the NULL reference
    Method: CL_BSP_MODEL=>IF_BSP_MODEL_BINDING~IS_ATTRIBUTE_VALID
    Source Text Row: 13
    Thanks & Regards
    Rajasekhar

  • How to set/get the archive file attribute?

    I am programing a (freeware!) ftp client and need to know, how to set/get the archive attribute of a local file. I was searching through whole the i-net - nothing at all!
    please help me!!

    Hi,
    Since not all operating systems support the archive attribute, this ain't included in the JDK.
    If you're using Microsoft Foundation Classes for Java, then you can use File.getAttributes(String path) and check whether the result equals FileAttribute.ARCHIVE.
    For setting the attribute, you can use
    File.setAttributes(String path, FileAttribute.ARCHIVE)
    Of course this is all Microsoft-specific stuff.
    Hope this helps,
    Kurt.

  • Why Set does not have get() method

    Can some one tell me why set does not have get method?...

    user12203354 wrote:
    ya u are right that designer of this class thought there is no implementation required for get but why he/she thought like this...
    there must be some valid reason for the same.Because a Set's purpose is not to keep things in order; it's to ensure there are no duplicate entries. Set would require extra code to be able to keep track of an order.
    Note that there is a Set implementation that does keep track of insertion order--LinkedHashSet--but it doesn't have a get() method.

  • Get method in the Attribute class. in JNDI

    I had connected to the AD
    // Create the initial directory context
    DirContext ctx = new InitialDirContext(env);
    Attributes attrs = ctx.getAttribute("DC=DomainDnsZones,DC=testing,DC=local");
    but I had no idea wat to get from the attrs.get method.
    as in, I don't know what kind of attributes ID are available inside my attrs
    is there any coding to get all the attribute ID so tat I can use the get method to retrieve them?

    We can get the available Attributes for a particular user.....
    using Attributes class for a Search and Context....
    You can try out the free LDAP viewer available in internet (Its a Applet)... u can find the possible Attribute Names in that... and use the below statement..
    Attributes attrs1 = ctx.getAttributes("CN=" + "user,CN=Users,DC=domain,DC=dmn,DC=com");
    String office = (String)attrs1.get("physicaldeliveryofficename").get();

Maybe you are looking for