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

Similar Messages

  • Difference between custom controller and component controller

    Hi All,
    I am a beginner in CRM SAP .
    Please can anyone tell me whats the difference between custom controller and component controller with some scenario.
    I am totally baffled.
    Thanks in advance.
    Regards
    Shilpi

    Hi Shilpi,
    The main difference between custom and component controller is the role which they play during data transfer.
    a) Custom controller is used for data transfer across two views within a component. For that you need to bind view context nodes to custom controller either through wizard or manually by adding the code in CTXT class create_contextnode method:
    initial setting for depandant model node
        coll_wrapper =
          BTADMINH->get_collection_wrapper( ).
        TRY.
            entity ?= coll_wrapper->get_current( ).
          CATCH cx_sy_move_cast_error.
        ENDTRY.
        IF entity IS BOUND.
          BTOpportH->on_new_focus(
                       focus_bo = entity ).
        ENDIF.
    b)Component controller is used for data transfer across two views in two different components. For this, we need to define the component usage first and then bind the context nodes in the method-WD_USAGE_INITIALIZE of the Component Controller impl class.
        WHEN 'ComponentUsageName'.
          iv_usage->bind_context_node(
                      iv_controller_type  = cl_bsp_wd_controller=>co_type_custom
                      iv_target_node_name = 'ContextNodeName'  "#EC NOTEXT
                      iv_node_2_bind      = 'ContextNodeName' ).  "#EC NOTEXT
    Hope this clears some of your doubts!
    Thanks and Regards,
    Rohit
    P.S-This is valid for CRM 2007.Raghu is also right because Interaction Center is made up of different different components combined together.You have put your question in wrong forum.

  • Getting error while creating Service controller from component controller

    Hi,
    I have added CAF model in used model for DC project.But when i m trying to create service controller from component controller by selecting used model it is giving error like "Context element cannot be bound to model layer".
    Can anybody help me out on this issue.
    Thanks in advance.

    Hello,
    try to check the check box in MS Word - File - Options - General - "Open e-mail attachements and other uneditable files in reading view"
    I am not sure how this option really works, but I think you will find it checked. So try to uncheck it.
    Or wise versa :c)
    Kind regards

  • Need to bind value attributes of Component controller with value attributes

    Hi,
    I am developing a Java Web Dynpro application which is importing RFC Model.

    Hi Kaushik,
    It is very simple to enter values in webdynpro and to update the ztable through RFC
    All you hav to do is
    1. Create the ztable , RFC to import data into that table,
    2. Create the model in webdynpro with that RFC
    3. First map the ModelInputElements to the component controller(say zid, zname) (you can have your own value attribute in component controller say id , name )
    4. Map the attributes to the view where the input field is there
    5. Now write the code as follows,
    Zxxx in = new Zxxx();
    wdContext.nodeZxx_InputElement.bind(in);
    in.setZid(wdcontext.currentContextElement().getId()); // getId component controllers attribute and getZid is model' s mapped attributre
    in.setZname(wdcontext.currentContextElement().getName()); // getName component controllers attribute and getZname is model's mapped attributre
    /* u need not have to map that model attrobute to component attribute for that */
    try
    in.execute();
    Catch(Eception e)
    e.printStackTrace();
    Regards,
    Sam Charles J.

  • Mapping between view controller and component controller

    Hi Experts,
    I am new to web dynpro ABAP. First I created an application using one input field and one button, my view name is V1. In view context, I created one node viz. NODE1 using table SFLIGHT, fields chosen are CARRID CONNID and FLDATE. I have bind that to my input field and for button I have not done any thing. So, when I am running this application it is allowing me to select value for my input field. After this, I have added a table to the view layout. I have added to nodes using sflight table in COMPONENT CONTROLLER. First node is SFLIGHT with CARRID, CONNID, FLDATE, PRICE and PLANETYPE and second node is NODE1(same name) with only CARRID. Now in VIEW CONTEXT it is showing -
    CONTEXT
       NODE1
         CARRID
         CONNID
         FLDATE
    (which I had created in VIEW CONTEXT for input field)
    CONTEXT COMPONENT CONTROLLER
       SFLIGHT
         CARRID
         CONNID
         FLDATE
         PRICE
         PLANETYPE
       NODE1
         CARRID
    (which I had created in component controller after adding table)
    Now both this context should be matched as per my knowledge, so that when I bind the table it should V1.SFLIGHT.<fieldname> and not as V1.NODE1.<fieldname>
    But I don't know how to match them. Please help.

    Hi Sambaran,
    I guess I understood what you want.
    To achieve this, proceed as follows:
    1)Open your View, goto Properties tab. Here in the Used controller table, click on the create icon to include the component controller (component controller is added by default by the framework, if you use custom controller you need to define this usage).
    2)Once you do this, goto Context tab of the view, here now you will be able to see the component controller on the right hand side.
    3)Next, drag the SFLIGHT node from the component controller, and drop it on the Context (root context) of the view (left side). Doing this system will create a mapped context node on the view which you will use to bind to the view elements on the layout.
    The above steps apply if you want to directly create a view context from component controller context.
    Hope this helps!
    Thanks,
    Chitrali

  • How to fire event in view controller from component controller.

    I have a component usage that fires an event wich i have subscribed in the component controller.
          iv_usage->subscribe_event( iv_event_name = 'TAKE_IT'
                                     iv_handler = me ).
    After the event the method IF_BSP_WD_EVENT_HANDLER~HANDLE_EVENT in the component controller is called.
    method if_bsp_wd_event_handler~handle_event.
    endmethod.
    The usage component is opened as a popup window. After pressing a button, the data is transfered via context node binding to the calling component. But now i want to close the popup.
    My intension is to fire a event for the view controller in the IF_BSP_WD_EVENT_HANDLER~HANDLE_EVENT method that closes the popup.
    Is this possible?
    Or let me explain it this way:
    I want to close a popup after a button in the popup is pressed.
    best regards
    Jürgen

    Hello Juergen
    I am assuming your target pop-up is of type ref to IF_BSP_WD_POPUP.
    1.Make this a view controller class attribute.
    2. After the code to create the pop-up, you can add the following block :
    gv_target_popup->set_on_close_event( iv_view = me iv_event_name = 'CLOSEPOPUP').
    3. Now define event handler EH_ONCLOSEPOPUP where you can write the logic for on_close.
    You can access the same reference gv_target_popup at the event handler level as well.
    Hope this helps.
    Regards
    Nisha

  • Call method of interface controller from component controller

    hi,
    I have created one method in the interface controller of a component. Now i have this method along with attributes to the component controller. Now from the component controller i want to call the method of the interface controller. How do i do it???

    Hi,
    You dont need to call the method from the interface controller when you are in the same component.
    You can call the method which is in the component controller.
    Interface controller is used to expose some methods to a different component.
    Ex Comp a want to expose a method which will be used by comp b then  you need the interface controller in comp a.
    Comp b will use comp a as used component
    then it will invoke the methods.
    Regards
    Ayyapparaj

  • Design question: Interface Controller vs. component controller

    Hello,
    I have a component A. This component has a component controller (compController) and an interface controller (intController).
    Component controller has method compMethod()
    Interface controller has method intMethod()
    - Am i allowed to call intMethod from component controller? ( i'm pretty sure this isnt bad design because this is also done in the tutorial on eventing)
    - Am i allowed to call compMethod from intController or is this bad design?
    - Am i allowed to subscribe compController to event in intController or is this bad design?
    Kind regards,
    Joren

    Hi Joren,
    like Valery already pointed out, we recommend not to implement any logic in the component interface controller but only implement methods used for delegating logic to the component controller. This is based on the fact, that the component interface controller will be implemented by the component controller in the the next major SAP NetWeaver Release. This means that it will not have its own Java class like in NW04 and NW04s. To simplify migration the interface controller code should be as slim as possible by applying the delegation principle.
    You wrote:
    <i>- Am i allowed to call intMethod from component controller? ( i'm pretty sure this isnt bad design because this is also done in the tutorial on eventing)</i>
    Yes, my (very old) tutorial on serverside eventing exposes a public method <i>fireEvent()</i> which is invoked by the component controller. In early versions of NW04 the wdFireEventInnerEvent() method was not exposed in the IPublic-API of the component interface controller but only in the IPrivate-API. Therefore an additional method fireEvent() must be defined to fire the event from another controller. As a negative side effect, this public fireEvent() method is also exposed by the IExternal-API of the component interface  controller so that the event can be fired from outside (by the Embedder component) which is not desired in most cases.
    Meanwhile the wdFire<event name>() method is exposed by the IPublic-API of the component interface controller, so that the public method fire<Event name>() is no longer needed.
    I will update the tutorial in this respect so that it again propagates best practices.
    Regards, Bertram

  • How to call Custom or Component Controller methods from View Controller

    Hy Guys,
    how do I call Custom Controller or Component controller methods from a View or Context Controlller?
    thanks in advance
    Jürgen

    Hi Juergen
    Yes it is possible, pls follow the below approach to access the component controller in context node class
    1) since the standard component controller class is protect variable , declare a variable of type component controller in your controller class.
    say for example the public variable you declared is  g_comp_controller
    2)  now redefine the controller class method WD_CREATE_CONTEXT  and add the below lines of code
       g_comp_controller ?= me->comp_controller.
    3) go to context node class  (CNXX)  there declare the varaible which of type controller class (IMPL)  as public variable, for example g_owner
    4) redefine the method  IF_BSP_MODEL~INIT  and write the below code
         CALL METHOD super->if_bsp_model~init
        EXPORTING
          id    = id
          owner = owner.
      g_owner ?= owner.
    5) now the variable   g_owner  that is declared in  (CNXX)   contains reference to your controller class
    6) in  on_new_focus  method access your component controller in the below manner and access the entities also.
    DATA: lv_owner                    TYPE REF TO xxxxx_impl,  " Implementation class
                 lr_comp_cont                TYPE REF TO xxxx_bspwdcomponen_impl, " component controller class
                 lv_entity type ref to cl_crm_bol_entity.
    lv_owner ?= g_owner.
    lr_comp_cont    ?= lv_owner->g_comp_controller.
    IF lr_comp_cont IS BOUND.
       lv_entity ?= lr_comp_cont->typed_context->mdfcampaign->collection_wrapper->get_current( ).
    now lv_entity contains the value of component controller context node.
    Thanks & Regards
    Raj
    Edited by: bmsraj on Sep 27, 2011 3:28 PM

  • What is CUSTOM CONTROLLER  & COMPONENT CONTROLLER

    hI ALL
    1)what is CUSTOM CONTROLLER  & COMPONENT CONTROLLER
    GIVE DIFFRENCES AND ADVANTAGES OF EACH
    REGARDS
    BABU

    Hi,
    Custom Controllers -
    A controller that can be defined by application development and used to share common data over several views. Custom controllers are defined for purposes that cannot be assigned to view controllers or component controllers, and serve as structuring element of a Web Dynpro application. Custom controllers use their context to communicate with their surroundings. They are used for manipulating data, or connecting to the back end.
    Leaving content frame
    Component Controllers-
    Each Web Dynpro component contains exactly one component controller. This controller is automatically created during the component creation and contains a context, events, and methods. Unlike a view controller, the component controller is visible for all views in a component. This means, the controllers of different component views can access context elements or methods of the component controller. For this purpose, the component controller usage is automatically created for every view controller.
    See this link for more details -
    http://help.sap.com/saphelp_erp2005/helpdata/en/eb/e1cb5eea012b4481f8077c6023a70e/frameset.htm
    The definitions explain the difference between these 2 types of controllers.
    Hope this helps.
    ashish

  • View raises Component Controller Event

    Hello,
    I defined an even onUpdate in the component controller. A custom controller subscribed to this event. For that I have a method handleOnUpdate in the custom controller. Now I want to raise this event in a view after pressing a submit button of this view.
    How can I raise the event?
    So data flow would be:
    1. Button pressed in view
    2. Raise event in component controller
    3. Handle raised event in custom controller
    Regards
    Rene

    Hi Rene,
    Your scenario is like:
    <b>View: OnSubmit -> Component Controller: OnUpdate -> Custom Controller:</b> <b>handleOnUpdate.</b>
    For this, in the code for <u>OnSubmit</u> in your view, you need to add code as
    wdThis.wdGet<ComponentControllerName>().onUpdate();
    and in the <u>OnUpdate</u> method in Component Controller:
    wdThis.wdGet<CustomContControllerName>().handleOnUpdate();
    Also, you need to <b>add the Component Controller to your View</b>, using Properties Tab
    <b>and Custom Controller in Component Controller</b>, using its properties tab.
    Hope it helps.
    Regards,
    Alka.

  • What is the difference between Custom controller and context controller?

    Hi Gurus,
    What is the difference between Custom and context controller?
    In which occasion we should prefer to use Custom Controller?
    Thanks in Advance,
    Dharani

    You mean difference between custom controller and component controller???
    if yes...
    its been discussed many times.... just go through these threads, you will be clear
    custom controller vs component controller
    Component Controller and Custom comtroller
    [ why we need Custom controllers in Model Applications |why we need Custom controllers in Model Applications;
    [CONTROLLER AND CONTEXT|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/944ea9e5-0601-0010-65b3-b49a56eb6385]
    Pradeep
    Edited by: pradeep bondla on Jul 22, 2008 12:42 PM

  • Mapping one node in a view context to many nodes in the component controlle

    Hi guys,
    I need to map an element (attribute) of a node in the View Context to an attribute of multi nodes of the same type:
    Context View:
    customer_no
          |
          | -> KUNNR
    Component Controller Context having two nodes:
      - Node1
         RFC1
            |
            |->KUNNR
      - Node2
          RFC2
             |
             |->KUNNR
    Above I need to map the (KUNNR) in customer_no node to KUNNR in the RFC1 RFC2 before i execute the two RFCs services.
    Note:
    if this is not possible would you mention another solution.
    Thanks,

    Hi,
       As per MVC you cannot map context from view controller to component controller.Mapping can happen from component
    controller to view controller.
    You cannot create mapping for context attributes. You can map nodes if both source node and destination node both has same structure and same number of attributes. If they dont contain same number of attributes the extra attributes from the source node gets copied to the destination node.
    In your case before the RFC execution you can read the value of attribute Kunnr from view and set it the RFC attribute Kunnr before the Function module execution.
    Regards
    Bala Baskaran.S

  • 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?

  • 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.

Maybe you are looking for

  • How can i see my Imac screen on my macbook pro wireless

    How can i see my imac screen on my macbook pro wireless

  • How can I run iTunes 10.5 on a Windows 7 64 bit machine?

    Does someone know how this works? if I install it, iTunes doesn't start. It's in the Task-Manger, but only for 3 seconds. After those 3 seconds the process disappears... and thats all... :/

  • MQJBND04

    Hello People, I Have Problem with mqjbnd04 ( java.lang.UnsatisfiedLinkError: no mqjbnd04 in java.library.path). Somebody can help me? Thank's. Feitosa

  • Adobe Reader XI - print dialog box blank - Windows 8

    Using the latest version of Adobe Reader XI, The print dialog box either comes up blank as shown in file 1 and I have no control over printing. OR it comes up with all the labels missing, see File 2 - yet I can control some features by clicking on th

  • User ID help

    I'm getting an error mesage that says my Apple ID is not verified and they've sent me an email to follow a link to verify the ID but I have not received the email and it will not resend.  As a result I cannot download anything or update Aps.  What do