Using container from another global class

There are two global classes being used by me in a program - Class A and Class B.
  Class A contains the container to display ALV.
  Class B contains the logic to display ALV.
  class B is used as attribute class in Class A.
  How is that I can use the container from Class A from class B?

Like this?
class A ...
   public section.
      methods: get_container returining value(ref_cont) type ref to ...,
                      constructor.
   private section.
      data ref_container type ref to....
endclass.
class A impl...
   method get_container.
        ref_cont = me->ref_container.
   endmethod.
   method constructor.
      create object ref_container ....
   endmethod.
endclass.
class B ...
   public section.
       methods: constructor,
                      display alv.
   private section.
       data ref_alv type ref to....
       data ref_A type ref to A.
endclass.
class B impl...
   method constructor.
       data lr_container type ref to ...
       if ref_A is not bound.
            create object ref_A.
      endif.
      "get container from class A
       lr_container = ref_A->get_container( ).
       create object ref_alv
            exporting
                 container = lr_container
   endmethod.
   method display_alv.
        call method ref_alv->set_table_for_first_display...
    endmethod.
endclass.
If storing container's reference under local LR_CONTAINER in class B constructor causes not displaying ALV, you will have to store this under class B attribute. Alternative would be directly indicating the container reference as parent to ALV by calling functional method like
create object ref_alv
      exporting
           container = ref_A->get_container( )    
this will however work in recent releases of SAP NW AS.
Regards
Marcin

