Method Component Controller

Hi,
I have a method of component controller that call a function via RFC and I have to specify the importing and exporting parameters: how can I do for to specify a parameter as a table?
Tks in advance...

Try creating a service call ..it will take care of creating a component controller method, context nodes for function module interface, the service call method created will have automatically genereated code which fetches data from importing params, calling the function module and then binding the data back to exporting param node.
To create service call just right click on your component and select - create service call ; a wizard will guide you then..
Regards
Manas Dua

Similar Messages

  • Calling a method in view from component controller?

    Hi,
    Is it posible to call a method that is defined in the Component Controller in the View?
    If it is posible please give some sample code how to call the method?
    Regards,
    Padmalatha.K

    Padmalatha, all the methods defined in a controller from 'Methods' tab are instance methods. An instance method defined in a component controller is callable from any view controller that holds a reference to the component controller.
    Defining methods between the tags
    //@@begin others
    //@@end
    is useful if you want to declare static methods.

  • Calling a method in the view controller from the component controller

    Hi
    Is there anyway to call a method in the view implementation from the component controller??
    Thanks
    jack

    Thanks for all your replies. I want this kind of a functionality because Im trying to invove a DC (Child DC) from a Parent DC such that the Child DC's view is displayed onto the view container of the Parent DC. I have embedded using 'interface view of a component instance' in the Parent Window and am able to create the component and set usage though the onPlugDefault of the Child View.
    But I observe that when i make a call from the parent, the flow is like this:
    1. The wdDoInit of the Child Component Controller gets triggered first.
    2. Then the wdDoInit of the Child's <b>VIEW</b> gets triggered
    3. and <b>THEN</b> the onPlugDefault of the Child Component Interface View
    What I had actually wanted was to Fire onPlugDefault where Im calling a method LoadData(), after which the Child DC's view must be triggered so it can display the fetched data.
    What is actually happening is the view gets displayed, but no data is displayed in the view.
    Right now I have just given a work around where Im triggering <b>LoadData()</b> of the <b>COmponent COntroller</b> from the <b>wdDoInit</b> of the <b>VIEW</b>.
    Is there a better way to do this? I find it strange that I have to load the Data from the view.
    Thanks
    Jack

  • Hook methods in component controller vs hook methods in view controller

    Hi,
    I want to know how WDDoInit in component controller differs from the same in view controller.
    How the lifecycle flows in both controllers?
    Eg. if i create a method intialize() in both component  & view controllers and if i called initalize method in view, which one will be called?
    Need to know how the flow works.
    Regards,
    Manoj

    Dear Manoj,
    Please check if it is helpful.
    The order of execution of standard hook methods when a WDJ application is called the first time is as follows:
    1. Component Controller DoInIt()
    2. View Controller DoInIt()
    3. Interface Window Controller
    4. Component Controller DoBeforeNavigation()
    5. Component Controller DoModify()
    6. Component Controller DoPostProcessing()
    After this, if you navigate to some other view, then the order of execution of methods of that New view will be:
    1. Component Controller DoBeforeNavigation()
    2. New View DoInIt()
    3. New View onPlugfromFirstView
    4. Component Controller DoModify()
    5. Component Controller DoPostProcessing()
    Then, if you again navigate back to the first view, then the order of execution of methods is:
    1. Component Controller DoBeforeNavigation()
    2. New View onPlugfromNewView
    3. Component Controller DoModify()
    4. Component Controller DoPostProcessing()
    Webdynpro - Sequence of Execution
    Thanks & Regards,
    Patralekha

  • Call a method in the view from Component Controller

    Hi Friends,
    I have written the code for calling the RFC in Component Controller.
    My requirement is to change the properties of UI elements in the view, if I get any exception while calling RFC.
    Can Call a method in the view from Component Controller.
    Regards,
    Lakshmi Prasad.

    HI,
    You can get the error message during the exception of calling RFC in view itself.
    Any way you may call the RFC at some action in the view only.
    Can you explain me what you are trying to do?
    Kind Regards,
    Mukesh

  • Copying methods from one component controller to other ?

    Hi,
    I have many methods in one component controller, which i wish to copy to another component controller through standard buttons. When i try to copy them, it says 'The method or methods are copied to the clipboard'. But, i was unable to copy them to another component's componentcontroller. It says as 'The clipboard' doesnot contain data. Can someone help me in providing solution in copying all the methods in one shot to other ?
    Thanks & Regards,
    Gaurav.

    Hi,
    I think You are trying it to paste after making new method in the other component directly with the help of Cntrl+V
    I am able to do same by using copy and paste buttons.
    First go to method tab and copy it then go in methods tab in which you want to paste click where we create for new method and click standard button for paste.
    By this way the name of the methods will be same. But if you want that you can rename it.
    I hope it helps.
    Regards,
    Rohit

  • 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

  • Methods in the Component controller

    Hello,
    When is better call a method in the component controller, than run only a viewu2019s method?
    In other words, what kind of methods should to be in the component controller and what kind of methods should to be in the view?
    Could you give me some examples?
    Regards
    Janeth

    hi
    The EventHandler methods like on Action<actionname>() and methods to fire plugs we will generally used in view controllers.
    If we want to intialise any attributes we will do it in WdDoInit() method of view Controller.
    Generally its not preferrable to write business logic which is used by many components like service contoller generated methods in a view.
    Its a good way to use Service Controller methods like execute<bapiname> in Component Controller.
    For Dynamic Generation of UiElements we will use the WdDoModifyView(..) we use it in View.
    Regards
    sowmya.

  • WD ABAP: call dialog window from component controller method

    Hi all,
    I need to call a dialog box from a method in the component controller. It would be helpful if u could post the code too.
    Thanks,
    Sravanthi

    Hi Maksim,
    this is the code i wrote:
    DATA: api_component  TYPE REF TO if_wd_component,
          window_manager TYPE REF TO if_wd_window_manager.
    api_component = wd_this->wd_get_api( ).
    window_manager = api_component->get_window_manager( ).
    wd_this->window = window_manager->create_window(
               window_name = 'OPTIONWD'
               close_button = abap_false ).
    wd_this->window->open( ).
    When i test it, this is the error i get.
    "An Instance of the View OPTIONWD Already Exists in the Component"
    how do i correct it?
    Thanks,
    Sravanthi

  • Call a view's method from Component Controller.

    Hi
    Is it possible to call a view's method from Component Controller.
    Regards
    Nikhil

    Hi Tummuru,
    I have created an event in Component Controller by the name toMenuView. Now I created a method in which this event is getting fired. Foll. is the code of the method.
      public void fireToMenuView( )
       wdComponentAPI.getMessageManager().reportSuccess("fireToMenuView");
       wdThis.wdFireEventToMenuView();
    Now I have created an event handler "handleToMenuView" in the MenuView and subscribed the event handler to the event in Component Controller.
    The control is reaching to the fire event in component controller but not to the Event handler in view controller.
    What am I missing.
    Regards
    Nikhil

  • Calling Component controller method in webdynpro

    Hi All,
    Is it possible to call a method from component controller to view controller?
    Regards,
    Sasikala

    yes it is possible.
    hope this would help you
    http://help.sap.com/saphelp_nw70/helpdata/en/3b/29933f09a5fb47e10000000a114084/content.htm
    Regards,
    nag

  • 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

  • Call component controller method from view

    Hi
    I have created an action in view Thus its event handler is "OnActionDoSomething()"
    And, I have a method in component controller "MethodSaySomething()".
    Now, how can I call MethodSaySomething() from OnActionDoSomething().
    OnActionDoSomething()
    // Call  MethodSaySomething() defined in component controller
    Thanks

    Hi,
        To access the methods present in component controller from View , first u need to add the component controller as the required controller.
    open the view controller --> switch to propertues tab --> add the component controller as required controller(click add controller).
    Now in your action handler , write this below code to add the method:
    wdThis.wdGet<COmponent Controller>().MethodSaySomething();
    Hope it helps
    Thanks and Regards,

  • Method in Component Controller

    Hi,
    In when we see the Methods Tab in Component Controller, There One Check Box we can see as "INTERFACE'.
    Can you please tell me what is the purpose of that/
    Regards
    Sandeep.

    Hi,
    this comes in the concept of Cross Compenent usage.
    Web Dynpro components are reusable modules. This allows you to build Web Dynpro applications that consist of different components. From within a component, an interface enables you to use the data and functions of another component.
    If we mark the method as interface that method will be available in all the other components that we built.we can select that method along with the interface name wich is the compoemt name.

  • FPM : OVERRIDE_EVENT_GAF method of Component Controller

    Hello All
    I am not able catch the button evenet value in OVERRIDE_EVENT_GAF method of Component Controller.
    What i have done is
    1) Created FPM Application with Road Map 4 Mainsteps.
    2) In the First Road Map contains view,  having two buttons. On click of buttons need to hide MainStpes
    Example : On Click of Button1 need to show Step1 Step2 and Step3 means Step4 is hiding
              On Click of Button2 need to show Step1 Step3 and Step4 means Step2 is hiding
    3)For the above requirement In the View created two actions for two buttons. In Button1 action written below code.
    Code for Button1 Action in the View
    data: lo_fpm type ref to if_fpm,*lr_event type ref to cl_fpm_event.
    create event
    lr_event = cl_fpm_event=>create_by_id(
    cl_fpm_event=>gc_event_change_step ).
    lo_fpm = cl_fpm_factory=>get_instance( ).
    lr_event->mo_event_data->set_value(
    iv_key = 'B1'
    iv_value = 'BUTTON1').
    4)  onclick of Button 1 when i m trying to get the value of B1 it is coming empty in the OVERRIDE_EVENT_GAF method of Component Controller. Expecting "BUTTON1"  written below code
    Code for OVERRIDEEVENT_GAF method of Component Controller_
    DATA: lo_fpm TYPE REF TO if_fpm,
    lr_event TYPE REF TO cl_fpm_event.
    get reference to FPM API
    lo_fpm = cl_fpm_factory=>get_instance( ).
    create event
    lr_event = cl_fpm_event=>create_by_id(cl_fpm_event=>gc_event_change_step ).
    lr_event->mo_event_data->get_value(iv_key = 'B1' ).
    5) Based on condition planning to hide the steps.
    IF BUTTON1
    Hide Step4
    IF  BUTTON2
    Hide Step2
    Please help how to get value in OVERRIDE_EVENT_GAF method of Component Controller onAction of Button
    Edited by: CarlinWilliams on Jun 17, 2011 1:56 PM
    Edited by: CarlinWilliams on Jun 17, 2011 1:57 PM

    Hi Carlin,
    You need to ensure that you raise the event:
    e.g. here I raise an event to pass some data from an org chart:
    lo_event =
         cl_fpm_event=>create_by_id( zpa_os_org_struc_flex_n_assist=>c_island_nav_up_requested ).
      lo_event->mo_event_data->set_value(
               iv_key = zpa_os_org_struc_flex_n_assist=>c_node_selected_for_nav
               iv_value = ls_nav_node ).
      wd_this->ao_fpm->raise_event( lo_event ).
    Then you need to read the event. In the OVERRIDE_EVENT_GAF method you can read the event by referring to
    io_gaf->mo_event
    e.g.
    io_gaf->mo_event_data->get_value( exporting iv_key = zpa_os_org_struc_flex_n_assist=>c_node_selected_for_nav
                                              importing ev_value = ls_node_detail  ).
    let me know if you need any other help/explanation,
    Cheers,
    Chris

Maybe you are looking for