Reading Attributes of Class

Hi,
I want to read the attributes of the class, those arrtibutes i can see while debugging @ instance object of class.
It has deep structure with table values.
so could you please guide me how to go ahead and access the attributes programitacally?
Thaks,
Raghu.

Hi Raghu,
Not sure what exactly you mean by saying reading the attributes of the class. Do you want to read the values of the attribute? Then you can create an instance of the class and then read the attributes.
CREATE OBJECT lr_object.
IF lr_OBJECT if bound.
lv_attr =  lr_object->attribute1.
ENDIF.
There are lot of demo programs available in SAP. You can also refer them for proper syntax.
DEMO_ABAP_EVENTS_1
DEMO_ABAP_EVENTS_2
DEMO_ABAP_EVENTS_3
DEMO_ABAP_OBJECTS
DEMO_ABAP_OBJECTS_CONTROLS
DEMO_ABAP_OBJECTS_DIALOG_BOX
DEMO_ABAP_OBJECTS_EVENTS
DEMO_ABAP_OBJECTS_GENERAL
DEMO_ABAP_OBJECTS_METHODS
DEMO_ABAP_OBJECTS_SPLIT_SCREEN
You can search with DEMO* in SE38 for the entire list of DEMO Programs.
Hope this helps.
Thanks,
Samantak.