Similar Messages

  • Is it possible to call a subscreen/modal dialog box from the global class

    Hi,
    Is it possible to call a subscreen or modal dialog box from the global class ..
    or is there any option to display a pop screen or subscreen in order to get the values from user which as to be implemented
    in the global class..
    thanks and regards,
    Poornima.

    Hi Poornima,
    you should follow Uwe's suggestion. The only alternative I can imagine is dynamic document in a dialog container. But I don't know any standardized classes to make use with minimum effort. Have a look at report DD_ADD_FORM_INPUT. Here they put the input field in a container control in a screen; you can put the container control on a dialog container (CL_GUI_DIALOGBOX_CONTAINER).
    We will not get rid of any screen for the time being, but if your application is started from any screen, the DIALOGBOX_CONTAINER can start from there.
    Regards,
    Clemens

  • Creation of Material using BDC Session method & global class

    Hi
    Creation of Material using BDC Session method & global class by using oops.
    can anyone plz help me out

    Hi,
    it looks like it's not possible to call this BAPI wihtout material number. Here is a quote from BAPI documentation.
    When creating material master data, you must transfer the material
    number, the material type, and the industry sector to the method. You
    must also enter a material description and its language.
    Cheers

  • Can we use Result from another query in Webi using Bex uery universe?

    Hi,
    Can we use Result from another query filter option in Webi to create a report using a Bex Query universe?
    I need to create a report using two universes, one is Bex Query Universe and the other is Orcle universe. I have two queries, one is using Oracle universe; the other using Bex Query universe. I need to pass the Oracle data from the Oracle query to the Bex Query query to get the matched data from SAP Bex query.
    I used Result from another query in the query filter panel for the query using Bex query universe. But I got an error saying that 'A filter contains a wrong value. you cannot run this query. (Error: WIS 00007). The data used in the filter on both sides are the same. they are char.
    I have tested by using two queries from the same Bex query universe to see if the Result from another query filter option works. And I got the same error.
    Has anyone run into the same issue and if this is possible and what should be the solution?
    Thanks in advance!
    Edited by: BO_Haiyan on Oct 6, 2010 3:47 PM

    In that situation:
    Create two queries : Oracle and BW query.
    @ Report:
    As you have to see result set from both the Dataproviders, correct? To achieve thise one must have common dimension objects to merge them at report and use Objects those are coming from both queries to use them in single Table/Report.
    Unless you don't use Merge Dimensions, you don't get a chane to use both queries objects in single Table/Report. (It will give tooltip saying: You can't drop here -- Incompatable Objects)
    In case, if you don't have common dimensions, change object definitions to Detail objects, for those required.
    Hope it helps you.
    Thank You!!

  • How to call a Java class from another java class ??

    Hi ..... can somebody plz tell me
    How to call a Java Class from another Java Class assuming both in the same Package??
    I want to call the entire Java Class  (not any specific method only........I want all the functionalities of that class)
    Please provide me some slotuions!!
    Waiting for some fast replies!!
    Regards
    Smita Mohanty

    Hi Smita,
    you just need to create an object of that class,thats it. Then you will be able to execute each and every method.
    e.g.
    you have developed A.java and B.java, both are in same package.
    in implementaion of B.java
    class B
                A obj = new A();
                 //to access A's methods
                 A.method();
                // to access A's variable
                //either
               A.variable= value.
               //or
               A.setvariable() or A.getvariable()

  • How to use abap memory in global class

    Hi experts,
                     I want to  know how to use abap memory in global class. when i try write export and import statement its showing
    error is export statement does not support in object oriented concept.
    Thanks
    Ramesh Manoharan

    Hi Ramesh,
    Export and import statements were not allowed to use in  classes. Create a global variable in public section of that class of type of  export parameter.Then pass value to the global variable of class  by calling that class.
    by
    Prasad GVK.

  • Using data from another View

    Is it possible to create a new Grid in the same analysis where calculated/Grand Totals columns/rows may be used?
    I understand there is a feature use results from another analysis but wonder if it can be used in the same. Thanks.
    Adi

    Hi,
    Say you have a report for retrieving Sales by Products for a company and showing up grand total of sales for all products too in the same report. So, how about a case where you would like to see each product's contribution to the whole sales numbers? For this, a new column could be something like
    Measures.Sales*1.0/SUM(Measures.Sales)
    Here Measures.Sales is the sales for each product and SUM(Measures.Sales) is nothing but the total sales ie grand total.
    Hope this helps.
    Thank you,
    Dhar

  • How to refresh a JTable of a class from another thread class?

    there is an application, in server side ,there are four classes, one is a class called face class that create an JInternalFrame and on it screen a JTable, another is a class the a thread ,which accept socket from client, when it accept the client socket, it deal the data and insert into db,then notify the face class to refresh the JTable,but in the thread class I used JTable's revalidate() and updateUI() method, the JTable does not refresh ,how should i do, pls give me help ,thank you very much
    1,first file is a class that create a JInternalFrame,and on it there is a table
    public class OutFace{
    public JInternalFrame createOutFace(){
    JInternalFrame jf = new JInternalFram();
    TableModel tm = new MyTableModel();
    JTable jt = new JTable(tm);
    JScrollPane jsp = new JScrollPane();
    jsp.add(jt);
    jf.getContentPane().add(jsp);
    return jf;
    2,the second file is the main face ,there is a button,when press the button,screen the JInternalFrame. there is also a thread is beggining started .
    public class MainFace extends JFrame implements ActionListener,Runnable{
    JButton jb = new JButton("create JInternalFrame");
    jb.addActionListener(this);
    JFrame fram = new JFrame();
    public void performance(ActionEvent e){
    JInternalFrame jif = new OutFace().createOutFace(); frame.getContentPane().add(JInternalFrame,BorderLayout.CENTER);
    public static void main(String[] args){
    frame.getContentPane().add(jb,BorderLayout.NORTH);
    frame.pack();
    frame.setVisible(true);
    ServerSokct ss = new ServerSocket(10000);
    Socket skt = ss.accept()'
    new ServerThread(skt).start();
    3.the third file is a thread class, there is a serversoket ,and accept the client side data,and want to refresh the JTable of the JInternalFrame
    public class ServerThread extends Thread{
    private skt;
    public ServerThread(Sokcet skt){
    this.skt = skt;
    public void run(){
    OutputObjectStream oos = null;
    InputObjectStream ios = null;
    try{
    Boolean flag = flag;
    //here i want to refresh the JTable,how to write??
    catch(){}
    4.second is the TableModel
    public class MyTableModel{
    public TableModel createTableModel(){
    String[][] data = getData();
    TableModel tm = AbstractTableModel(
    return tm;
    public String[][] getData(){
    }

    Use the "code" formatting tags when posting code.
    Read this article on [url http://www.physci.org/codes/sscce.jsp]Creating a Simple Demo Program before posting any more code.
    Here is an example that updates a table from another thread:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=435487

  • Using methods from another Form C#

    Hello!
    I'm having some trouble using methods from one Form in another one. Here's the deal:
    This is a snippet from my 'main' form:
    public partial class PRINCIPAL : Form
    //some variables here
    Form2 Config = new Form2();
    Form3 Cadastro = new Form3();
    public PRINCIPAL()
    InitializeComponent();
    //code goes on and on
    //Here's the method I want to call on the other forms (Form2 and Form3)
    public void salva_banco()
    this.Validate();
    this.projetoBindingSource.EndEdit();
    this.modulosBindingSource.EndEdit();
    this.funcaoBindingSource.EndEdit();
    this.estadosBindingSource.EndEdit();
    this.tableAdapterManager.UpdateAll(this.database1DataSet);
    //And here is where I show Form3
    private void projetoDataGridView_CellDoubleClick_1(object sender, DataGridViewCellEventArgs e)
    Cadastro.ShowDialog();
    //And here is where I show Form2
    private void funcaoDataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
    Config.ShowDialog();
    }// And the code keeps on going}
    And this is a snippet from Form3:
    public partial class Form3 : Form
    public Form3()
    InitializeComponent();
    private void Form3_Load(object sender, EventArgs e)
    this.projetoTableAdapter.Fill(this.database1DataSet.Projeto);
    this.modulosTableAdapter.Fill(this.database1DataSet.Modulos);
    private void btnOK_Click(object sender, EventArgs e)
    if (projetoTextBox.Text == "")
    MessageBox.Show("some text here");
    else
    ////// HERE IS THE PLACE WHERE I WANT TO CALL THE METHOD! "salva_banco()"
    I've read lots of suggestions but none satisfied my condition.
    I appreciate any help.
    Thanks.

    You need to find the instance of the PRINCIPAL form to call the method on.  If you know there will always be exactly one open you can use:
    var principalForm = Application.OpenForms.OfType<PRINCIPAL>().Single();
    principalForm.salva_banco();
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Accesing components of global class in another global class.

    Hi,
    I am not able to access Public TYPES defined on a class in other class.
    Class cl_business_object : has public type tt_records type table of  <ztable> with default key.
    and when i use it in method of cl_gui , get_records returning rt_records type cl_business_object=>tt_records after making the statement of Class definition cl_business_object load / entering the name of the class in properties tab's .. why does it happen ?
    Regards.

    Hi, Its ECC 6.0,
    We did nto have this problem before, Its kind of new, have no idea why it behaves so ..
    And the syntax error is not generated when we are cheking onthe class where it has been used (acessing other class types) , this is activated.
    but another 3rd class where this activated class is used, throw up syntactical error showing error in class 2.
    " saying components of global class are not accesible, class definition missing"..
    but there are statements of class definition load already!!
    Regards
    Edited by: Trivvka on Aug 11, 2009 5:06 PM

  • How to use Results from Another Query for SAP BW universes

    Hi Everyone,
    I have two SAP BI universes.In my First universe I have Sales Doc no (dimension) and Orderqty (Measure) and in my second universe I have Sales Doc no(Dimension) and BillQty (Measure).
    Here in my first dataprovider I have 1200 rows of data and in second dataprovider I have 75,000 rows. The report should fetch only the BillQty details that matches to corresponding  Sales doc no in first data provider.
    I want to place all these fileds into a single report like as shown.
    (Datarpovider1)                (Datarpovider1)                    (Datarpovider2)
    *Sales Doc No*               Orderqty                           BillQty
    Here I am able to generate single report using merge dimension but it is leading to performance issues. I want to restrict the values at query level by passing the First dataprovider Sales doc no to second Data provider Sales doc number using Results from Anothery Query feature so that It can fetch only the matching records.
    I tried it but it was giving the follwing error:
    A filter contains a wrong value. You cannot run this query. (Error: WIS 00007)
    How Can I get rid of this error. Can we use Results from Anothery Query option for OLAP universe. Are there any limitation on it.
    All this I am doing in Webi Rich Client.
    Appreciate your help
    Thanks &in Advance
    Kiran Saka

    Hi Kiran,
    I think the filter has a wrong operand. For example, a filter with an empty constant, or a filter that deals with numeric values is defined with an alphanumeric value.Check out for this.
    Regards,
    Neeraj

  • JBO-33035: Row currency has changed; Using snapshots from another DB

    I receive this error due to a snapshot performing a complete refresh. It is not due to the user hitting the Back button in the browser. How can you get around this scenario. The page has been rendered, the user navigates somewhere else via some link, and the jbo-29000 and 33035 errors get thrown because of the snapshot having refreshed. It's not an option to stop using the snapshot. I have already tested setting 'Enable Token Validation' to false on the object. Still get the error. Any suggestions?

    Hi,
    I assume you use JavaServer Faces, correct ? In this case go to the starting page's pagedef file and opn the Structure Window
    - select the "bindings" node and create an "action" that you bind to the ViewObject execute() operation (If you use EJB or POJO, crate a methd binding)
    - in the "executables" section create an "invokeAction" pointing to the action created before
    - under refresh conditions, add #{!adfFacesContext.postback} so the iterator is refreshed when you navigate back from another page.
    This should solve the problem
    Frank

  • Using EJB from another connection pool in WLPI

    Hi All,
    I've deployed an entity bean (CMP) which used the connection pool other than the
    one used by WLPI. When I execute the business operation I've defined for this
    bean, the following exception is encountered:
    "Couldn't get connection: java.sql.SQLException: Connection has already been created
    in this tx context for pool named wlpiPool. Illegal attempt to create connection
    from another pool: oraclePool"
    Is there any other alternative for me to use the entity bean in WLPI?
    Thanks,
    Fred

    Instead of using mulitiple connection pool,we are using single connection pool.
    Our one application, accessing remote db also, for that we are using simple jdbc
    connection. No pool.
    We also tried OracleXAdriver. In that case, at the time of startup we are getting
    weird error.
    Thanks
    JIgnesh Patel
    "Fred" <[email protected]> wrote:
    >
    I simply turned all my CMP to BMP and get the connection from another
    connection
    pool. But that was not what I want. Is there any method that allows a
    CMP to use
    connection pool other than the wlpiPool pool in WLPI?
    Thanks
    "jignesh" <[email protected]> wrote:
    Hi Fred,
    We are also getting same error. How did you resolve this error ?
    I'd appreciate,if you can post resolution of this error.
    Thanks
    Jignesh Patel
    "Fred" <[email protected]> wrote:
    Hi All,
    I've deployed an entity bean (CMP) which used the connection pool other
    than the
    one used by WLPI. When I execute the business operation I've defined
    for this
    bean, the following exception is encountered:
    "Couldn't get connection: java.sql.SQLException: Connection has already
    been created
    in this tx context for pool named wlpiPool. Illegal attempt to create
    connection
    from another pool: oraclePool"
    Is there any other alternative for me to use the entity bean in WLPI?
    Thanks,
    Fred

  • I am going to a Veterans Home, if I delete fire fox icon, will I be able to use it from another IP?

    if i sell my computer and delete the firefox icon, can i gain access to my bookmarks and passwords from another computer and different IP address?

    See:
    http://kb.mozillazine.org/Profile_backup and [[Backing up your information]]
    http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox
    You can upload that data using the Firefox Sync extension to access it on another computer.
    See:
    [[What is Firefox Sync]]
    [[How to sync Firefox settings between computers]]

  • Calling a bounded task flow (that uses fragments) from another application

    Hello,
    I'm currently having difficulties calling a task flow located inside another application.
    I have application Console which is my main application in which I would like to run other applications within. Inside this Console I have it divided into splitter windows and inside them I have regions. My goal is to be able to call a task flow from another application inside one of these regions but so far I'm having no luck.
    My first problem occurred when I created a 'local' task flow to make a call to another application's task flow. When I set the properties to the task flow call, it gave me an error that it could not find the .XML file for that task flow when I ran the Console application. I then proceeded to copy that .XML from the remote application into the Console's WEB-INF directory and I seemed to get a bit farther. The error I get now is saying that I cannot run a task-flow that uses fragments. It's essentially trying to run that task flow as an entirely new page instead of inside the region that it's bound to. It's NOT a dynamic region (although that's the end goal here). So I then changed the other application's task flow to simply display an entire page rather than fragments inside a region and voila, it works..... kind of.
    To recap how I was able to call another application's task flow inside the Console:
    - I had to manually copy the task flow xml file into the Console WEB-INF directory
    - I had to change the task flow so that it didn't use fragments
    - I have called the task flow but I lose my console page entirely, no more regions or splitters so I'm back to square one.
    If anybody has any suggestions, hints, tips or anything, send them this way and I will be forever greateful.
    Thanks,
    Mark

    Thanks for your response Frank.
    Unfortunately the problem seems to be greater than that. I've been able to package task-flows into a jar library and tried importing them that way with no luck.
    I'm simple trying to call an external task-flow to run inside a region which is inside a splitter panel that I call my console.
    Any other ideas ?

Maybe you are looking for

  • Why are cookies not updated in the request when meta refresh is used?

    I've written a web site that uses IIS Forms Authentication. It's configured to use authentication tickets with a sliding expiration. FireFox allows the ticket to expire while it works fine with Internet Explorer. The web site uses a Keep Alive page t

  • Cancel the excise invoice through J1IEX

    Hi 1)  My client has captured the excise through J1IEX 2)  The excise has been captured 3)  Necessary Accounting entries has been captured in the RG23A registered 4) Now my client wants to cancel the doc 5)  the tried to cancel through J1IEX 6) but t

  • I have published iWeb now what?

    I have finished my web pages in iWeb and published them but now what? Do I have to buy a domain name? I am starting a business and do not know if I need to purchase a domain name or if I can just use my mobile me website? If I don't have to purchase

  • Configuring Email Environment Settings

    hi can any one tell me how to configure APEX 3.1 to send an email i want to know how to go to Manage Environment Settings

  • Overtime processing

    Hi, I want to configure the folloowing overtime pocessing scenario: Overtime processing: CLIENT follows following method for overtime processing 1.     Overtime on Monday to Friday is calculated as 1.25*basic salary 2.     Overtime on Saturday & Sund