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.

Similar Messages

  • 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

  • Getting error while creating Service controller from component controller

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

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

  • 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

  • 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

  • Creating Node for Context in a  component controller disabled.

    Hi, I am trying to create this node, i see the option when I do RightClick the context in the component controller > Create>Node, but i was not able to select it. Am i missing some settings to enable it?
    Appreciate your help.
    Thanks,
    Chinnam.

    hi..
    No worries, this forum will help you
    On top left corner you will find , small icons for change, dispaly..
    just place your mouse over those icons...you wil get the tooltips.
    to build a simple applicatioin
    http://www.****************/Tutorials/WebDynproABAP/SimpleApplication/SimpleApp1.htm
    and to learn webdynpro just go through the below links
    http://www.sdn.sap.com/irj/scn/webdynpro-elearning
    Regards
    Srinivas

  • 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

  • How to access a Java class from view controller?

    Hi All,
    I have created a Test.java class file from Navigator view under
    Src --> Packages --> com.sap.MyProject.
    When I try to access the Test class from view controller,
    I getting this error "Test cannot be resolved or is not a type".
    How do I fix this?
    Thanks
    Sundar

    Hi,
    I have created a Test.java class file from Navigator view under
    Src --> Packages --> com.sap.MyProject.
    After this you can goto the context of your View and define the VA goto the type of VA and click on the right side button and go to java native type and type your java file name click you name .
    that means the jave file s assigned to VA.
    U can utilize thrut that VA.
    Thanks,
    Lohi.

  • How to populate context node of component controller

    Dear People,
    Is there any way i could access my custom context node of component controller in the context node class of my custom controller.
    I am navigating from one component to another, Upon initial launch everything is working fine, however if i go to home page and come back. the assignment block is coming empty.
    In WD_USAGE_INITIALIZE i m binding my custom controllers context node with the component controller's context node of the other component and it works fine when i load the UI. however if i go to home page and come back. the assignment block is coming empty.
    Following code is in method of DO_VIEW_INIT_ON_ACTIVATION of the other componenet.
    METHOD do_view_init_on_activation.
      DATA:   lv_btstatus_parent TYPE REF TO cl_crm_bol_entity,
            lv_comp_ctrl      TYPE REF TO cl_btstatus_bspwdcomponen_impl.
      CONSTANTS:
            lc_us_header      TYPE crmt_relation_name VALUE 'BTStatusHUserAll',
            lc_us_item        TYPE crmt_relation_name VALUE 'BTStatusIUserAll'.
      lv_comp_ctrl ?= me->comp_controller.
    check if relationname has been passed from outside
        gc_relation_name = lv_comp_ctrl->get_relation_name( ).
      IF gc_relation_name IS INITIAL.
      check type of parent to determine relationname
        *lv_btstatus_parent ?= lv_comp_ctrl->typed_context->btstatusparent->collection_wrapper->get_current( ).*
       check lv_btstatus_parent is bound.
        CASE lv_btstatus_parent->get_name( ).
            WHEN 'BTStatusH'.
              gc_relation_name = lc_us_header.
            WHEN 'BTStatusI'.
              gc_relation_name = lc_us_item.
        ENDCASE.
      ENDIF.
    CALL METHOD super->do_view_init_on_activation.
    ENDMETHOD.
    Here lv_btstatus_parent is bound during initial launch, however after navigating back to the same page, its blank leading to exception.
    any suggestions would be helpful.
    regards,
    pradeep

    solved myself

  • Web Dynpro - How to set and get info from Component Controller

    Hi Gurus!!!
    Im having some problems getting and setting info in component controller of my Web Dynpro.
    I can't see the difference between View Context and Global Context.
    How can i create a Global Context Between two views?
    Thanks!
    Regards.
    Polakinho.-

    hii
    difference between view context and global context is we can use the same component controller for all the views in the same application.but when when we create node in view context then it will be available for that view only not for any other view...so if we want to use the same node for all the views we need to create that view in the component controller.so it will become global for that application.
    for using global node you need to map that context in view controller.for that you need to go to that view then click on context tab and drag and drop node from component controller.so it will be available for that view.i hope it helps you.
    regards
    twinkal

  • GP - WD Java: Cannot read callable object description from component

    Hi,
    i use Guided Procedures and therefore i will generate a WebDynproJ Callable Object inside the GP.
    When i try to intergate it into Design-Time i get follwoing error after i picked the WebDynpro Component:
    Cannot read callable object description from component: type com.sap.caf.gp.quotcreate.model.bapi_quotation_createfromdata2.types.Vbeln_Va could not be loaded: com.sap.dictionary.runtime.DdException: TypeBroker failed to access SLD: Error while obtaining JCO connection.
    Well because i could import the Model into the WD Component in NWDS with the given JCo i have no clue why this error is now popping up.
    Does someone have some experience with this phenomenon?!
    I also wanted to check the JCo's in Content Admin but even though i am an Admin (i am sure of this) i have no rights to enter this part. Also the SLD is properly configured!
    br

    Hi Fritz,
    how did you resolve the problem?  thanks a lot!
    Nicola

  • CE: Mapping from Component-Controller to Component-Interface

    Hi experts,
    how can I map the context of a component controller to the component interface? There is a predefined data link between them but I do not find any possibility to edit this link.
    Thank you for each hint,
    Christoph

    Hi,
    Copy the context node from the component controller and paste it to the interface controller.
    Regards
    Ayyapparaj

  • 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

  • I cannot access the iTunes store from any of my computers.  When I updated to v. 10.7 it made my laptop unable to access. I have installed and uninstalled numerous times.

    I cannot access the iTunes store from any of my computers.  When I updated to v. 10.7 it made my laptop unable to access just like with my two desktops. I have installed and uninstalled numerous times.

    Nothing happens.  iTunes just hangs up every time, saying "Accessing iTunes Store."  It does that for a very, very long time, then nothing.  Here is what happens when I run diagnostics.
    Microsoft Windows 7 x64 Home Premium Edition Service Pack 1 (Build 7601)
    LENOVO Lenovo H420
    iTunes 10.7.0.21
    QuickTime not available
    FairPlay 2.2.19
    Apple Application Support 2.2.2
    iPod Updater Library 10.0d2
    CD Driver 2.2.3.0
    CD Driver DLL 2.1.3.1
    Apple Mobile Device 6.0.0.59
    Apple Mobile Device Driver 1.62.0.0
    Bonjour 3.0.0.10 (333.10)
    Gracenote SDK 1.9.6.502
    Gracenote MusicID 1.9.6.115
    Gracenote Submit 1.9.6.143
    Gracenote DSP 1.9.6.45
    iTunes Serial Number 0015AF9C035D73D0
    Current user is not an administrator.
    The current local date and time is 2012-09-15 18:28:21.
    iTunes is not running in safe mode.
    WebKit accelerated compositing is enabled.
    HDCP is supported.
    Core Media is supported.
    Video Display Information
    Intel Corporation, Intel(R) HD Graphics Family
    **** External Plug-ins Information ****
    No external plug-ins installed.
    **** Network Connectivity Tests ****
    Network Adapter Information
    Adapter Name: {EF6BBA91-21E3-44BD-828F-794CBBBFC89D}
    Description: Intel(R) 82579V Gigabit Network Connection
    IP Address: 192.168.1.10
    Subnet Mask: 255.255.255.0
    Default Gateway: 192.168.1.1
    DHCP Enabled: Yes
    DHCP Server: 192.168.1.1
    Lease Obtained: Sat Sep 15 17:52:30 2012
    Lease Expires: Sun Sep 16 17:52:30 2012
    DNS Servers: 192.168.1.1
    Active Connection: LAN Connection
    Connected: Yes
    Online: Yes
    Using Modem: No
    Using LAN: Yes
    Using Proxy: No
    Firewall Information
    Windows Firewall is off.
    Connection attempt to Apple web site was unsuccessful.
    The network connection timed out.
    Basic connection to the store failed.
    The network connection timed out.
    Connection attempt to Gracenote server was successful.
    The network connection timed out.
    Last successful iTunes Store access was 2012-04-29 17:37:19.
    **** Device Connectivity Tests ****
    iPodService 10.7.0.21 (x64) is currently running.
    iTunesHelper 10.7.0.21 is currently running.
    Apple Mobile Device service 3.3.0.0 is currently running.
    Universal Serial Bus Controllers:
    Intel(R) 6 Series/C200 Series Chipset Family USB Enhanced Host Controller - 1C26. Device is working properly.
    Intel(R) 6 Series/C200 Series Chipset Family USB Enhanced Host Controller - 1C2D. Device is working properly.
    No FireWire (IEEE 1394) Host Controller found.
    Connected Device Information:
    Brooke, iPod touch (2nd generation) running firmware version 4.2.1
    Serial Number: 9E******75J
    Most Recent Devices Not Currently Connected:
    iPod nano (6th Generation) running firmware version 1.2
    Serial Number: DC*******DVY
    iPhone 4S running firmware version 5.1.1
    Serial Number: C8*******TF9
    iPad 2 running firmware version 5.1.1
    Serial Number: DK*******FHW
    **** Device Sync Tests ****
    Sync tests completed successfully.
    <Edited by Host>

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

Maybe you are looking for