Similar Messages

  • Attributes of class

    hello,
         is der any table r RFC  FM which displayes the attributes of the classes.
    Actually my requirement is to compare the Attributes of classes of two servers .help me out ....

    Hi Ishwar,
                 Please have a look on these function modules.
    CLASS_READ_CHARACT             API: Direct Characteristics of Class (Witho
    CLASS_READ_CHARACT_ALL         API: All Direct and Inherited Characteristi
    CLASS_READ_CHARACT_ALL_ATTR    API: All Direct and Inherited Characteristi
    CLASS_READ_CHARACT_ATTR        API: Direct Characteristics of Class with A
    CLASS_READ_CHARACT_INH         API: Only Inherited Characteristics of Clas
    CLASS_READ_CHARACT_INH_ATTR    API: Only Inherited Characteristics of Clas   .
    Hope it resolves the query.
    Have a best day ahead.

  • Differentiate the inheritance relationsip v.s. the attribute of class?

    How do you differentiate the inheritance relationsip v.s. the attribute of class??
    Can any one give an example to support your arguments??
    <!---Thank You soooo Much-->

    It is a "has a" versus an "is a" relationship.
    If a dog is an animal, then Dog should inherit from Animal (the "is a" relationship).
    If a Dog has a DogHouse, then DogHouse should be an attribute of the Dog class ("has a" relationship)

  • Reading attributes of different context nodes

    Hello,
    I want to read attributes of BP_DATA/TaxNumberList Node: BUILHEADER from Node BUILTAXNUMBER.
    I have tried all without success. In GENIL Browser they are not related.
    What can i do?
    Best Regards
    JM

    Hi
    I checked in the Model Browser. Seems 'BuilTaxNumber' has 'BuilHeader' as parent.
    Can you validate once in TCODE GENIL_MODEL_BROWSER for ONEORDER Component set.
    Regards,
    Masood Imrani S.

  • I have a 2011 macbook pro, buy yet when I connect my 16GB or 8GB Sandisk Extreme class 10 30mb card, it wont read it, however, it reads a 2GB class 2 card, is there anyway to fix this?

    I have a 2011 macbook pro, buy yet when I connect my 16GB or 8GB Sandisk Extreme class 10 30mb card, it wont read it, however, it reads a 2GB class 2 card, is there anyway to fix this? and no, there is nothing wrong with the cards, they shoot fine, my dell inspiron 15 reads these cards fine, but yet my brand new macbook pro does not.

    After many days of frustration, I try a stupid thing.... Put the SD card in the Lock Position and... Voilá!
    The way I find to access the content is put the SD card in the Lock position..
    Cheers

  • Reading & writing binaries(.class files)

    folks,
    how does one go about reading and writing .class files in java. I am able to write 'em only in ASCII format which is not what i want.
    Thanks!

    Did anybody say anything about disassembling?He wants to read and write class files, it's the title of the post.
    I don't appreciate you dismissing my suggestions like that.
    There's plenty of gotchas in reading and writing class files, such as Longs & Doubles taking up 2 positions in the constant pool.
    Hence the reason why I suggested using an open source library like BCEL or ASM. These are still valid as class readers, even if you don't touch the byte code. ( disassembly )
    But what would I know Ejp....sure I only wrote my own Java 1.5 class reader / disassembler.

  • Reading Attributes from same context node of different attributes

    Hi,
    I  want read Attributes from same context nodes of diifrent attributes.
    I have attribute A and B of same node, want to get read value from  atrribute A into B.
    Regards,
    Brahmaji

    solved
    DATA: lv_current TYPE REF TO if_bol_bo_property_access.
       DATA: lv_value type String.
       IF iterator IS BOUND.
        lv_current = iterator->get_current( ).
      ELSE.
        lv_current = collection_wrapper->get_current( ).
      ENDIF.
      CALL METHOD current->get_property_as_string
            EXPORTING
              iv_attr_name = 'ZZAFLD00004Y'
            RECEIVING
              rv_result    = lv_value .

  • FOX: Read Attribute of time characteristic

    Hey Gurus,
    within my current planning application I maintained an Attribute for 0FISCPER3. Now I want to do some calculations where it is necessary to read this attribute but with standard function ATRV it is not possible.
    The execution of the Planningsequence always fails. In ST22 Methode IF_RSMD_RS_ACCESS~GET_ATTRIBUTES is called (* This method is not supported for these info objects).
    Does anyone know if it is not possible to read attributes of standard time characteristics ? If it's not I think the best alternative is to create a function module that reads my attribute.
    Cheers,
    Moritz

    Hi Moritz,
    can you please post your fox coding for this one? If it is a attribute of a characteristic you have to include the corresponding characteristic of the attribute (the attribute is mentioned as xxx within the coding):
    local_variable = artv(xxx, 0fiscper3).
    Did you try this?
    Brgds,
    Marcel

  • Access class attribute by class name

    Hi experts,
    Can anyone help me in next situation.
    I need access class static attribute by class name and attribute name. I have two initialized variables
    DATA: class_name(30) TYPE c,
    attr_name(30) TYPE c.
    In another words, I need to do attribute initializing like
    ZCL_IM_BM_VPA10_IMPL=>P_VAR_ZPLV_CLM = loc_var_range-low.
    but using char variables insead of reference to class.
    Thanks in advance,
    Max.

    You want dynamic access to a static attribute?  If these are your own Z classes, then rather than access the attributes directly, write getter and setter methods.
    Then you can use (as it is in the ABAP help on dynamic call methods ).
    TRY.
        CALL METHOD (class)=>(meth)
          PARAMETER-TABLE
            ptab
          EXCEPTION-TABLE
            etab.
        CASE sy-subrc.
          WHEN 1.
        ENDCASE.
      CATCH cx_sy_dyn_call_error INTO exc_ref.
        exc_text = exc_ref->get_text( ).
        MESSAGE exc_text TYPE 'I'.
    ENDTRY.
    btw - next time, post in the ABAP objects forum.
    matt

  • Not able to read attribute value

    Hello Experts.
    I have child WD component say u201CBu201D,  in this created node (Name : B) with one attribute (Name : Test) and selected as interface node.In this component I am setting the value for attribute (Name : Test).
    I have added above WD component u201CBu201D  in the parent WD Component u201CAu201D as Used Webdynpro Component. So I got node (Name : B)  in the component parent  Component u201CAu201D.
    When I am trying to read attribute (Name : Test) it is coming empty in Parent Component u201CAu201D.
    I have verified all the binding and basic things  everything looks fine but I am getting empty value in Parent Component u201CAu201D.
    Thanks in Advance.
    BR
    - CW

    I  want to access Attribute 'TEST 'of the Component B in Component A. Normally it should come if node is exposed as interface BUT It is not coming.
    Carlin,  you will get the TEST attributes value in Component 'A' only if the value for 'TEST' attribute is set in Component 'B'.
    in Component A, if you try to read the value of TEST attribute before its value been set in Component 'B' then you will get empty value only.
    in some way you need to tell the component 'B' to set the value for 'TEST' Attribute before accessing it in Component A.
    one way is to expose the SET_ATTRIBUTE method and calling the same from Component A
    another way is to embed the B's interface view into A's view and then explicitly clicking on the buttons in B's interface view.
    Unless the value is not set by Component B, if you it access in Component A, you will get initial value only.
    Hope its clear.
    BR,
    Saravanan

  • Read attribute value of a master data object's master data object

    Hi Guys,
    I have a peculiar condition where I need to read attribute value of a master data object's master data.
    Requisition (ZREQUI) is linked to Candidacy (ZCDCY) by object called Recquisition.
    Candidacy  (ZCDCY) is linked to Candidacy Activity (0CDCY_ACT) by object called Candidacy.
    I want to populate attribute called due date in ZREQUI by reading lowest value of due date value of 0CDCY_ACT. There can be multiple hits.
    If I can get the code to do this, I would really appreciate it.

    Here is the outline of the code ,as per my understanding..chk if it can help u
    In start routine write a select statement to pick all the data from 0cdcy_act.
    select 0CDcY_ACT ZCDCY  DuE_DATE from /BiC/P0CDCY_ACT
    into table itab1
    for all entries in source_package
    where ZCDCY = source_package-ZCDCY.
    as you need the lowest due date, sort the iTAB1
    sort itab1 by due_date  ZCDCY.   (default is acending order)
    In the field routine of your due date
    Read table itab1tnto wa_itab1 where
    ZCDCy = source_fields -ZcDcY.
    now duedate = wa_itab1-duedate.

  • IMAQdx Read Attributes.vi WRITES .icd file if none exists - AWFUL!

    I use "IMAQdx Read Attributes.vi" to load my GigE camera's configuration when the user wants to start grabbing frames.  I feed the path and filename into the "Filename" input as a string constant.  I just discovered that if I delete the .icd file from the disk, "IMAQdx Read Attributes.vi" does NOT throw an error (as I would expect when it can't find the file I told it), but instead just presses on with whatever configuration happens to be loaded in the camera's memory.  Then, to add insult to injury, this READ function takes it upon itself to just WRITE an .icd file out to disk containing the current camera configuration!
    Oh no!
    See, I don't want the user to be able to run with any configuration except that which is in the disk file.  With this functionality I've described, there is no warning that the user may not be running the correct configuration, PLUS the "sacred" location and filename on the disk which should only contain the pristine configuration file gets populated by some file that looks just right on the surface (has right filename, is in right location), but could contain whatever garbage was in the camera's memory!!
    I recommend NI change the behavior of "IMAQdx Read Attributes.vi" such that it throws an error code if the file is not found, and NEVER writes files.  Writing .icd files should be accomplished with "IMAQdx Write Attributes.vi".

    Thank you for your reply, BlueCheese.
    If by "the Open" you are referring to my use of "IMAQdx open camera.vi," then no, it is not that call which is creating the .icd file.  The text string showing the path and .icd filename is not fed to any vi until after my call to "IMAQdx open camera.vi," so that vi would not know where to write a "default" .icd.  I see in the Detailed Help for "IMAQdx open camera.vi" that it "loads a camera configuration file," but I do not know how you extrapolate from that that it "will create a default ICD from the camera config if one does not exist."  Maybe an "ICD" is not the .icd disk file, but rather the configuration set itself.
    Regardless, I'm quite sure it is the "IMAQdx Read Attributes.vi" that is doing the disk file writing.  Programmatically, I know how to get around it, no problem.  I can put in code to go check for the file before invoking the "...Read Attributes.vi," but my point is I should not have to.  NI should write the "...Read Attributes.vi" such that if the file does not exist, you get that as an output error.  This is the safe and logical way to go.  It also highlights my biggest gripe about LabVIEW (which I do like, by the way :-):  The "Detailed Help" is really lacking in a lot of ways.  Shouldn't "What happens if the file is not found on the disk" behavior be documented?  It isn't.  You have to write a sample program to tease out the behavior of almost any NI-provided vi.  It's a big waste of time.

  • Updating read only attributes of class/method

    Hi,
    I have this standard class CL_QNAO_OBJECT, with MS_DATA as read only attribute.I have written my own class in an enhancement within this class and now trying to edit this MS_DATA within my own class. but I get an error sayng "write access to the READ only attribute is not allowed", is there any way I can change it?
    The attribute MT_STACK is changing attribute/parameter to my class, which in turn has this ms_data structure.
    Note - I did search sdn before I put it here, I got couple of threads which I dont find suitable for me.
    Thanks in advance,

    Since MT_STACK is also type ref to CL_QNAO_OBJECT, my earlier guidance still hold true.
    Step 1 - When you enhance the class, you would see empty table lines in the class editor. Create a new method in that.
    Public Instance Method name Z_SET_MS_DATA
    Importing parameter IS_DATA TYPE QNAOD_AOBJECT
    Method implementation:
      ME->MS_DATA = IS_DATA
    Step 2 - In you enhancement in the class, call the method to set the data
      Data: ls_Data type QNAOD_AOBJECT
      Ls_data-field1 = ‘xyz’.
      core_object->mt_stack->z_set_ms_data( ls_Data ).
    Regards,
    Naimesh Patel

  • Read attribute of implementation class from context node

    hi experts,
    I need to access the implementation class from the context node,in component seged_tg/eltargetgroupitem. Node is targetgroupitem.
    Also if I can either access the component controller from the context node,I need to know how to instantiate the class.
    please help.
    regards
    Anu

    hi ,
    I discovered that we cannot access the child nodes from parent class,so instead I am using custom controllers

  • Function Module to Read attributes value from Classification tab

    Dear Experts ,
    We are using material classification in the material master. Under classification tab of material master , we are maintaining certain characteristics and their corresponding values.
    I want to read those values and use those in one of the report.
    Can you please help me in identifying Function Module which will return the values of all the attributes of that material.
    Thanks in advnce,
    Regards,
    Nikhil

    You can check those details using CT06 transaction.
    FM CLAF_CLASSIFICATION_OF_OBJECTS can be used to retrive the data using program.
        CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
          EXPORTING
            class              = gc_class
            classtext          = 'X'
            classtype          = gc_classtype
            clint              = gc_mmpsk
            features           = 'X'
            language           = sy-langu
            object             = l_object
            key_date           = sy-datum
            initial_charact    = 'X'
            change_service_clf = ' '
            inherited_char     = 'X'
          TABLES
            t_class            = lt_class
            t_objectdata       = lt_objectdata
          EXCEPTIONS
            no_classification  = 1
            no_classtypes      = 2
            invalid_class_type = 3
            OTHERS             = 4.

Maybe you are looking for