Skip to Content
author's profile photo Former Member
Former Member

BC-BSP-MVC: Question about creating/accessing ID of master controller

Hello Experts-

I had a BSP-MVC related question.

If a master controller (1.do) creates and calls a view (1.htm) then how can I access one of the attributes of the master controller (1.do) from one of its sub-controllers (1a.do and 1b.do)?

Its easy to access attributes of sub-controllers because you can get an instance of the sub-controller from any other controller by referencing to it through the 'm_parent' object (and using the get_controller method with a reference to the controller/component id of the sub-controller). Its relatively simple to identify them (sub-controllers) and their attributes.

However, since the master controller (1.do) is the point of access of the application and is called directly from the web-browser, there is no location to specify its controller id.

So, my question is, where do I assign a controller/component id to my master controller? Or, how do I refer to an attribute of the master controller if I am unable to assign a controller/component ID to it?

Thanks,

- Vik.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 06, 2004 at 07:42 PM

    Hi,

    "m_parent" IS the handle to your master controller (if you are referring it from a sub-controller).

    So, all you have to do is, assign it (with Cast) to the controller class and start accessing the attributes.

    As simple easy as that 😉

    data: master_controller type ref to ZCL_YOUR_MASTER_CLASS.

    master_controller ?= m_parent.

    (and, start accessing the attributes)

    a = master_controller->attribute1.

    b = master_controller->attribute2.

    ...

    Regards,

    Venky Varadadesigan

    SAP NetWeaver consulting.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.