Getting the objects for a class

I am able to get all live classes of a dynpro by using method cl_gui_cfw=>get_living_dynpro_controls. (Also thanks to this forum).
The resulting table has a reference to a class like ...
How do I use this reference to:
1. Get the objects for it?
2. How can I then free the object from memory by using the "free" method.
I guess I am asking how to dynamically assign it, then make sure it has a free method and then to use the method to actually free it.

Hello Uwe
My first reaction was "NO it cannot be that easy!!". It almost was but on the second line I get a short dump. Then I realised why: the other live control in the table was a sub class of the first class and as a result it was cleared on the first call.
So I modified the call to be a recursive call (of the form) as follows...
form clear_live_controls .
DATA:
  gt_list       TYPE cnto_control_list,
  gt_wa like line of gt_list.
  REFRESH: gt_list.
  CALL METHOD cl_gui_cfw=>get_living_dynpro_controls
    IMPORTING
      control_list = gt_list.
  describe table gt_list lines tab_lines.
  if tab_lines = 0.
*    Nothing
  else.
     loop at gt_list into gt_wa.
       gt_wa->free( ).
       exit.
     endloop.
     perform clear_live_controls.
  endif.
endform.                    " clear_live_controls
This took care of it.
Many thanks for your help.
Regards

Similar Messages

  • Get the objects for getDeclaredFields

    Hi,
    Can I get the objects of the Fields in my class.
    I want to go through my Fields and find the ones with a certain suffix in there name. This I have done with getDeclaredFields. But know I want to get and set the data for the corresponding objects.
    for (Field zField : getClass().getDeclaredFields())
        if (zField.getName().endsWith("_Save"))
             // I need somethign that will do something like this. I know the next lines don't work
             Object zObject = zField.getObject();
             if (zObject  instenceof jCheckBox)
                 ((jCheckBox)zObject).isSelected();
    }Thanks,
    Shaul

    Shaul wrote:
    I'm sorry. I didn't understand that the object is the one that contains the objects that I need.Exactly. And if the field is static you pass in 'null'

  • How to programmatically get the source for a class provided the class name?

    Hello,
    As a quick background, I am providing some tools to potential users of an in-house framework. One is the ability to generate quick prototypes from our existing demo applications. Assume a user downloads our jars and uses them in their project (we are using Eclipse, but that detail should not greatly affect my question). Included in the jars is a demos package that contains ready-to-run classes that serve to exhibit certain functionality. Since many users may just need quick extensions of these demos, I am trying to provide a way for them to be able to create a new project that starts with a copy of the demo class.
    So, the user is provided a list of the existing demos (each one uses a single class). When the user makes their selection, with the knowledge of our framework, I can translate that into what demo class they need (returned as a string of format package.subpack1.subpackn.DemoClassName). What I now want to do is to use that complete class name to get the source (look up the file) for the corresponding class, and copy it into to a new file in their project (the copying into the project can be done easily in Eclipse, so what I need help with is the bolded part). Is there a simple way to get the source given a class path for a class as described above? You may assume the source files are included in the jars for the framework.
    Thanks in advance.

    If there's a file named "package.subpack1.subpackn.DemoClassName.java" in a "demos" directory in the jar, then yes. You'd just use
    InputStream code = getResourceAsStream("/demos.package.subpack1.subpackn.DemoClassName.java");Or if those dots in the name actually separate directory names, i.e. you have a "package" directory under "demos" and a "subpack1" director under that and so on, then:
    InputStream code = getResourceAsStream("/demos/package/subpack1/subpackn/DemoClassName.java");

  • Getting the object of a class that is already running

    there is one class a
    i created an object of class a
    a a1 = new a();
    i am in class B
    i want to get the 'a' class instance that is already running ie i want to access object a1 and these classes are not related. Can i get them?
    If yes how?
    It is urgent.

    1. class B could encapsulate class A.
    Class B
       A a1;
       public B(A a1)
          this.a1 = a1;
       //......remaining part of class
    }Now when you create an object of B, you could pass the a's object to B's constructor,
       A a1 = new A();
       B b1 = new B(a1);
      // to access the a object within b, usage is as below
       b1.a1.<a's methods>2. If you wish that the object of class A is required only in some methods of B, pass it as a parameter to B's methods
    class B
       public void someMethodThatNeedsA'sObject(A a1)
          //do something with a's object here
          //do something with B's own variables
       psvm() //main
           A a1 = new A();
           B b1 = new B();
           b1.someMethodThatNeedsA'sObject(a1);
    }ram.

  • Maximum no'of Objects for one class

    Hello friends
    Please, tell me....Maximum no'of Obects for One Java class.
    Thanks & Regards
    S.Rajakrishna

    Is there any limit of creating the objects for One class?Instantiated objects go into the heap. There is only one heap for the whole JVM. There is no correlation between objects in the heap and the individual class files.
    100,000 objects may or may not fit into the heap. In general they probably will. If you don't, then yes, you'll get an Out Of Memory exception.
    Regardless there is no excuse for loading 100,000 objects just to render a JSP! You don't imagine your user is going read all of them do you? Restrict them to the number of objects that the user is actually going to be able to handle at any given time.
    You can do this by putting WHERE clauses on the hibernate query, and/or by setting limits (setFirstResult and setMaxResult) on the Query object before listing it.

  • How to get the object class field value in CDHDR table for vendor

    hi
    how to get the object class field value in CDHDR table for vendor

    Try KRED/KRED_N as object class in CDHDR for Vendor.

  • How to get the values for the Authorization Object Fields....

    Hi Everyone,
    I'm pretty new to the SAP Security and have been working on the Basis sides...I created a new role in PFCG and added a few transactions (ME13) and clicked on the Authorizations tab. In there, the authorization tree is in yellow and red. After providing the Org Values, only the yellow lights remain (apart from the green one ofcourse). Now how do we get the values for the different auth obj fields that are in yellow... say for example
    Conditions                                                   COND
    Maintain Condition: Auth. for Use/Appl./Cond.Type/Table      V_KOND_VEA
    Activity                       03                                                                        ACTVT
    Application                                                                                KAPPL
    Condition table                                                                                KOTABNR
    Condition Type                                                                                KSCHL
    Usage of the condition table                                                                 KVEWE
    Here the values for V_KOND_VEA fields e.g. KAPPL, KOTABNR etc are missing.
    My question is how do we get these values in regard to the requirement provided by the client...is it the functional guys who provide these values or else how is a security person supposed to know it...
    All the help in this regard is sincerely appreciated along with the awarding of points...

    Hey thanks Alex and Catastrophe for the quick response...
    I'll be sitting with the functional team and reviewing the roles created.
    Thanks for all the help once more
    Regards,
    Akash.

  • Is it possible in an html to call the objects of a class?

    Hi,
    Please help me.I have already posted it, but it's very urgent i am in need for an working answer.
    I am calling an applet class 2 times in a browser.To share some variable i have declared as private static. But when i call these applets are called in different browsers , still these variables are shared.
    Actually i want the applets in one browser to be independent of the other applets in a separate browser. Can anyone help me to solve this problem?
    Is it possible in an html to call the objects of a class?
    Is there any some workarounds? For instance calling applets in separate JVM in the same machine.Any idea how to do that?
    Another option is using something like the session variables. But is that possible in a variable inside the applet class?
    Thanks in advance to all the solutions. Hope someone clicks an idea from the above possibilities.

    To get a reference to other applets in the same JVM (actually same browser window), do the following:
    //get a reference to the other applets in the same browser window
    java.applet.AppletContext appCon = yourAppletRef.getAppletContext();
    JApplet applet = (JApplet) appCon.getApplet(otherAppletName);or use AppletContext.getApplets() to get an enumeration of all the accessible applets. If you want to use the Session object to store your values, then, in your javascript, make a call to the applet methods. Use JSP expressions for the value of these session String values (i.e. <%= %>) to set the parameters of your applet methods. In a nutshell, it is possible. I hope this helps.

  • How to get the values for checked and unchecked chekboxes

    Hai i have using the checkbox in for loop.
    I need the urgent help from anyone,
    for example in the loop there is having 5 checkbox if i checked 3 of the ckeckboxes and 2 of the checkboxes are unchecked. I need to get the values for checked checkboxes and unchecked checkboxes. Because if i checked the checkboxes, those values need to be inserted into the database. Those for unchecked checkboxes values need to be deleted from the database. Can anyone help me for this
    i am using the following jsp code for this. If anyone can know about this please post me the sample code.
    <form name="confirmcontainer" id="confirmcontainer" method="post" action="submit.jsp">
    <% for(int i=0;i<value.length;i++) {%>
    <tr>
    <td><input name="assigncontainer_chkbox" d="assigncontainer _chkbox" type="checkbox" value="<%=value[0]%>"></td>
    <td class="bottomborder"><div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><%=value[1]%> </font></div></td>
    <td bgcolor="#FFFFFF" class="bottomborder"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><%=value[2]%></font></td>
    </tr>
    <% } %>
    <tr><td><input type="submit" name="submit" value="submit"> </td></tr>
    </form>
    Thanks & Regards,
    Tamilvanan

    Hey thanks Alex and Catastrophe for the quick response...
    I'll be sitting with the functional team and reviewing the roles created.
    Thanks for all the help once more
    Regards,
    Akash.

  • OIM - Task Assignment Adapter - How to get the object instance key?

    Hello experts,
    I'm trying to use a task assignment adapter to assign an approval task dynamically. Basically, the user can request a resource like "CustomApp Profiles" and we create an object form to let them choose the profile that he needs. Each profile has an owner, which is populate in a Lookup (Owner is the code and Profile is the decode).
    So, in the approval task, I need to get the profile selected by user in the object form and search into the lookup who is the owner of that profile. But I don't know how can I get the object instance key using the parameters that can be mapped to a task assignment adapter.
    Looking into the OIM documents, I believe that the easier way is using the request key, because the REQ_KEY is a foreign key in OBI table.
    Did anyone knows how can I get the object instance key using the request key? Can I use some API or should I execute a SQL statement directly in OIM database?
    Best Regards,
    Nitto

    To retry a task that is in a rejected state, you use the SCH_KEY which is the task key.  In OIM, all rejected tasks are listed in the OTI table.  It contains all the important information about a rejected or pending task.
    You can use the APIs found in the tcProvisioningOperationsIntf class to retrieve open tasks.
    -Kevin

  • Getting the object id after persisting

    Is there an easy way of getting the object id after using the persist method? I tried the following code piece but it didn't work. Do I have to run a query? I'm new to JPA and waiting for your suggestions. Thanks..
    Bill b = new Bill(); .... .... entityManager.persist(b); int id = b.getId()

    I tried flushing and refreshing the entity but got an EntityNotFoundException.
    Bill b = new Bill();
    entityManager.persist(b);
    entityManager.flush();
    entityManager.refresh(b); // Here where the exception is thrown
    int id = b.getId();When I try without refresh, it still get no id

  • Create  object for a class in jar file

    Hi
    I am using Oracle JDeveloper 10g. I have created a main application using Swing/JClient technologies. I am facing a problem for the past one week. I let u all people know my problem and I kindly request you to send a solution if known possibly confirmed.
    Problem: I have created a main application using swing that class extends JFrame. This main application consists of two parts. One left side panel and one right side panel. Left side panel contains JTree component. Each item in that tree refers to a class file located in a separate jar file.i.e that acts as a separate application. If we are executing separately that jar file class, I am able to see that small application running. If I am selecting an item in JTree during runtime, I should place that small application from the respective jar file in the right side panel of the main application. I can locate the jar file and even I can create object to that particular class file. But I cannot execute the application even separately and also not able to place in the right side panel of the main application.
    Note: The small application from the jar file contains one class file containing main method. That class file extends JPanel and implements JUPanel. i.e., with data binding. I am trying to create an object for this class file with data binding from my main application. Navigation bar is used in the main class file.
    If possible can any provide me solution at the earliest. Waiting eagerly for the positive reply.
    Regards,
    s.senthilkumar

    Can you sure that there is only a A class in the classpath of Tomcat, I advise you to add
    some statements into the A class so that you can be sure which classloader is used
    to load the A class.

  • jsp:useBean error== The value for useBean class is invalid

    Can anybody tell me why am i getting the error for the JavaBean.
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: /SimpleBean.jsp(9,0) The value for the useBean class attribute com.stardeveloper.bean.test.SimpleBean is invalid.
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
         org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1272)
         org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1178)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
         org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
         org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
         org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
         org.apache.jasper.compiler.Generator.generate(Generator.java:3426)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:216)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.
    Apache Tomcat/6.0.20
    my jsp file is in path c:\tomcat6\webapps\dev\SimpleBean.jsp
    my JavaBean compiled class is in path
    c:\tomcat6\webapps\dev\WEB-INF\classes\com\stardeveloper\bean\test\SimpleBean.class
    and my SimpleBean java class declaration is
    package com.stardeveloper.bean.test;
    public class SimpleBean implements java.io.Serializable
    and my jsp page SimpleBean.jsp pages call to useBean is as follows
    <jsp:useBean id="simple" class="com.stardeveloper.bean.test.SimpleBean">
         <jsp:setProperty name="simple" property="name" value="Sujoy" />
         <jsp:setProperty name="simple" property="age" value="26" />
    </jsp:useBean>
    Please help me anybody.

    First, try restarting Tomcat :-)
    Main 3 reasons for "useBean class is invalid"
    - class must be in a package (ok)
    - class must be public, and have public constructor that takes no arguments (check)
    - class must be compiled, valid and on the classpath. Normally this means the WEB-INF/classes directory.
    From what you have told us, everything seems to check out.
    Try recompiling the .class file to ensure it is valid.
    Does your constructor do anything which might thrown an exception?
    Can you invoke it in scriptlet code without getting an exception?
    <%@ page import="com.stardeveloper.bean.test.SimpleBean" %>
    <% SimpleBean sb = new SimpleBean() %>Trying it in scriptlet code like this might give you a different error message that might help your diagnosis.
    cheers,
    evnafets

  • What is the object for ?

    Hello,
    I need to do a program which show the result of a select in a DataBase.
    I would like to show them as in a peer to peer software, I mean in different categories that I could possibly sort by clicking in the name of the category. What is the object for that.
    Thank you.
    PS: Excuse my english, I'm french

    ummm...I don't really understand what you are asking for. But you know that objects are created from a class and it inherits the attributes of that class. It could either be from the built-in classes of java or the one that you built on your own. I suggest looking at java help and see if there are any classes that can satisfy what it is that you want to do, if none does, then you're gonna have to create a class of your own then create an object from that...not sure if this answers your question, i'm kinda like shooting in the dark here....=)

  • TestStand create different object for singleton class

    Hi all,
    we have a singleton class which has some functions used to do testing a harware.
    Our main Exe will create an object for that singleton class(which opens Com1 port and communicate with hardware). so the Exe will do basic communication test with hardware it is working well. We are using Teststand operator interface to do various testing by using sequence files. Main exe will use teststand usercontrols to execute tests when the user clicks Testbutton. after that, teststand try to create an object for that singleton but it returns new object not the existing one which is created by EXE. So it throwing me exeception "Com1 port access denied." (since we created object for signleton class @ very first in EXE)
    My question is Since that teststand runs in a separate Appdoamin will the singltonclass create separate object for different appdomain? if so is there any solution to reslove this?
    Hope i clearly explained my probs.
    Thanks in advance
    Srini 

    Hi Srini,
    How are you calling the executable?  From a Call Executable step?  Or are you using another means of calling it?   Also, why is TestStand trying to recreate the object?  As long as you have the correct handle to the object I don't think it matters what app domain you are in.
    Regards,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

