ALV and component Controller Context.

Good morning experts,
i use an alv to display a context from the component controller. The ALV is editable.
My problem now is that changes to the ALV never reach the node.
Where are my changes and what must i do to write them to the node.
Thank you and best regards
René

Hi Rene,
You need to create an event handler method (say for example CHECK_DATA_CHANGE) for the event ON_DATA_CHECK of the ALV.
You would have to first call the DATA_CHECK method of the ALV component. This method checks if any data has changed in the ALV and then triggers the ON_DATA_CHECK event if it finds that something has changed in the ALV. Create an eventhandler method for the ON_DATA_CHECK method and within this method write the code for modifying the context attributes to reflect the new ALV data.
Call this DATA_CHECK method from WDDOAFTERACTION so that whenever any action is performed the system would check if any data has changed in the ALV & then eventually execute your eventhandler method resulting in the context node getting updated. Hope that this is clear for you now.
method WDDOAFTERACTION .
  DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
  lo_interfacecontroller =   wd_this->wd_cpifc_alv( ).
  lo_interfacecontroller->data_check( ).
endmethod.
Regards,
Uday

Similar Messages

  • Mapping from component controller context and view context

    Hi to all experts.
    im trying to create my first webdynpro . Im stuck up here please help me .... How to map the node from component controller context and view context i have searched the forum....got the answers as Drag and Drop...But it is not working ....

    Hi
    Check out this links and check saptechnical site
    WDA in SAP Help
    http://help.sap.com/saphelp_nw2004s/helpdata/en/7c/3545415ea6f523e10000000a155106/frameset.htm
    Web Dynpro for ABAP in SDN
    https://www.sdn.sap.com/irj/sdn/developerareas/webdynpro?rid=/webcontent/uuid/512040e1-0901-0010-769c-c238c6ca35d9 [original link is broken]
    Developing ABAP Applications Using Web Dynpro
    http://help.sap.com/saphelp_nw2004s/helpdata/en/42/d41b25d2216babe10000000a1553f6/frameset.htm
    Web Dynpro ABAP: Development in Detail
    http://help.sap.com/saphelp_nw2004s/helpdata/en/03/0048413e466e24e10000000a155106/frameset.htm
    WDA Sample programs & tutorials
    https://www.sdn.sap.com/irj/sdn/developerareas/webdynpro?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d
    Web Dynpro ABAP Demonstration Videos
    /people/thomas.jung/blog/2006/06/20/web-dynpro-abap-demonstration-videos
    Web Dynpro ABAP Wiki's
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/wdabap/main&
    New to Webdynpro
    Thanks,
    Tulasi Palnati

  • 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

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

  • Accessing component controller node

    Hi..Experts,
    How to access component controller node from  WINDOW (please give me a sample code ) .
    I want to set data to component controller node.
    please help me.
    Regards,
    Siva

    Hi siva,
       Its very easy u need not to do any extra coding to share data between window context and component controller context.
    Step 1) u create the node in component controller and map this node with window context.
    step 2) Now in any method of window u write the set_attribute or bind_table statement ,your data will automatically transported to component controller .
    So u dont need to do any extra coding for this.
    Hope this will help your requirement.
    regards
    Pankaj Giri

  • 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

  • Regarding webservice adding to context of component controller

    Hi All,
           I have imported a webservice model and i am creating a data link between
    data model and component controller.why should i link Request Node(i,e Request_CustSessionWSViDocument_CustRetAll) to context of component controller why not response object(Response_CustSessionWSViDocument_CustRetAll).
           I want a clear picture regarding Request Node object and Response Object Node.Actually I want to know what resides in Request Node and in Response Node of a webservice model
    Thanks & Regards,
    saleem

    These classes are simply proxy classes for the web services.
    They reprsent request and response to the web service.
    For each method in web service there will be some parameter and return type. The request represent the paramaters and response represent the return type for the web service (or simply say method exposed as web service)
    Web Dynpro through context allows to you easily map the request,response in form on context nodes. You have to fill the request node.Then execute the web service. The result is stored in response node.
    This is good wiki to learn about AWS Model:
    https://wiki.sdn.sap.com/wiki/display/WDJava/FAQ-Models-AdaptiveWebService
    Regards
    Ashwani Kr Sharma

  • 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

  • Call a component controller methods from a view

    Hi,
    I have created a view v1 with context node c1and binded the context node c1 of it with the component controller so that the values entered in the view v1 are available.
    now can i know how to access this values from component controller context node which i binded in a other view......
    Thanks,
    Prem

    Hi Sayan,
    component : BP_HEAD
    View: BP_HEAD/BPHeadOverview
    I have called event EH_ONPOPUP_CLOSED when popup is closed in view BP_HEAD/BPHeadOverview and i get all the values entered in the popup here using below code.
           lr_context_node = gr_popup->get_context_node( iv_cnode_name = 'ZPOPUPCN' ).
           lr_col_wrapper = lr_context_node->collection_wrapper.
           lr_entity = lr_col_wrapper->get_current( ).
           IF lr_entity IS BOUND.
             lr_entity->get_properties( IMPORTING es_attributes = ls_data ).
           ENDIF.
    now ls_data contains all the data entered in the popup ie. - firstname, lastname, house_no, street, city, postal code, country.....
    now it have tried the below code to map/set the entries with the Account management - individual account creation screen.
    data : ls_header         TYPE crmst_header_object_buil,        " BuilHeader
              ls_header1        TYPE crmst_address_buil,                 " BuilStandardAddress
           ls_header-firstname     = ls_data-zfirstname.
           ls_header-lastname      = ls_data-zlastname.   
           ls_header1-house_no     = ls_data-zhouseno.  
           ls_header1-street       = ls_data-zstreet.      
           ls_header1-city         = ls_data-zcity.        
           ls_header1-postl_cod1   = ls_data-zpostcode.    
           ls_header1-country      = ls_data-zcountry.   
           ls_header1-telephonetel = ls_data-ztelno.        
           ls_header1-e_mailsmt    = ls_data-zemail.
           entity ?= me->typed_context->builheader->collection_wrapper->get_current( ).
           IF entity IS BOUND.
             entity->set_properties( EXPORTING is_attributes = ls_header ).
           ENDIF.
           entity1 ?= me->typed_context-> BuilStandardAddress->collection_wrapper->get_current( ).
           IF entity IS BOUND.
             entity1->set_properties( EXPORTING is_attributes = ls_header1 ).
           ENDIF.
    but the problem is both the entity is INITIAL.

  • 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

  • Reading Controller Context Data in "Z" view of ERP Quotation UI

    Hi
    We are on CRM 2007 . I could not find an appropriate forum area for CRM 2007 , hence posting here.
    We have a Z table that stores some additional information related to Quotations and Orders in CRM itself and passes it on to ERP when certain conditions are met .
    In CRM, we are using ERP Quotation transaction to create and change ERP Quotes. We have successfully enhanced the component ERP_H to "display" the content of these Z fields when Quotation is opened in Display or Change mode.
    When "Save" call is made(EH_ONSAVE) in ERP_H component , we want to update our Z tables if ERP Order/Quote Save is successful.
    However some requisite information for this update is available in ERPADMINI which is not bound to view Context of ERP_H/HeaderOverview .
    ERPADMINI is bound to Component Controller context .
    What is the best way to read the Component Controller Context Data and iterate through ERPADMINI structure when we are in the  method EH_ONSAVE.
    Any pointers/code samples would be useful.

    Moderator Reply:
    The CRM Webclient UI forum is the old CRM 2007 forum.  Anything related to the "frontend" of CRM should be asked in that forum.  CRM 7.0 is for CRM 7.0 upgrade and new functionality issues that need special attention.
    Thank you,
    Stephen
    CRM Forum Moderator

  • Interface Controller context model attribute error

    I am trying to create a controller interface as such:  I created a DC that goes out and retrieves SAP ID using a RFC call.  My controller context is bound to a RFC model.  I'd like to expose the SAP ID that comes back from that call within a model attribute to other components.  I try to create a model node and corresponding model attribute within the Interface Controller, setting the isInputElement = true.  However, as soon as I do this I get a number of compile errors:
    "The context model node has not been bound to a model class", "The context model attribute has not been bound to a model property". 
    Are you not allowed to map model nodes to an interface?

    Karla,
    First, set isInputElement to false. Think again, you are exposint "result" outside but not collecting "input" from outer component.
    Next, calculated attributes to the rescue here.
    Say, in component controller you have 1..1 / 0..1 model node <i>SapIdQuery_Input</i> with 1..1/0..1 child <i>SapIdQuery_Output</i> that holds <i>System_Id</i> attribute, type <i>string</i>.
    Now create in component controller context (right below root node) attribute <i>System_Id</i> of type <i>string</i>, set read-only to true and calculated to true. Switch to source editor and write the following for generated attribute "getter":
    if (wdContext.currentSapIdQuery_InputElement() != null &&
        wdContext.currentSapIdQuery_OutputElement() != null)
      return (String)wdContext
        .currentSapIdQuery_OutputElement()
          .getAttributeValue("System_Id");
    else
      return null;
    Now add controller usage (of component controller) in interface controller and map attribute in interface controller to calculated attribute in component controller.
    If you expirienced problems with mapping, try to create calculated attribute in 1..1 subnode of root context node.
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • Calling component controller's method

    Hi,
    How can i call component controller's method from a view?
    Thanks.

    Yes, You can call method of component controller from View.
    If you have already mapped any context node/attribute between your view and component controller then it means component controller is already added in your view. If you have not done same then you can add component controller by going into the properties of view.
    To access the method use following code.
    wdThis.wdGet<Your_controllername>Controller().<methodName>();
    Regards,
    Rohit

  • How to work with the component controller.

    I Created a Z component.
    In that component controller i ceated a context node by using value node with BUT000 with the attribute NAME_ORG1.
    I created a view in the same component.
    In the view i created a Context Node BUT000 wiht NAME_ORG1.
    I bind this view context node with compnent controller context node.
    I want set the value from the view context node to component controller context node. How it is possible?
    I created another Z component.
    I created compoent controller like same context node above.
    I created the view also.
    I want display the first compoent controller data in the second component controller.
    How it is possible.
    For one component to another component we can pass the data based on component controller only?
    Please give me how i can set/display the component controller context node with the data?
    Thank You.
    Regards,
    B. Krishna.

    Hi Manish.
        Thank you for reply Manish. I need some more information.
    I created ZCOMP1 with view V1 and ZCOMP2 with view V2.
    In both component controllers I created Context node by usng NAME_ORG1 of BUT000.
    I provide the Navigation link from ZCOMP1 to ZCOMP2 as well as ZCOMP2 to ZCOMP1.
    In Run Time Repository I provied two components as a INTERFACE VIEWS and
    I provide ZCOMP2 as component Usage in ZCOMP1 as well as ZCOMP1 as a Component Usage in ZCOMP2.
    Now, what ever data I entered in ZCOMP1 like NAME_ORG1 is "HELLO" then
    This infomation I want display in ZCOMP2 - V2.
    In ZCOMP2 method  wd_usage_initialize
    I write like this.
    IF IV_USAGE->USAGE_NAME = 'CompUsage'.
        iv_usage->bind_context_node( iv_controller_type  = cl_bsp_wd_controller=>co_type_component
                                       iv_target_node_name = 'BUT000'       
                                       iv_node_2_bind      = 'BUT000' ).    
      ENDIF.
    But it is displaying the Exception like this
    Cannot display view ZCOMP2/MainWindow of UI Component ZCOMP2
    An exception has occurred Exception Class  CX_BSP_WD_INCORRECT_IMPLEMENT - The view controller or custom controller "" was implemented incorrectly 
    Method:  CL_BSP_WD_COMPONENT_USAGE=>IF_BSP_WD_COMPONENT_USAGE~BIND_CONTEXT_NODE 
    Source Text Row:  24
    Please tell me how to solve this Problem.
    Regards,
    B. Krishna.

  • Read a View Context's node's element and assign from Component controller

    Hello Experts,
    I'm new to JAVA WD.
    Here is my scenario.
    I have to use an Adobe form in a WDJ. The input parameters and the output parameters of the DC are defined in a method in the Interface Controller method.
    The context of the Component Controller has the following structure
    Context
    ---StartDate
    ---EndDate
    ---AbsenceType
    Then the mapping between the Component controller and the interface controller is done so that the Interface controller also has the context structure as
    Context
    ---StartDate
    ---EndDate
    ---AbsenceType
    So now the interface controller and the component controller are bounded correctly.
    Now I bind the view also with the Component controller as below.
    Context
    ---StartDate
    ---EndDate
    ---AbsenceType
    But since i need to use an Adobe interactive form inside this view, the datasource for the form cannot be the root context node but some other node. So I replicated the same structure in the view context so as to make the fields visible in the Adobe form context. Now the context looks as below.
    Context
    ---StartDate
    ---EndDate
    ---AbsenceType
    ---DATA_NODE
    -----StartDate
    -----EndDate
    -----AbsenceType
    Now my question is, how do i map the result from the Adobe form into the context of the view??
    What code should i write and where should i write to achieve this?
    I need to do the following. But dont know how to write the code for this.
    Context.StartDate = Context.DATA_NODE.StartDate
    Context.EndDate = Context.DATA_NODE.StartDate
    Context.AbsenceType= Context.DATA_NODE.AbsenceType
    Please help!
    Any help will be greatly appreciated.
    Thanks,
    Sam

    Hello Nikhil,
    I'm stuck with another small issue.
    Let me first explain what I'm trying to do.
    I have a view with the context structure as follows
    Context
    ---DATA_NODE (Node)
    ----Data1
    ----Data2
    ---Data1
    ---Data2
    All i need to do is, at the start of the view, i need to move the data from
    Context.Data1=>Context.DATA_NODE.Data1 and
    Context.Data2=>Context.DATA_NODE.Data2
    Also, at the View Submit button click, I need to move the data from
    Context.DATA_NODE.Data1 => Context.Data1 and
    Context.DATA_NODE.Data2 => Context.Data2
    (I managed to do this submit button click by calling an action->method and wrote the code as you gave earlier)
    wdContext.currentContextElement().setData1(wdContext.currentData_NodeElement().getData1());
    wdContext.currentContextElement().setData2(wdContext.currentData_NodeElement().getData2());
    But I wrote at wdInit() for the view the code in the reverse way, but the values are not getting passed to the Data_Node and hence its not defaulting with the values from the elements of the context.
    This is what I wrote.
    wdContext.currentData_NodeElement().setData1(wdContext.currentContextElement().getData1());
    wdContext.currentData_NodeElement().setData2(wdContext.currentContextElement().getData2());
    Please let me know if I'm doing something wrong here.
    Appreciate your help in advance!
    Cheers,
    Sam

Maybe you are looking for

  • Navigational attribute in Cube

    Hi Gurus, I want to understand one point before I am going to perform a small enhancement. I need to set a navigational attribute in a cube(before it is not checked on "I/O") meaning make this navigational attribute behave as a char., but this cube c

  • Creating a settlement Rule for an Asset: message error AA311

    Hi All, I have to create e Settlement Rule by KO02. But SAP gives me the message AA311 and doesn't allow me to go on... Could anyone help me? Thanks

  • Autofill doesn't fill all the way?

    Hello, I have a quick question that I hope can be resolved easily. When I autofill my 2nd gen shuffle from my full music list (much more than the shuffle can actually hold), it doesn't fill up all the way. I don't get an error message. It just stops,

  • Macbook pro wont load, just gets to a white screen with apple logo

    Hello, I put my Mac to sleep last night. I am trying to turn it on now but it won't load. The bar comes up at the bottom, fills about 20%, dissapears and then the spinny globe stays there forever, it will not load. I have tried booting up by holding

  • HT1277 Unable to update the sent mail on server

    I did my Yahoo account sync with mail 6.3 . I did all the configurations and all the mails are downloaded. Now when I send the mail from browser, the sent mail gets download in mail 6.3 app but when I send the mail from the app it is not getting uplo