Webdynpro - component controller

Hi Gurus ,
We designed screen in webdynpro . I created attributes in component controller and i tried to copy that attributes from component controller to view context. But i can't able to drag and drop that attributes.. Is there is any other way to copy that attributes or only option is to create attribute directly in view context

Hi meena,
Mapping between the controller is through NODE's. If you want to make you attribute global then you have to define node and create your attribute inside that and go view controller and perform mapping.
If you define attribute in View Controller then that can be use in same View but you cannot use it in different View controller
for this we define global attribute and mapped to different view controllers
As you said you read in the site, it also suggest the same CREATE NODE in CC -> Attribute  -> goto VC and perform Mapping
Regards
farooq

Similar Messages

  • 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

  • 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

  • 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

  • How to call a RFC of a remote system from an ABAP webdynpro component

    Dear Experts,
    I am a newbie in ABAP Webdynpro.
    I am working on a requirement where I have a webdynpro component on ECC system.I need to call a RFC located on CRM system from my webdynpro component on the ECC system.
    How do I do that ?? Please help.
    Regards,
    Mamai.

    Calling RFC from some other system is same as local except the difference is that you have to give destination name while calling.
    And the regarding the method of calling it depends on your FM.
    if it is big RFC with complex structure, you can create the service call for it with destination given as RFC desitination.
    if it is simple straight forward RFC you can directly call it.
    for creating RFC service call call use this method
    1. Starting the Wizard
    To start the wizard, position the cursor on the Web Dynpro component to be edited in the object list at the left margin of the
    workbench window. Open its context menu and choose the entry Create->Service Call. The wizard is started and leads you
    through the creation process.
    Press Continue.
    2. Choice of Controller
    On the second dialog window of the wizard, you can choose whether the service call is to be embedded in an existing
    controller or whether a new controller is to be created for this purpose. Service calls can only always be embedded in
    global controllers u2013 that is, in the component controller or in additionally created custom controllers. It is not possible, to
    embed service calls in view controllers.
    a. Select radio button Use Existent Controller
    b. Do not change the default entry for component: <CC name>
    c. Enter for controller COMPONENTCONTROLLER
    d. Press Continue.
    3. Service Type and Service Selection
    a. You now select, which service type should be used for this service call. Select radio button Function Module. Fill the
    destination here. Press Continue.
    b. Select the service: for Function Module enter <RFC name>. Press Continue.
    4. The Required Methods and Context Elements
    On the two subsequent dialog windows, default values are listed for giving names to the context nodes and attributes
    required by the service call as well as to the required methods. The proposed names are based on the names of the
    embedded service, but you can change them as required. However, heed the respective notes in the corresponding dialog
    box.
    a. Adapt Context: Select from Nodes/Attributes . Press Continue.
    b. Specify Method Name: leave all entries as provided: Component:  Controller: COMPONENTCONTROLLER Method: EXCUTE_ Press Continue.
    5. Completing the Choice
    When you have confirmed the last dialog box, the generation is triggered. Afterwards you now have the required methods
    and contexts at your disposal for using them within your Web Dynpro component.
    or if you want to call directly the use the call statement with destination

  • Nullpointer on com.sap.tc.webdynpro.progmodel.controller.MessageManager

    Dear all,
    i have two web dynpro components, say A and B.
    A is using component B.
    When i push a close button in B, i do the following things:
    1. wdComponentAPI.getMessageManager().reportWarning("Some warning!!!");
    2. wdThis.wdGetICLRequestDetailsController().leaveRequestDetails();
    This leaveRequestDetails() fires a plug (standard) to leave back to my component A and component A deletets the componentUsage when needed... ( if(hasActiveComponent()) )
    Component B has a view with an inputfield for an amount (bigdecimal). When this has valid input and i push the button and execute 1. and 2. everything works fine and i see the warning on the view of my comp. A.
    When i put invalid input in the amount field ( for example some characters) and i push the button, i see an error message on my view in comp. B. (automatic validation)
    When i correct the input and push the submit button again while the previous error message is still visible on the screen (so there's no event trigerred since the automatic validation), i get the following nullpointer exception on calling the deleteComponent method in component A:
    java.lang.NullPointerException
    +     at com.sap.tc.webdynpro.progmodel.controller.MessageManager.setAttributeValidbyContext(MessageManager.java:656)+
    +     at com.sap.tc.webdynpro.progmodel.context.NodeElement.clearPendingInput(NodeElement.java:297)+
    +     at com.sap.tc.webdynpro.progmodel.context.NodeElement.exit(NodeElement.java:132)+
    +     at com.sap.tc.webdynpro.progmodel.context.Node$ElementList.exit(Node.java:1859)+
    +     at com.sap.tc.webdynpro.progmodel.context.Node.clearElements(Node.java:1560)+
    +     at com.sap.tc.webdynpro.progmodel.context.Node.forgetDataNode(Node.java:1733)+
    +     at com.sap.tc.webdynpro.progmodel.context.Node.exit(Node.java:295)+
    +     at com.sap.tc.webdynpro.progmodel.context.Node.exit(Node.java:306)+
    +     at com.sap.tc.webdynpro.progmodel.context.Context.exit(Context.java:53)+
    +     at com.sap.tc.webdynpro.progmodel.controller.Controller.exit(Controller.java:161)+
    +     at com.sap.tc.webdynpro.progmodel.view.View.exitController(View.java:403)+
    +     at com.sap.tc.webdynpro.progmodel.view.View.exitController(View.java:435)+
    +     at com.sap.tc.webdynpro.progmodel.controller.Controller.exit(Controller.java:154)+
    +     at com.sap.tc.webdynpro.progmodel.view.ViewManager.exit(ViewManager.java:125)+
    +     at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.exit(ClientComponent.java:211)+
    +     at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.deleteComponent(ClientComponent.java:195)+
    +     at com.sap.tc.webdynpro.progmodel.components.ComponentUsage.deleteComponent(ComponentUsage.java:199)+
    When i do the same again, but without reporting the warning before leaving comp B, i don't get the nullpointer exception and can continue interacting on my view in component A.
    Can anyone tell me what's the cause for this nullpointer? is it a bug?
    Kind regards.
    J.

    The following is a working solution for me:
    MessageManager mManager = (MessageManager)wdComponentAPI.getMessageManager();
    mManager.reset();
    I have put these lines right before i call the deleteComponent() method in my web dynpro component A.

  • 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

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

  • Is it possible to serialize a web dynpro component controller?

    Hi,
    Is it possible to serialize a web dynpro component controller and deserialize it for use?
    I have one web dynpro application WDA1 for web dynpro component WDC1. And  another web dynpro application WDA2 for WDC2 will be opened in a new window triggered by a button action in WDC1.
    Iu2019d like to pass the object reference of WDC1 component controller to WDC2.
    I first tried to use a static member of a class object but found out that even the static member is initialized and set in WDC1, itu2019s still initial when I access it in WDC2.
    Then I searched the forum and found one article Passing Object ref to Webdynpro Application while calling from BSP screen .
    The recommended way is to serialize the object reference and store in a DB table, later on read it out and deserialize it for use.
    I tried serialization using the following code, but when itu2019s deserialized, the result is initial.
    Can anyone share some ideas on this?
    Serialize
      data: ostream type string,
               xslt_err type ref to cx_xslt_exception.
    ***** serialize model class
      try.
          call transformation id
          source model = wd_comp_controller
          result xml ostream.
        catch cx_xslt_exception into xslt_err.
      endtry.
    Deserialize
        data: istream type string,
              xslt_err type ref to cx_xslt_exception.
        istream = ls_db_sel-obj.
        data lr_wdc type REF TO ZIWCI_BY_WDC_SERIALIZE.
        try.
            call transformation id
            source xml istream
            result model = lr_wdc.
          catch cx_xslt_exception into xslt_err.
        endtry.

    When you say new window, I assume you mean new browser window. This is a separate user session then.  This is why the singleton pattern doesn't work.  Have you considered using a new dialog window instead of a new browser window.  It will be modal, but will share the same user session as the parent window.
    >Why do you choose this approach over cross-component usage ? component usage is the way webdynpro components are >to be reused.
    >You can also consider using Singleton OO pattern class to share data between these two components.
    Neither of these approaches will work if you are using separate browser windows. Such an approach results in two separate user sessions (perhaps even running on different application servers depending upon how you have load balancing setup) and therefore can't share data using either of these approaches.
    In general the idea of serialization and then writing the string ito a server cookie or other database table is sound.  I don't think you should try and serialize the component controller, however.  Serialization only saves and restores public attributes - not protected or private ones.  So in general a class has to be designed for serialization.  The component controller is much too complex and wasn't designed for such an operation. 
    I would suggest instead extracting the data you want to share out of component controller or context and serializing it into a custom class and passing that to the other component.

  • Assistance class not instantiated in the component controller of an ABAP WD

    I have a very weird problem when trying to launch an ABAP webdynpro I get a short dump, looking into it the assitance class does not get instantiated properly so it falls over.  It used to work, but I don't think I have substantially changed anything with the assitance class just on the layout, although something must have changed.
    In the constructor of the component controller it trys to cast (I think that is the correct term)  the assistance class from the compoent controller as below, Me->f_Alter_Ego->assistance_class is initial so that fails, it then tries to create the assistance class and falls over on create object Me->f_Assist.
      try.
        Me->f_Assist ?= Me->f_Alter_Ego->assistance_class.
      catch cx_sy_move_cast_error.    "#EC NO_HANDLER
      endtry.
      if not Me->f_Assist is bound.
        create object Me->f_Assist.
      endif.
    Extract from the short dump below.
    What happened?
        Error in the ABAP Application Program
        The current ABAP program "/1BCWDY/4LYS0NWZ8L8ENKKA93YQ==CP" had to be
         terminated because it has
        come across a statement that unfortunately cannot be executed.
        The following syntax error occurred in program
         "ZCL_WD_USER_MAINT=============CP " in include
         "ZCL_WD_USER_MAINT=============CM004 " in
        line 7:
        "You can only use "class=>method" with static methods."
    Other ABAP web dynpros in our system are fine.
    I have tried the obvious stuff like removing the assitance class from the WD component and putting it back in again.
    There is obviously somehting I am missing can anyone point me in the right direction or has experienced this before?
    Thanks,
    Tim

    Thanks Thomas,
    I could not see the wood for the trees on that one, I had syntax checked the assitance class ZCL_WD_USER_MAINT, however, that error would have been raised at runtime.
    Anyway all sorted now.
    Cheers,
    Tim

  • 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

  • Access global attribute in webdynpro component?

    Hi all i have 2 webdynpro components
    Comp1
    Comp2
    Now i have declared a global attribute in comp1 in component controller.
    I have embedded both component together to share values
    I want to change the global attribute of comp1 from comp2
    Let me know how to proceed.
    Thanks

    There are different ways you can accomplish this. Using an interface method as Jitendra Yadav mentioned above is one. Another way, you can define an interface node in comp1 component controller. This node will be visible in comp2 (provided you declared comp1 usage in comp2). Then, you can set values of all of the interface node's elements.

  • 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

  • Custom vs component controller

    i was trying to use component controller instead of custom controller in the Get Flight List application. but it is not working. can any one tell why?
    when do we use custom controller and when component controller?

    Hai vineet,
    For Normal and simple applications you can use Component controller , If you are using complex application that contains more models and more views , you can share the data by using custom controllers,
    can you breifly explain what's your problem is?
    to get the reponses immediately post this thread on Webdynpro for java forum
    regards,
    Naga

  • Component controller is consuming lots of memory

    Hi All,
    I have an WebDynpro application and a component controller (MyCompController) too where I have written most of the business specific code. The basis team informed that the component controller (MyCompController) is consuming lots of memory.
    Could anybody suggest me how to takle this problem. I dont have any other details and I am new to handle this kind of activity.
    Thanks & Regards,
    Patana

    Hi Patana
    Your controller can consume lots of memory because of lots of unnecessary data is loaded in advance and do not used actually. Try to analyze the following points:
    1. Unnecessary data is loaded into the context nodes in advance. Do not load all the data into the context in wdInit() method (do not fill in all the models too). This is not the right way. Instead try to use supply-functions for each context node with data. Supply-function will be called by Webdynpro automatically only when the data is actually required to be shown on UI.
    2. Unnecessary embedded Webdynpro components are created and loaded in memory in advance. Do not create embedded Webdynpro components manually in wdInit() method. Instead try to setup component usages with Create Mode option = OnDemand. Then Webdynpro will create the components automatically when this is really required.
    BR, Sergei

Maybe you are looking for

  • Issue with Submitting a ALV report in container ...

    Hello Gurus, I know how to display data in ALV in container on screen. My issue is, I have a container defined on screen. I have a separate report whose output is in the ALV form. Now if I submit the report in the PBO, I do not get the ALV output of

  • T61 will not boot with nvidia quadro 140m driver

    Hi all, A couple of weeks ago, after allowing MS update to install some FTDI driver updates, my system will not boot up and hangs shortly after the initial vista loading screen. The screen goes black with some HD activity and eventually reboots. Afte

  • Output Error Counts

    Hello, I'm seeing the same number of output errors across multiple ports on one of our Nexus pairs. Each port has the same vlan in common and I'm wondering if there is any way to narrow down exactly where these errors are starting. From what I've rea

  • 2.16 GHz Intel Core Duo/ 2GB ram upgrade ?

    Please could someone tell me if I can upgrade my MacBook Pro 2.16 GHz Intel Core Duo/ 2 GB SDRAM running 10.6.8 to Lion as I need it to run some 2015 software ?  IF I can, what are the dangers I must look for and will my laptop then be even slower th

  • Modification of PD infotype 1050 screen

    Hi All, I would like to know the process of hiding fields on a standard PD infotype like 1050. I know of the table T77CD and creating an alternate screen. How do you go about creating an alternate screen and where do you specify the Z-module pool for