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.

Similar Messages

  • Instantiating Model Node in Component Controller with new Abstractlist()

    Hi All,
    We have the following issue.
    When we instantiate a Node - Po_Items using Element.setPo_Items( new AbstractList() )
    We get an error "The Type AbstractList Cannot be instantiate" .
    So how to successfully instantiate AbstractList()  so that ultimately the BAPI_NODE_INPUT can be instantiated.
    Best Regards,
    Roby...

    Hi Murtuza,
    Thanks alot for the response.
    I tried initializing Node using
    Element.addPo_Items(new Bapiekpoc());
    But its not getting initialized and I get following errror when I run the application.
    500   Internal Server Error
    Web Dynpro Container/SAP J2EE Engine/6.40 
    Failed to process request. Please contact your system administrator
    Is there any other way to initialize the Po_Items Node which which is inside the Model Node BAPI_PO_CREATE_INPUT.
    BAPI_PO_CREATE_INPUT ( Model Node )
        -- Po_Items ( Subnode which is an input table inside the BAPI )
    Thanks again & Best Regards,
    Roby....

  • 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

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

  • Late binding of attributes?

    Hi,
    I have a little question regarding the late binding of attributes. Google didn't help so far :(
    I have an object definition, e.g.
    def chart = LineChart
         title: "Line Chart"
    Later on I want (or sometimes need) to bind additonal attributes, e.g.
    chart.width = bind scene.width
    chart.height = bind scene.height
    Unfortunately this results in an error message in Eclipse. What is wrong with this code?
    Another example uses a factory function instead:
    function createWindow( x, y, w, h: Number, caption: String ) : ChildWindow
    return Window { ... }
    Because I use this factory method in different circumstances, I have to bind some of the values of the resulting object outside of the method (I guess in a late binding fashion?). Same as above.
    Has somebody a short hint for me? Any help is highly appreciated.
    Best Regards
    Michael

    I will just advance a guess, I can be wrong of course.
    I would say late binding is not possible.
    Binding in JavaFX actually produces code, whatever the implementation might be, using listener or similar. So binding must be done at compilation time, when defining classes or variables, not at run time.
    Maybe you can use the on replace mechanism to handle these cases?

  • How to get Component Controller getter function

    I have made a mehtod in a component controller (I am trying to make a web dynpro which uses a webservice). Now I want to use it from my View but I cannot find out how.
    According to some examples I've seen there should be a function like wdThis.wdGet<comp> in the View, but I don't have such a function....:-(

    Hi Jan,
    I think that you must not have made the <b>Delta link</b> of the component Controller with the View. if you would have made the link then definately you would have got the access from the View to teh controller.
    <b>Just go to the Component -> (Select you component)-> (Right Click) -> Open data Moduler.</b>
    A Data Moduler Screen will come. Select the <b>Create Delta Link</b>. And and drag the link from the view to the component controller.
    This should definately solve your problem.
    Regards
    Pravesh
    PS: Please consider rewarding points if helpful or solved.

  • Handle button event of popup created from component controller

    Hi all,
    I have created a method for created popup in the component controller with button kind 'yes-no'.Now i use it in the view.
    Till here all is working fine.
    Now i want to use the events which triggers on the popup (yes, no).Any idea how to trigger these buttons action.
    The problem i am facing here is: When i use <b>subscribe_to_button_event</b> method it does not working.
    Any ideas how to use this.
    Points will be sured.
    Sanket sethi

    hi sanket.........
    here is a code snippet... check this out.
    data: l_cmp_api          type ref to if_wd_component,
            l_window_manager   type ref to if_wd_window_manager,
            l_popup            type ref to if_wd_window,
            l_text             type string_table,
            l_api              type ref to if_wd_view_controller.
      l_cmp_api        = wd_comp_controller->wd_get_api( ).
      l_window_manager = l_cmp_api->get_window_manager( ).
      insert `Data where changed` into table l_text.   
      insert `Do you want to save?`        into table l_text.   
      l_popup = l_window_manager->create_popup_to_confirm(
                    text            = l_text
                    button_kind     = if_wd_window=>co_buttons_yesnocancel
                    message_type    = if_wd_window=>co_msg_type_question
                    window_title    = 'Test: Popup to confirm'
                    window_position = if_wd_window=>co_center ).
      l_api = wd_this->wd_get_api( ).
      l_popup->subscribe_to_button_event(
                   button            = if_wd_window=>co_button_yes
                   action_name       = 'YES'
                   action_view       = l_api
                   is_default_button = abap_true ).
      l_popup->subscribe_to_button_event(
                   button            = if_wd_window=>co_button_no
                   action_name       = 'NO'
                   action_view       = l_api
                   is_default_button = abap_false ).
      l_popup->subscribe_to_button_event(
                   button            = if_wd_window=>co_button_cancel
                   action_name       = 'CANCEL'
                   action_view       = l_api
                   is_default_button = abap_false ).
      l_popup->open( ).
    --regards,
      alex b justin

  • Access to an attribute of a value node of a component controller

    Hello experts,
    I'm new to the area of SAP CRM Web Client UI development. My problem is probably very simple and you will surely smile about it.
    I have created my own component with the value node FILE (that consists of five atributes) in the component controller. Unfortunately I have not figured out yet how I can access the value of an attribute.
    The first thing I do not know is where I can find the controller-ID.
    In addition, I get an syntax error Field "TYPED_CONTEXT->FILE->COLLECTION_WRAPPER->GET_FIRST(" unknown in the line with "lo_entity = me->comp_controller->typed_context->file->collection_wrapper->get_first( ).".
    Currently no functionality is included in my code, because firstly I want to understand the basics.
    method OP_FILEUPLOAD.
      data lo_entity       type ref to if_bol_bo_property_access.
      data lv_file_name    type string.
      data lr_file_content type ref to data.
      field-symbols <lv_file_name> type string.
      IF ( comp_controller is INITIAL ).
        get_controller( 'xxxx' ).
      ENDIF.
      lo_entity = me->comp_controller->typed_context->file->collection_wrapper->get_first( ).
      while lo_entity is bound.
        lv_file_name = lo_entity->get_property_as_string( 'FILE_NAME' ).
        lr_file_content = lo_entity->get_property( 'FILE_CONTENT_STRING' ).
        assign lr_file_content->* to <lv_file_content>.
        lo_entity = me->typed_context->file->collection_wrapper->get_next( ).
      endwhile.
    endmethod.
    I hope that I will manage my "problem" with your help!
    Sebastian
    Edited by: Sebastian Lenz on Jun 27, 2011 2:35 PM

    Hi Sebastian,
    The issue is in the following line of your code:
    lo_entity = me->comp_controller->typed_context->file->collection_wrapper->get_first( ).
    The 'typed_context' belongs to your own component controller class and not the standard framework superclass. So, you need to replace this single line of code with something as follows (assuming that your component controller class is ZCL_CUSTOM_BSPWDCOMPONENT_IMPL):
    DATA lr_coco TYPE REF TO ZCL_CUSTOM_BSPWDCOMPONENT_IMPL.
    lr_coco ?= me->comp_controller.
    lo_entity = lr_coco->typed_context->file->collection_wrapper->get_first( ).
    The me->comp_controller reference will refer to the standard framework superclass of all component controllers and this does not have any typed_context attribute with it. The real component controller that gets created when you create a BSP component will have this attribute. That is why you need to first cast it to your own reference type before trying to access its typed_context.
    And if your value node will have only single values, then you can as well do the following to access the attribute ATTRIB1 of context node node1:
    DATA lv_value TYPE string.
    lv_value = lr_coco->typed_context->node1->get_attrib1( attribute path = '' ).
    Basically all attributes can be accessed by above code by using the right getter method.
    Regards,
    Shiromani

  • Value of attribute defined in Component controller level is not avalabale

    Hi Experts,
    I am facing one strange thing.
    There is one standard WD /PLMU/WDC_RFO which i am enhancing.
    I define one attribute at Component controller level and fill it but the value is not available at View level.
    The Attribute is although exist at view level but it is blank.
    Please help.
    Thanks
    Mahesh

    > I define one attribute at Component controller level and fill it but the value is not available at View level.
    >
    > The Attribute is although exist at view level but it is blank.
    >
    > Please help.
    >
    > Thanks
    > Mahesh
    are we talking about "attribute" context node- attribute or component controller attribute ?
    node/attribute means then you may have to check that the node/context is not invalidated in between after you updated the value and the place where you see in the view.

  • Declaring and accessing custom global attributes of component controller

    Hi,
    I want to declare some global attributes for Component Controller and initialize them in WdDoInit() method.
    I have declared them under Component Controller --> Attributes tab --> after wd_context and wd_this (say G_MESSAGE).
    However,  when I am trying to set them in wdDoInit() method, I get compilation error saying G_MYMESSAGE is unknown and its not defined using data statement.
    How do I access these attributes?
    Thanks and regards,
    Amey

    Hello Amey,
    You need to access the variable by "wd_this->g_mymessage"
    Since wd_this attribute in each controller refers to interface of local controller. you could read the description of that attribute in attribute tab.
    Regards
    Anurag Chopra

  • Cannot access Created Context Attribute from Component Controller

    Hello All,
    I have added a new attribute to a node in my component controller 'LOGONUID' and I cannot access it within my windows within the WDA application.
    DATA lo_nd_url_param TYPE REF TO if_wd_context_node.
      DATA ls_workset TYPE wd_this->element_workset.
      "DATA ls_logonuid TYPE wd_this->element_logonuid.
    I get an error as soon as I try to activate this code in my method in my W_MAIN
    In my component controller I do not see it reference in the SAP generated code in my WD_THIS IF_COMPONENTCONTROLLER?
    * Intf.: ig_componentcontroller
    * Purp.: programming interface for access of this controller within
    *        other controllers of the same component
    *        controller:  <COMPONENTCONTROLLER> of
    *        component:   <zhr_wd_mss>
    * UDate: 20111207 145441
    *=====================================================================*
    interface ig_componentcontroller.
      interfaces: ziwci_hr_wd_mss .
      constants:
        wdctx_context type string value `CONTEXT`.
      constants:
        wdctx_cuifcontext type string value `CUIFCONTEXT`.
      types:
        begin of Element_cuifcontext,
          USERID  type String,
          LASTEVENTOPERATION  type String,
        end of Element_cuifcontext,
        Elements_cuifcontext type
           standard table of Element_cuifcontext
           with default key.
      constants:
        wdctx_messages type string value `MESSAGES`.
      types:
        Element_messages type ZHR_S_MESSAGE,
        Elements_messages type
           standard table of Element_messages
           with default key.
      constants:
        wdctx_workset type string value `WORKSET`.
    I want it to be declared as the constant 'WORKSET'
    thank you
    Edited by: Keith Warnock on Dec 7, 2011 8:55 PM
    Edited by: Keith Warnock on Dec 7, 2011 8:56 PM

    > I have added a new attribute to a node in my component controller 'LOGONUID' and I cannot access it within my windows within the WDA application.
    >
    >
    >
    > DATA lo_nd_url_param TYPE REF TO if_wd_context_node.
    >   DATA ls_workset TYPE wd_this->element_workset.
    >   "DATA ls_logonuid TYPE wd_this->element_logonuid.
    >

    >
    This declaration is not right. There is no element logonuid, you  have the attribute inside a node. workset is a node and thats why you can declare that way.
    easiest way is to declate
    data lv_logonuid type <ddic type> or
    data lv_logonuid type wd_this-><node name>-logonuid.
    You can also use the code generator in (CTRL +F7 ) to get/set attributes.

  • Binding 2 Models in the Same component controller

    I'm using 2 Import Adaptive RFC Models. I want to bind both the models in the component controller of the same web dynpro component.
    But when I try to do model binding for the second model, it does not allow me to do so. If I try to bind the same model in a different project, it happens perfectly and works fine. That means the model i.e. the BAPI is perfectly ok.
    Can anyone please tell why is it not allowing to bind 2 models in the component controller of the same web dynpro component?

    Hi Satyadev,
       If I undersatand your description properly, you have 2 models nodes in a webdynpro component, and you want to bind these two together. If this is the question, then, yes you cant do the bindings declaralatively, you have to do it dynamically...
    Look at the code snippet below, it may help you...
    Suppose ChildNode1 and ChildNode2 are the model node in the context of the component controller. Then you can map these two nodes dynamically....
    wdContext.wdGetAPI().reset();
         IWDNodeInfo testNodeInfo1 = wdThis.wdGetAPI().getContext().getRootNode().getChildNode("ChildNode1", IWDNode.LEAD_SELECTION).getNodeInfo();
         IWDNodeInfo testNodeInfo2 = wdThis.wdGetAPI().getContext().getRootNode().getChildNode("ChildNode2", IWDNode.LEAD_SELECTION).getNodeInfo();
         testNodeInfo2.setMapping(testNodeInfo1, true);
         testNodeInfo2.addAttributesFromDataNode();
    Hope this helps,
    Please let me know if I have not understood your question properly...
    Regards,
    Vishnu Prasad Hegde

  • Unable to access Component Controller attributes from Views.

    Hi,
      I am unable to access the attributes in component controller from methods in View even by using WD_COMP_CONTROLLER.
    Say, I want to access the attribute G_FLAG in component controller from a method in the View Controller by the following code :
      WD_COMP_CONTROLLER->G_FLAG = 2.
    Then an error message is showing up saying -  Field G_FLAG is unknown. It is neither in one of the specified tables nor defined by a DATA statement.
    What should I do? Plz suggest..

    Hi,
    Please check the Public check box of the attribute in the component controller.
    Hopefully it will solve your problem.
    Thanks

  • CRM component controller problem

    hi guys,
    Can anybody tell me why i'm having this error,
    Clase excepción: CX_BSP_WD_INCORRECT_IMPLEMENT - Controlador de vista o custom se ha implementado con error
    Método: CL_BSP_WD_CONTROLLER=>DO_CONTEXT_NODE_BINDING
    Línea texto fuente: 51
    I think it's related to component controller of my z component,(it seems as if the ZL_ZBP_ERP_ZERPORDERVIEW3_IMPL class had no component controller. ) i cannot preview the view i have created due to this error.
    Please it's very important
    Edited by: Jon Azkorra Olano on Jul 5, 2010 2:25 PM

    Hi jesus,
      Bind ur view context nodes with ur controller context node so that again u need not pass the values from view to the controller. Now u have all the values in the controller itself. Now in the controller method set all these values to the model node.
    sample code to set the values from current context to the model node  (where agenda is my attribute and ztrng_Insert_Inputone is my model node that is bound):-
    wdContext.nodeZtrng_Insert_Inputone().currentZtrng_Insert_InputoneElement().setAgenda(wdContext.currentContextElement().getAgenda());
    (previously u should have model node and context node also mapped). Thus once u set all the nodes, u can execute ur bapi now.
    Regards,
    R.S.Sirisha.

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

Maybe you are looking for

  • How do i put a tv show from windoes medea player to itunes

    plz help! how do i put a tv show from windoes media player to itunes. ive tried to copy and paste it,and draging it.i can drag my music from windows media playerbut not my movies. i would apreseate it.

  • Data pump using table query

    I am trying to perform a data pump export on a table using a query within a parfile and I am getting some odd behaviour. The database version is 10.2.0.4.3 and the OS is AIX 5.3. The query looks like this. QUERY="POSDECLARATIONQUEUE:where SESSIONID i

  • Module at-exit command

    Hi, Inside this module I have logic for ok_code WHEN 'EXIT'. perform pop_up. form pop_up. function module: do you want to save the changes? if yes. " perform save_changes. " leave program for msave_changes. perform incompletion_logic. " save changes

  • Photos rotated in slide shows

    Help please! I just updated and now my photos in slideshows are rotated although it looks fine in the album.  I already tried command/option and opening iPhoto to rebuild the database.  Any suggestions for how to fix this? iPhoto 9.5.1 Mac OS X 10.9.

  • 10.5.8 Time Machine backup migrate new MacBook pro...?

    Hi all, My venerable PowerBook G4 has died, but I take regular time machine backups. If I purchase a new MacBook Pro, will I be able to migrate my data to it, if it's running Lion. I undestand some of the old programs won't work - so be it, but I'm m