Maybe you are looking for

  • Can I have an Australian account and UK account in itunes and still access on same pc/iphone? I live in both countires for part of the year.

    I currently have a UK based account but I am in Australia for about half of the year (have both UK and Aussie based bank accounts) is it possible to have iTunes accounts in both contires. Especially as there are loads of songs on the iTunes Australia

  • Problem with this query

    Hi We are using this query SELECT ........... FROM TRIP JOIN TRIPEXTENSION ON TRIPEXTENSION.TRIPID = TRIP.TRIPID JOIN FOREIGNRECLOC ON FOREIGNRECLOC.TRIPID = TRIP.TRIPID JOIN CUSTSEGCONTROL ON CUSTSEGCONTROL.TRIPID = TRIP.TRIPID JOIN CUSTOMERCONTROL

  • Purchase group in ME59N

    Hi Experts, We had two service PRs with different purchase group with same source of supply. as per standard sap PO has only one pg, can you please confirm which purchase group should be picked in po(auto po created by batch jobs) Thanks in Advanced

  • IPVPN Connection Between 2 ASAs

    Hi, I have the setup below, where IPVPN_A is an existing network and IPVPN_B will be a new network. Looking at exising configuration for IPVPN_A, there's no NAT configured on ABC and XYZ firewalls, just routing. For example, from ABC I route to XYZ v

  • InDesign CC 2014 does not update to 2014.2

    same problem here guys, it will not update to the latest version on any of the programs this is very frustrating