Resue of Custom Controller to another webdynpro component

Hello,
I would like to use all the methods and context of one custom controller residing in one webdynpro component from another view residing in another webdynpro component.
Could you please give me an idea asto how this can be achieved?
For this I have added the first webdynpro component(which has the custom controller) to its public part and added the first component to the other webdynpro component(which will resue the previous one) as a used DC.Now I want to access all the methods of this custom controller in the view of this second component.
Thanks and Regards,
Arya

Hi
To make uses of component and its other controller u have to deal with [ Interface controller|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f07c3625-c971-2910-3a9c-ce131487f82c]
For  [Custom Controller|http://help.sap.com/saphelp_nw04/helpdata/en/c4/862594e85911459301aa71a2b7b6b4/frameset.htm]   it is nothing but a separation of the component controller task into unit for example want to implement OVS ,so put it in one dedicated custom controller etc.
Best Regards
Satish Kumar

Similar Messages

  • What is the use of Custom Controller in ABAP WebDynpro?

    Hi,
    Can you explain me about Custom Controller and its uses and some example on it?
    I have gone through SAP help but not understand clearly. Wish to see some good explanation here?
    Thanks in advance.
    Regards,
    Meera.

    In addition to above,
    1. Custom controller can acts as "Config Controller"
    2. it is bit different than component controller in the manner that Hook methods will be different here ( only two ) and
    these methods will not participate in the phase model unless there is a method call of custom controller as opposed to component controller which always participate in the phase model.
    someone please correct me for the last statment if i am wrong.
    Edited by: kranthi kumar on Dec 31, 2010 11:37 AM

  • Reuse FPM configuration in another webdynpro component

    Hello,
    I would like to define the navigations and buttons in one component configuration . And then use this  in another webdynpro component.  As the buttons/navigation is applicable to multiple requirements. So I would like to reuse it.
    I tried to do this using the developer's guide (7.0 , EhP2). But I am getting a dump
    'The current application triggered a termination with a short dump ' .
    Not sure if I am doing some thing wrong. Any ideas in this regard would be helpful.
    method Web DynproDOINIT .
    data: lo_usage type ref to if_Web Dynpro_component_usage,
    ls_conf_key type Web Dynproy_config_key.
    lo_usage = Web Dynpro_this->Web Dynpro_cpuse_fpm_usage( ).
    if lo_usage->has_active_component( ) = abap_true.
    lo_usage->delete_component( ).
    endif.
    ls_conf_key-config_id = u201CID configuration of FPM componentu201D.
    * recreate component using new configuration ID
    try.
    (C) SAP AG Floorplan Manager ABAP - Developeru2019s Guide 185
    Preliminary Version
    call method lo_usage->create_component
    EXPORTING
    component_name = 'FPM_OIF_COMPONENT'
    configuration_id = ls_conf_key.
    catch cx_Web Dynpro_runtime_api .
    endtry.
    Thanks alot
    Saujanya

    Saujanya wrote:
    Hello,
    >
    >
    > I would like to define the navigations and buttons in one component configuration . And then use this  in another webdynpro component.  As the buttons/navigation is applicable to multiple requirements. So I would like to reuse it.
    >
    > I tried to do this using the developer's guide (7.0 , EhP2). But I am getting a dump
    > 'The current application triggered a termination with a short dump ' .
    >
    > Not sure if I am doing some thing wrong. Any ideas in this regard would be helpful.
    >
    >
    > '
    >
    method Web DynproDOINIT .
    > data: lo_usage type ref to if_Web Dynpro_component_usage,
    > ls_conf_key type Web Dynproy_config_key.
    > lo_usage = Web Dynpro_this->Web Dynpro_cpuse_fpm_usage( ).
    > if lo_usage->has_active_component( ) = abap_true.
    > lo_usage->delete_component( ).
    > endif.
    > ls_conf_key-config_id = u201CID configuration of FPM componentu201D.
    > * recreate component using new configuration ID
    > try.
    > (C) SAP AG Floorplan Manager ABAP - Developeru2019s Guide 185
    > Preliminary Version
    > call method lo_usage->create_component
    > EXPORTING
    > component_name = 'FPM_OIF_COMPONENT'
    > configuration_id = ls_conf_key.
    > catch cx_Web Dynpro_runtime_api .
    > endtry.
    >
    > Thanks alot
    > Saujanya
    if your actual coding is like as it is above then it will give dump. For example
    ls_conf_key-config_id = u201CID configuration of FPM componentu201D.
    You need to replace the u201CID configuration of FPM componentu201D with the actual component configuration id.

  • Calling a method in another webdynpro component

    Hi,
    I have two webdynpro components say Comp A and Comp B.
    In Comp A I had a view View A and in Comp B I had a View in View B.
    In View A, I had a method X, I want to call this method in View B of Comp B.
    How I can do this?
    I created a public part of Comp A and tried to add in used webdynpro components. But in the list I am not able to find it.
    Please help.
    Regards
    MQ

    Hi,
    If both the components Comp A and Comp B are in the same DC you can use the interface controller to call the method in comp A. Add this comp A interface controller in Comp B controller by going to the properties tab, so that you can access the methods of comp A interface controller.
    If you have the components in different DC's you can follow the below steps:
    Go to public parts in DC meta data section and create a public part by selecting the first radio button option and add the Comp A by selecting the option (Webdynpro Component-->Selected Entities).
    Click on Finish button so that public part for comp A is created.
    Now build the DC and go to Used Webdynpro components of CompB, give some name and browse to select the used webdynpro component, it will show you the Comp A public part select it and try to finish it.
    Once again build the Dc after doing this.
    Now  you can access the method of comp A in Comp B
    wdThis.wdGetCompA.getX()...
    Hope this helps you..
    Regards,
    Saleem

  • Embeding WebDynpro component into another webdynpro component

    Hi,
       I am trying to embed one (embeded) WebDynPro Component in to another(inner) . I have followed the tutorials for Server side eventing at
    http://help.sap.com/saphelp_nw04/helpdata/en/24/243ca46e1c334f8a6f8b0792656bc7/content.htm
    Here are the steps I did.
    1) Created two WebDynpro component "embeded" and "inner" components in  a project with two views embededView and innerView respectively.
    2) Defined the component usage in "embeded" component.
    3) created a viewset at "embeded" component. included embededView and innerView in the viewset.
    4) Included required controllers at embededView.
    5) Created two button at embededView and linked it to action and wrote code to create the componet using componentusage instance.
    But unfortunately i could not able se to any component created i.e the view of inner component is not visible at all.
    Could anybody have an answer to the above query.
    Regards
    Alok

    Hi Alok,
    As far i understood the scenario. You want to see/embed one webdynpro view inside another web dynpro view when you click some button in the outer web dynpro view.
    Is it correct ?
    I had the the following approach.
    >created two wen dynpro component in a project.
    >define the view for the inner component.
    > In the Outer component, i added View Container.
    > In the View Container, i embedded Interface View of inner component.
    > write some code to view this in the on action event of the button used to display the inner view.
    If you are working on the same scenario, it is one method to go
    Rgds,
    Vilish

  • View and View controller in WebDynpro component.

    Dear SDN Community,
      I don't see anything like View controller in the webdynpro component. In the WebDynpro component I see only View but no View Controller. Is it that in the webdynpro component view and view controller are physically same and when you swtich to the layout tab its the view and the rest of the tabs for the View controller. May be a stupid question but I would appreciate your clarification here.
    Thanks!
    Surya

    Yes, they are to some degree merged in the IDE. For example, there is only one Java source file for view and view controller. The metadata on the other side are stored in different XML files.
    Armin

  • Best Practice for custom controller

    Hi Experts,
    In my current project we have one DC with single component and 12 views (4 business functionality each has 3 view flow ). Now complete logic is in component controller itself and planning to divide business logic into 4 custom controller based on business functionality.
    Please guide me how i need to manger context variable and approach from below?
    1. Maintain context in each custom controller and map to views. (Cust Cont ->Views) not maintained in comp Controller
    2. Maintain all context in component controller and from there custom controller and from there views. (Comp Cont -> Cust cont  -> Views)
    3. Maintain context in custom controller and map to component controller and from there mapping to View. (Cust Cont -> Comp cont  -> Views)
    Regards,
    Satya.

    HI,
    If you are going to use Custom controller, always try to bind all related functionality and context in respective custom contollers.
    Else there is no meaning in using that.When your application will expand in future this will help you.
    Also i will not advice to separate if it is not important.Because if you are creating a new custom controller that much additional work will raise.
    Thanks ,
    Ram

  • Reg:call  webdynpro application in another webdynpro application

    Dear All,
         I created a Webdynpro component which on execution displays the Table output.I got a requirement to call the same Webdynpro
    component in another webdynpro component which contains a BUTTON UI element on click of it i should call the first webdynpro application output.
    How can it be done?

    you can check my wiki in SDN, link for the same is given below:
    https://wiki.sdn.sap.com/wiki/display/WDABAP/Example%20for%20passing%20values%20from%20one%20Application%20to%20another%20Application%20in%20WebDynpro%20ABAP.
    With luck,
    Pritam.

  • Regarding Execution flow in webdynpro component

    Hi all,
              I am confused regarding the execution flow.
    we have "component controller" and "view controller" in a webdynpro component.
    I have written some code in "wdDoInit" of  "component controller" and in "wdDoInit" of "view controller" and in "wdDoModifyView" of  "view controller" .
    If I do "Deploy and Run " the application , Which one is executed first ,I mean how is the code processed ,where the control reaches first?
    Thanks in advance.

    In a web dynpro application there is always a interface view specified.
    This interface view is associated with a window. The window has set of views with one as default view.
    When Web Dynpro application is launched, the window is instantiated via interface view specified. The window after instantiation is rendered on the brower/some other UI client.
    The window when instantiated will instantiate the default view also. So wdDoInit of view controller will be called now. Now if navigation happens to some other view in the window that particular view has to be instantiated. So the wdDoInit of that view will be called then.
    Is your question answered ?
    Regards,
    Ashwani Kr Sharma

  • Open external window from  custom controller

    I have to write code to open an external  window. It should be done from the custom controller and not from component. when i use the following code i get error " The method getWindowManager() is undefined for the type IWD Controller.
    Pls note that I am using IWD controller here..
    IWDController component = wdThis.wdGetAPI();     
    IWDWindow helpWindow =
              component.getWindowManager().createExternalWindow(
                   helpUrl,
                   "help",
                   false);
    Pls help..

    Hi,
    Use
    wdThis.wdGetAPI().getComponent().getWindowManager().createExternalWindow(URL, title, modal)
    Regards
    Ayyapparaj

  • Difference between component controller & Custom controller

    Hi all
    what is the main difference b/w component controller , custom controller & interface controller.
    i want to know the difference of these three in the real time environment.
    if anybody explains me with any simple example then it is great help to me....
    Thanks
    Suresh babu.

    Hi Suresh,
    Component Controller and Custom Controller are more or less the same. Both are related to a particular component in the webdynpro application you create.
    Component Controller:-
    For each component of yours there will be a component controller, were in you can define context variables and methods, events etc.. This usefull while using models.
    Simple example where we can see this is, when you create global context variable in this controller and map this variable to the view controller context variable of different view, which enables you to pass the value of the variable from one view to another.
    Custome Controller:-
    They also have the same the function but as the name suggest there function can be customised. That is we can have more than one custom controller for a component. This is usefull when we need to create seperate execute methods for inputs from model import( Both webservice and rfc call).So you can seperate each other. Example is there in the more sample codes and application section.
    Interface Controller:
    There is only one interface controller for a component. It is mainly used when we need to communicate between two components.There is sample application for communication between two components in the sample codes and application section.
    Regards
    Sreedhar.

  • Should i Map thecommon bapi's to component controller or custom controller?

    Hey Can any body give the clarification for this doubt
    we have one web dynpro component , It contains some views. Created some BAPIs. Now we have two different applications in the same component. So we have created the two controllers for each application. the created BAPI's are mapped to o each controllers with respect to application.   . Now we have a small doubt, the Bapis  which common are common to both application not binding to any of that two controllers. so the common bapis should be map to the component controller or created one more controller like util Controller.
    Once bapis  mapped to any of this we can add this controllers to views. Please suggest which one is better, either mapping bapi's to component controller or custom controller.
    vijay

    Hi Raj, thks for the quick responce again.  I made small mistake in the sentence.Plz look at now again
    In my webDynpro project , under that i have created only single WebDynpro component with two applications .I have two modules(applications) one is DirectCustomer and another one is InDirectCustomer. so i have set of RFS's in a single RFC model. In this RFS's some are common to both the views. some are independent to each other. so i have created two custom controllers one for directCustomer another for Indirectcustomer.Then i mapped the RFC' model objects to each custom controller seperately . But now the RFC's which are common to both views to map, Better, should i map common RFC model objects  to existing Componentcontroller(which comes by default when create the webDynpro component) or should i create new customcontroller (like commoncontroller).
    which i option is better, can u suggest me. I feel that, The common RFC's will be mapped to component controller, bcz, it the Base controller for the both customcontroller , indrectly to the viewcontroller.
    Wht is your suggestion on this disign issue?

  • Should i Map thecommon RFC Model to component contrl or custom controller?

    In my webDynpro project , I have two modules one is DirectCustomer and InDirectCustomer. so i have set of RFS's in a single RFC model. In this  RFS's some are common to both the modules. some are independent to each other. so  i have created two controller component one for each module.Then i mapped the independent RFC'c to each controller seperately. But now the RFC's which are common to both modules to map, Better, should i map to  existing Componentcontroller or should i create new customcontroller (like commoncontroller).
    which i option is better, can u suggest me. I feel that, The common RFC's will be mapped to component controller, bcz it the Base controller for the both customcontroller , indrectly to the viewcontroller.
    Can any body give me the suggestion on this

    Hi Vishal,
    As far as I know it's recommended to use a custom controller for every RFC. This makes sense because if the RFC changes some day you only have to do changes in the specific custom controller.

  • Issue in Binding Custom controller to Component Controller

    Dear All,
    I have enhanced a standard component ERP_H.
    I created a custom controller with context nodes BTSTATUS, BTSTATUSH
    I enhanced the component controller with context node BTSTATUS, BTSTATUSH
    Now when i try to bind the custom controller to component controller using this code in the context class of my custom controller
    bind to component controller
      owner->do_context_node_binding(
               iv_controller_type = CL_BSP_WD_CONTROLLER=>CO_TYPE_COMPONENT
               iv_target_node_name = 'BTSTATUS'  " component controller context node
               iv_node_2_bind = BTStatus ).
    its not working since this context node in component controller is not the standard one but the custom added one.
    Am i missing something, or is there any way to bind customer context node in custom controller to customer context node in component controller.
    regards,
    pradeep

    Hi pradeep,
        Try the other way round go to the context class in the component controller and paste the following code in the
    create_contextnode( context node = name of the node to be linked).
    *owner->do_context_node_binding(
            iv_controller_type = cl_bsp_wd_controller=>co_type_custom   <-----linking from component to custom
            iv_target_node_name = 'BUILHEADER' "target node: component controller node
            iv_node_2_bind = BUILHEADER ). "source node: current node.
    See if this works.
    Thanks

  • Diff between Component controller,Custome controller and  View controller

    hi,
        Can any body tell me the following details,
    1.difference between the Component controller,Custome controller and  View controller in WD-ABAP.?
    2.what is Lead Selection?   
    Regards,
    Ravi

    Hi Ravi.
    The component controller is visbile to all views in a component. So all context nodes and methods you create here can be accessed from all views in the component. This way you can share data between the views by mapping context nodes or thru method calls. You can also mark methods and nodes as interface so that they are acessable from other components that define component usages to this cmponent.
    Custom controller is quiet similar to the component controller. You can define it if you want to group some views with a custom controller for a certain functionality.
    If you want to access a custom controller in a view you have to define the usage first on the properties tab of the view.
    A view controller is only visible in the view itself. So all methods or context nodes you define here are only accesable by the current view.
    The lead selection is in most cases the current selected element in a context node. The lead selection is used by many UI elements to determine which element has to be shown (e.g drop down).
    If you have a table with single selection the current selected table row is the lead selection element of the bound context node.
    SO you can get the lead selection element easily in any mthod by calling context_node->get_element( ).
    Hope this clears your questions.
    Cheers,
    Sascha

Maybe you are looking for

  • Query on a complex object

    Hi, I am using C#. Is there any way by which I can apply filter on a list of objects. for e.g.: I am having struct B string Name; string Address; class A List of B I am storing A in coherence cache as Dictionary<string,instance of A> I want to query

  • Why do my music files show as MPEG 4 in Itunes

    Why do my music files show as MPEG 4 in Itunes

  • UME Storage in Portal

    Hi Guys, I would like to know where is UME information i.e. User ID  and other logon data stored in portal? I mean is it the same way as in ABAP stack USR02, USR04 etc tables? What are the corrosponding tables in portal? Thanks in Advance

  • VO Extension

    Hi all, I have a requirement like to add additional condition in the seed VO.For that i extended the VO using Jdev. But if i try to run the VOImpl.java and VORowImpl.java files they are giving errors. I am in a thought that i am changing only the que

  • Sequencing in Oracle giving Problems.

    Hi All, I am facing a different problem and its related to sequencing. The Problem is when i am using a sequence the sequence value should increment in proper fashion of what the increment value is provided. Let say if the sequence i have created is: