Wd_this, wd_contex

Dear Folks,
I am very new to wd abap, ple give the difference of
WD_THIS
WD_CONTEXT
WD_COMP_CONTROLLER attributes.
Thanks & Regards,
sri

Reference Variable WD_CONTEXT
WD_CONTEXT
Attribute WD_CONTEXT is a reference to the controller context. Regardless of the edited
controller, it is always a reference variable of the type IF_WD_CONTEXT_NODE [page 859].
You can use WD_CONTEXT and the interface methods to edit the content of a context node
in your controller method.
Example:
The controller context contains the node MY_TABLE_NODE. You can use the method
INVALIDATE_TABLE_NODE to invalidate the values of the node elements.
method INVALIDATE_TABLE_NODE .
data: TABLE_NODE type ref to IF_WD_CONTEXT_NODE.
TABLE_NODE = WD_CONTEXT->GET_CHILD_NODE( 'MY_TABLE_NODE' ).
TABLE_NODE->INVALIDATE( ).
endmethod.
Each controller contains a local interface which can be accessed in the controller.
The controller attribute WD_THIS is a reference to this local interface. Depending on the
controller, a reference variable is of the following type:
● IF_COMPONENTCONTROLLER
&#9679; IF_<MY_CUSTOM_CONTROLLER>
&#9679; IF_<MY_VIEW>
&#9679; IF_<MY_WINDOW>
Attribute WD_COMP_CONTROLLER of the View Controller
In most cases, it is useful to declare the usage of the component controller for a view
controller. The development environment has therefore predefined this step. In addition, each
view controller already contains the attribute WD_COMP_CONTROLLER, which is a
reference variable of the type IG_COMPONENTCONTROLLER. In each view controller, you
can use the attribute WD_COMP_CONTROLLER to access all publicly accessible methods of
the component-global generated interface of the corresponding component controller.

Similar Messages

  • A question about wd_this

    Hi
    I tried searching for this but couldn't find an answer.
    Now how come for attributes and context elements of a view we always need to prefix wd_this-> but not for methods? Something to do with if_main being a self reference?
    Thanks
    Pushpraj

    Pushpraj,
    I'm equally as confused - even your last post doesn't really answer why we need this.
    In a class you can have a class attribute and a local method variable - and there is no prefix that we must use to get access to the class attribute.
    I think you have to go back to the WD Java origins of WD ABAP - in WD Java there was/is declared in the component and view classes a reference to a variable "wdThis" which has pointers to the component api. When they built WD ABAP they needed somewhere to store the various class attributes (in much the same way as Java) and they came up with the "attributes" tab.
    Now this is where I'm lost - in WD Java to define a new attribute of the class - you do just that - you have no need to reference it back to wdThis...
    I think it comes down to the interface tick (the ability in WD ABAP to expose a class attribute globally) (I guess it had to happen - half the ABAP coders out there still think in terms of GLOBAL variables) - in WD Java you'd use a setter and getter method were you wanting to change/get a class attribute (and even there potentially you should instead be using the context? - why have two different methods of data transfer within the same code) - whereas ABAP doesn't really bother - in order to allow access to the attributes via the compiled external reference presented to other classes (internally to the class wd_this ) is generated. And here I think the guys who built the compiler/code checking tools got lazy - they found it easier just to redirect all class attribute checking to the wd_this interface - rather than build an internal representation.
    But in truth - it's not that hard to type wd_this->blah... sometimes it's even nice in ABAP classes to refer to me->blah just to reinforce that the variable is a class attribute ( not that ABAP allows variable overloading ).
    I find issues such as no forward creation of methods/attributes/messages etc by double clicking on the code I've written to be a much bigger issue, and far more irritating.
    Sorry this probably didn't answer your question - but it was an interesting question and I just wanted to add a little to it.
    Perhaps some of the developers who I've accused of being lazy when they developed this requirement to have wd_this when referencing the class attributes will stand up and explain better why they did this!

  • Wd_this and if_componentcontroller ?

    hi friends...
    I am new to WDA, can you explain me the followings...
    l_node = wd_context->get_child_node( wd_this->wdctx_node_1 ).
    and
    l_node = wd_context->get_child_node( name = if_componentcontroller =>wdctx_node_1 ).
    i hope both statements are same purpose to get the child node within the root node...
    and wdctx_node_1 is the constant which holding the node name.
    in the first statement,  wd_this->wdctx_node_1 what this mean ? here wd_this means what ?
    in the second statement,  if_componentcontroller =>wdctx_node_1 what this mean ? here if_componentcontroller means what ?
    and why we are using -> symbol in 1st statement and => symbol in 2nd statement ?
    what is the difference between both...?
    kindly explain me in detail...
    By
    Deva

    Hi ,
    Here the wd_this refers that it is pointing or refreing to the present controller reference .
    eg: when you find the code using the wd_this which means it is pointing or refering to that particular view or to that context or so on....  which means this or self refrence concept in classes.
    Next coming to the concept of  if_componentcontroller which means that it is the refrence of the component controller  but both the peice of code serves the same purpose .
    here -> symbol refers that it is an instance method of this controller.
    and => refers that it is the static method of that controller or context .
    in your webdynrpo component open the method where u have written the code and in the application tool bar you can find the button called Display controller interface there you can find the code and find the difference of these two kinds .
    GoodDay .
    Regards,
    Sana.

  • Wd_this- get_componentcontroller_ctr() is not recognised

    Morning all
    I am trying to create a (popup) window to display a table that a user will then select one line from.
    I seem to have an issue in that the method get_componentcontroller_ctr() of wd_this is not recognised.
    The following is my code
    data:
        lr_window_manager type REF TO if_wd_window_manager,
        lr_component_api type REF TO if_wd_component,
        lr_view_controller type REF TO if_wd_view_controller,
        lr_compcontroller type REF TO ig_componentcontroller.
    lr_compcontroller = wd_this->get_componentcontroller_ctr( ).
    lr_component_api = wd_comp_controller->get_api( ).
    lr_window_manager = lr_component_api->get_window_manager( ).
    lr_compcontroller->mr_window = lr_window_manager->create_window( window_name = 'W_SELECT' ).
    lr_compcontroller->mr_window->open( ).
    I have also created an entry in the attibutes of the componentcontroller for the mr_window and marked it as public.
    Any ideas?
    Ian
    Does the method have to be an event handler method?
    Message was edited by:
            Ian Stubbings

    Hi Alexander
    I took the code from Ulli's book Web Dynpro for ABAP.
    I was in a method of the component controller but have now replaced the code with a view controller method.  Not very pretty but does the job at the moment while understand more about WDA!
    METHOD onactionfill_timesheet .
      DATA:
         lr_window_manager TYPE REF TO if_wd_window_manager,
         lr_component_api TYPE REF TO if_wd_component,
         lr_view_controller TYPE REF TO if_wd_view_controller,
         lr_compcontroller TYPE REF TO ig_componentcontroller.
      wd_comp_controller->fill_timesheet( ).
    Set up the window manager
      lr_compcontroller = wd_this->get_componentcontroller_ctr( ).
      lr_component_api = wd_comp_controller->wd_get_api( ).
      lr_window_manager = lr_component_api->get_window_manager( ).
      lr_compcontroller->mr_window = lr_window_manager->create_window( window_name = 'W_SELECT' ).
      lr_compcontroller->mr_window->open( ).
    ENDMETHOD.

  • Subscribe to other views apart from wd_this

    Hi
    How would I subscribe to another view to the one I'm currently coding in?
    I wish to subscribe to an event in one view but have the action that is triggered in another event.
    Is this possible and if so recommended?
    Cheers
    Ian

    Hi Thomas
    It turned out that what I was doing was incorrect anyway.  What I am now trying to achieve is to subscribe to the urn:com.sapportal.portal:browser, load event.
    Do you know if this can be used in WDA as well as WDJ?
    I have also used a timed trigger - which works - but unfortunately the minimum delay is 1 second which is too long.
    Cheers
    Ian

  • Links not getting displayed in the contextual panel

    Hi,
    I have created a contextual panel inside a transparent container. And created a method in the same view supply_values of type supply function to supply the values to the panel.Inside the method I have coded like:
    DATA TAB  TYPE WD_THIS->ELEMENTS_N_VIEW_SWITCH.
      DATA LINE TYPE WD_THIS->ELEMENT_N_VIEW_SWITCH.
      LINE-TEXT    = 'User Manual'. "#EC NOTEXT
      LINE-ENABLED = ABAP_TRUE.
      APPEND LINE TO TAB.
      LINE-TEXT    = 'Logout'. "#EC NOTEXT
      LINE-ENABLED = ABAP_TRUE.
      APPEND LINE TO TAB.
      NODE->BIND_TABLE( TAB ).
    Also in the context of the view I have created a node and supplied the method  'supply_values' in the supply function.Under the node I have 2 attributes named text and enabled. Text is of string type and enabled is of boolean type. In the properties of the contextual panel I have bound the visible property with the enabled attribute.
    Now when I am running this application , links are not getting displayed in the contextual panel. Though when I debug TAB contains the values.  Please suggest if I have missed out something or I need to look into the properties of the contextual panel. Any pointers will be really helpful.
    Regards,
    Ashutosh

    Hi,
    Can you elaborate ' ItemEnable property of ViewSwitch'.
    I have already bound the enable property of the panel with a context attribute of type wdy_boolean  but it is still not working. 
    Regards,
    Ashutosh

  • Embed view in view container dynamically

    Hello Experts,
      I have links in my web dynpro ABAP view, when user clicks on a link I need to show another view in view container.  For example I have two links in my view and when user clicks on link1 I need to show VIEW1 to the user in the view container UI element, if user clicks on link2 I need to show VIEW2.  I have written the below code in Link action method.  But it is not working.  Any one can help in this?
      DATA : lo_window_controller TYPE REF TO if_wd_window_controller.
      DATA : lo_view_controller TYPE REF TO if_wd_view_controller.
      DATA : lo_window_rr TYPE REF TO if_wd_rr_window.
      lo_view_controller   = wd_this->wd_get_api( ).
      lo_window_controller = lo_view_controller->get_embedding_window_ctlr( ).
      lo_window_rr         = lo_window_controller->get_window_info( ).
    Embedding view
      lo_window_rr->embed_view( used_view_name     = 'V_EMP_TERMINATION'
                                embedding_position = 'V_ACTION/VCU_CONTAINER'
                                used_component_name = 'ZHR_MSS_APPL' ).
    with best regards
    K. Mohan Reddy

    Hi mohan ,
    You written the code for embedding the view . then you have to creat the navigation link then only you can do navigation
    Look at the sample code for creating the navigation link dynamically
    DATA lo_navi_services TYPE REF TO if_wd_navigation_services_new.
    DATA lo_api_v_main_wf TYPE REF TO if_wd_view_controller.
    DATA lo_navi_services TYPE REF TO if_wd_navigation_services_new.
    DATA lo_view_usage TYPE REF TO if_wd_rr_view_usage.
    DATA lo_window TYPE REF TO if_wd_rr_window.
      lo_api_v_main_wf = wd_this->wd_get_api( ).
      lo_navi_services ?= lo_api_v_main_wf.
      lo_view_usage = lo_api_v_main_wf->get_view_usage( ).
      lo_window = lo_view_usage->get_window( ).
    CONSTANTS lc_target TYPE string VALUE 'VIEW_MAIN_WF/VC_WF'. "viewname /view vontainer name
    *Write the code for getting the view name here
    if view_name is not initial
       TRY.
         lv_window_name = lo_window->get_name( ).
         wd_comp_controller->fire_unactivate_all_pro_event( ).
            wd_this->m_navi_repository_handle = lo_navi_services->do_dynamic_navigation(
                source_window_name        = 'lv_window_name'
                source_vusage_name        = lo_view_usage->name
                source_plug_name          =  'source_out_plug'
             plug_parameters           = lv_plug_parameter
                target_view_name          = lv_view_name
                target_plug_name          = 'FROM_Plug'
             target_embedding_position = lc_target )."lv_target ).
          CATCH cx_wd_runtime_repository INTO lr_error.
        ENDTRY.
    hope thisl piece of code is help full
    regards
    chinnaiya

  • Read action from a different view in the same window

    Hi all,
    I have a view which contains a ViewContainerUIElement and a ButtonRow. A second view with form fields is embedded in the container of the first view. Validation of the form fields in the second view depends on the button pressed in the first view. How can I determine in the second view, the name of the action that is executed in the initial view?
    Thanks and regards,
    Patrick

    Patrick - I answer this question in a previous forum [Close a popup of another view being on the Main View;
    If you used the wizard in order to create the popup the wizard create a button "OK" that I'm guessing you change to "SAVE", you will need to create an EVENT HANDLER under your method list tab in my example my EVENT HANDLER is "SEARCH_RESULT" once the user click the "OK" button it will call SEARH_RESULT event and it will do your code inside the event.
      DATA LO_WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER.
      DATA LO_API_COMPONENT  TYPE REF TO IF_WD_COMPONENT.
      DATA LO_WINDOW         TYPE REF TO IF_WD_WINDOW.
      data LO_VIEW_C         type REF TO if_wd_view_controller.
      lo_view_c = WD_this->wd_get_api( ).
      LO_API_COMPONENT  = WD_COMP_CONTROLLER->WD_GET_API( ).
      LO_WINDOW_MANAGER = LO_API_COMPONENT->GET_WINDOW_MANAGER( ).
      LO_WINDOW         = LO_WINDOW_MANAGER->CREATE_WINDOW(
                         WINDOW_NAME            = 'SEARCH_POPUP_WIN'
      *                  title                  =
      *                  close_in_any_case      = abap_true
                         MESSAGE_DISPLAY_MODE   = IF_WD_WINDOW=>CO_MSG_DISPLAY_MODE_SELECTED
      *                  close_button           = abap_true
                         BUTTON_KIND            = IF_WD_WINDOW=>CO_BUTTONS_OK
                         MESSAGE_TYPE           = IF_WD_WINDOW=>CO_MSG_TYPE_NONE
                         DEFAULT_BUTTON         = IF_WD_WINDOW=>CO_BUTTON_OK
    lo_window->subscribe_to_button_event( button = IF_WD_WINDOW=>CO_BUTTON_OK
      action_name = 'SEARCH_RESULT'
      action_view = lo_view_c
      is_default_button = ABAP_true ).
    *  lr_popup->open( ).
      LO_WINDOW->OPEN( ).
    the subscribe_to_button_event will call the event handler and it will trigger your code inside the event.
    Thanks
    Jason P-V

  • Interactive forms- i see only one record -how can i see more?

    Hi experts,
    i have a table and the result is only one record instead of more records.
    how can i see more records?
    my code is:
    types: begin of structure_0021,
    favor type pa0021-favor,
    yy_id type pa0021-yy_id,
    fgbdt type pa0021-fgbdt,
    end of structure_0021.
    data: it_0021 type table of struct_0021,
             wa_0021 like line of it_0021.
    select favor yy_id fgbdt from pa0021 into corresponding fields of table it_0021
    where pernr = lv_pernr and
    subty = '2'.
    data: lo_nd_adobe2 type ref to if_wd_context_node,
            lo_nd_ls00212 type ref to if_wd_context_node,
            lo_el_ls00212 type ref to if_wd_context_element,
           ls_ls00212 type wd_this->element_ls0021.
    lo_nd_adobe2 = wd_context->get_child_node( name = wd_this->wdctx_adobe).
    lo_el_ls00212 = lo_nd_adobe2->get_element().
    lo_nd_ls00212 = lo_nd_adobe->get_child_node(name = wd_this->wdctx_ls0021).
    lo_el_ls00212 = lo_nd_ls00212->get_element().
    loop at it_0021 into wa_0021.
    lo_el_ls00212->get_static_attributes(importing static_attributes = ls_ls00212).
    endloop.
    lo_nd_ls00212->bind_table(new_items = it_0021).
    if anyone can help me - i will really appreciate it.
    i tried other thing and didnt succeed.
    thanks,
    Michal.

    Obvious question, but have you got 'Find My iPhone' set on both devices?  Settings>iCloud>Find My iPhone.

  • Error: While Opening a Custom view- Action &OBJECT_ID& does not exist

    Hi Experts,
    On the click of button, I am creating a window and opening as follows:
      wd_comp_controller->go_window         = lo_window_manager->create_window(
                          window_name            = 'ZW_CERTIFICATION_POP'
                          title                  = lv_pop_title
                          close_in_any_case      = abap_false
                          message_display_mode   = if_wd_window=>co_msg_display_mode_selected
                          close_button           = abap_true
                          button_kind            = if_wd_window=>co_buttons_okcancel
                          message_type           = if_wd_window=>co_msg_type_none
    I have written following code in INIT method of View to Subscribe events but it is dumping with the Error "Action &OBJECT_ID& does not exist ".
    DATA lv_ok     type string.
    DATA lv_cancel type string.
    DATA lo_popup  TYPE REF TO if_wd_window.
    DATA lo_view   TYPE REF TO if_wd_view_controller.
    DATA lo_window_ctlr type ref to if_wd_window_controller.
    register button events
        lo_view = wd_this->wd_get_api( ).
        lo_window_ctlr = lo_view->get_embedding_window_ctlr( ).
        wd_comp_controller->go_window = lo_window_ctlr->get_window( ).
        lv_ok = cl_wd_utilities=>get_otr_text_by_alias( alias = 'PAOC_RCF_UI/OK' ).
        wd_comp_controller->go_window->subscribe_to_button_event(
                       button            = if_wd_window=>co_button_ok
                       button_text       = lv_ok
                       action_name       = 'OK'
                       action_view       = lo_view
                       is_default_button = abap_true
        lv_cancel = cl_wd_utilities=>get_otr_text_by_alias( alias = 'PAOC_RCF_UI/CANCEL' ).
                   wd_comp_controller->go_window->subscribe_to_button_event(
                      button            = if_wd_window=>co_button_cancel
                      button_text       = lv_cancel
                      action_name       = 'CANCEL'
                      action_view       = lo_view
                      is_default_button = abap_true
    How to solve this exception causing application to dump.
    Thanks
    Depesh

    Hi Depeshn,
    I have written following code in INIT method of View
    I think you have writen code containg subscribe_to_button_event method in the INIT method of the pop up view. But actually you should write that code where you are generating the pop up window. i.e in the ONACTION method of the button (which when clicked generates the pop up window.)
    It should be something like this:
    " This whole code should come in the event handler of the button.
    wd_comp_controller->go_window = lo_window_manager->create_window(
    window_name = 'ZW_CERTIFICATION_POP'
    title = lv_pop_title
    close_in_any_case = abap_false
    message_display_mode = if_wd_window=>co_msg_display_mode_selected
    close_button = abap_true
    button_kind = if_wd_window=>co_buttons_okcancel
    message_type = if_wd_window=>co_msg_type_none
    DATA lv_ok type string.
    DATA lv_cancel type string.
    DATA lo_popup TYPE REF TO if_wd_window.
    DATA lo_view TYPE REF TO if_wd_view_controller.
    DATA lo_window_ctlr type ref to if_wd_window_controller.
    * register button events
    lo_view = wd_this->wd_get_api( ).
    lo_window_ctlr = lo_view->get_embedding_window_ctlr( ).
    wd_comp_controller->go_window = lo_window_ctlr->get_window( ).
    lv_ok = cl_wd_utilities=>get_otr_text_by_alias( alias = 'PAOC_RCF_UI/OK' ).
    wd_comp_controller->go_window->subscribe_to_button_event(
    button = if_wd_window=>co_button_ok
    button_text = lv_ok
    action_name = 'OK'
    action_view = lo_view
    is_default_button = abap_true
    lv_cancel = cl_wd_utilities=>get_otr_text_by_alias( alias = 'PAOC_RCF_UI/CANCEL' ).
    wd_comp_controller->go_window->subscribe_to_button_event(
    button = if_wd_window=>co_button_cancel
    button_text = lv_cancel
    action_name = 'CANCEL'
    action_view = lo_view
    is_default_button = abap_true
    I hope it helps.
    Regards
    Arjun

  • Fields appear as "Read Only" in an Int.Form called from a WD

    Hi Experts!
    I am having a doubt in an Adobe Int.Form, that is called from a WD application.
    The fields that are in my Form, always appear as a "read only". It is not possible to modify anything there.
    Here, I describe the steps that I follow.
    I create a very simple WD application. In its WD View, exist an unique Object (Adobe Interactive Form).
    In that object, I set the properties:
    "Data source": a context variable type "my structure". "My structure", is a simple structure with a couple or three fields, let´s say PERNR, BUKRS, WERKS... It is linked to the Form Interface (ABAP DICTIONARY-BASED INTERFACE). So in this way, the link between my WD and the AdobeInt.Form is working.
    "PDF Source": a context variable type XSTRING.
    "Template Source": here I have set my Int.Form. Currently, it only contains a couple of fields
    "Enabled": True.
    "Read Only": False.
    In the AdobeForm, I have drag & droped those 2 or 3 fields, save it, and activate it. I guess nothing more is needed, for my test.
    And at last, in the View´s method WDDOINIT, I am reading one of those fields, let´s say the employee number (PERNR), and I set by hardcoding its number (let´s say -> 00000001).
    Until here, everything seems to work fine. When I launch the WD test, the Adobeform appears, at the moment, with only one of my fields (Employee - PERNR), and its value is filled in with '00000001'.
    But now, I would like to write something by myself. And when I try to do it, it is not possible! Field PERNR, is displayed as a "READ ONLY".
    Someone knows what is happening here? I guess it should be possible, to activate as a "EDITABLE" that field in my Form.
    So here is my doubt.
    Am I doing anything wrong? Or am I doing any mistake?
    Thank you very much in advance!

    Finally I think I have found the problem.
    In the View where I am printing the ADOBEFORM, it is needed this code under the method WDDOMODIFYVIEW.
    method WDDOMODIFYVIEW .
      DATA: LV_INTERACTIVE_FORM   TYPE REF TO CL_WD_INTERACTIVE_FORM,
                 LV_METHOD_HANDLER     TYPE REF TO IF_WD_IACTIVE_FORM_METHOD_HNDL.
      LV_INTERACTIVE_FORM ?= VIEW->GET_ELEMENT( 'INT_FORM' ). "   adobeform object in view
      IF LV_INTERACTIVE_FORM IS NOT INITIAL.
          LV_METHOD_HANDLER ?= LV_INTERACTIVE_FORM->_METHOD_HANDLER.
          LV_METHOD_HANDLER->SET_LEGACY_EDITING_ENABLED( ABAP_TRUE ).
          LV_METHOD_HANDLER->SET_HIDE_NAVIGATION_PANEL( ABAP_TRUE ).
          LV_METHOD_HANDLER->SET_DISABLE_PRINT_BUTTON( ABAP_TRUE ).
          WD_THIS->M_METHOD_HANDLER ?= LV_INTERACTIVE_FORM->_METHOD_HANDLER.
          WD_THIS->M_METHOD_HANDLER->SET_HIDE_TOOLBARS( ABAP_TRUE ).
        ENDIF.
    endmethod.
    Regards,
    Carles

  • WDA error in changing read only property of fields at runtime

    Hello Friends,
    I am creating a custom Web Dynpro ABAP Application for FI module in ECC 6.0
    I need to make a set of fields uneditable/grayed out based on a value in a dropdown list. If the user chooses the other value (out of the 2 values provided) in the dropdown list, the set of fields need to made editable.
    I created a context attribute of type WDY_BOOLEAN and bound this attribute to the "readOnly" property of the aforementioned fields. When defining context binding, I chose the option "Bind Directly to the Selected Attribute".
    I have written the following code in the OnSelect event handler method for the dropdown:
    I read the value in the dropdown which is stored in the variable "lv_payment_instrument". Based on this value, I am changing the value of the context attribute:
    if lv_payment_instrument = 'X'.
      DATA lo_nd_check_fields1 TYPE REF TO if_wd_context_node.
      DATA lo_el_check_fields1 TYPE REF TO if_wd_context_element.
      DATA ls_check_fields1 TYPE wd_this->Element_check_fields.
      DATA lv_editable1 TYPE wd_this->Element_check_fields-editable.
    navigate from <CONTEXT> to <CHECK_FIELDS> via lead selection
      lo_nd_check_fields1 = wd_context->get_child_node( name = wd_this->wdctx_check_fields ).
    @TODO handle non existant child
    IF lo_nd_check_fields IS INITIAL.
    ENDIF.
    get element via lead selection
      lo_el_check_fields1 = lo_nd_check_fields1->get_element( ).
    @TODO handle not set lead selection
      IF lo_el_check_fields1 IS INITIAL.
      ENDIF.
    @TODO fill attribute
    lv_editable = 1.
    set single attribute
      lo_el_check_fields1->set_attribute(
        name =  `EDITABLE`
        value = 'ABAP_FALSE' ).
    elseif lv_payment_instrument = 'Q'.
      DATA lo_nd_check_fields TYPE REF TO if_wd_context_node.
        DATA lo_el_check_fields TYPE REF TO if_wd_context_element.
        DATA ls_check_fields TYPE wd_this->Element_check_fields.
        DATA lv_editable TYPE wd_this->Element_check_fields-editable.
    *navigate from <CONTEXT> to <CHECK_FIELDS> via lead selection
        lo_nd_check_fields = wd_context->get_child_node( name = wd_this->wdctx_check_fields ).
    *@TODO handle non existant child
       IF lo_nd_check_fields IS INITIAL.
       ENDIF.
    *get element via lead selection
        lo_el_check_fields = lo_nd_check_fields->get_element( ).
    *@TODO handle not set lead selection
        IF lo_el_check_fields IS INITIAL.
        ENDIF.
    *@TODO fill attribute
       lv_editable = 1.
    *set single attribute
        lo_el_check_fields->set_attribute(
          name =  `EDITABLE`
          value =  'ABAP_TRUE' ).
    endif.
    When the user chooses either of the 2 values in the dropdown, the set of fields are made uneditable. I am unable to make them editable again.
    I would greatly appreciate your inputs/thoughts on how to rectify this error.
    Regards,
    Arun.

    Hi,
    Create one attribute of type WDY_BOOLEAN , i think u already done.
    First get selected dropdown value into one variable.
    For example  :
    lo_el_segment1 = WDEVENT->GET_CONTEXT_ELEMENT( 'CONTEXT_ELEMENT' ).
    get all declared attributes
    lo_el_segment1->get_static_attributes(
    IMPORTING
    static_attributes = ls_segment1 ).
    now ls_segment1 has selected drop down value.
    DATA : lv_dropdown type string .
    lv_dropdown = ls_segment1-segment.
    If lv_dropdown = 'X'.
    set single attribute
    lo_el_check_fields1->set_attribute(
    name = `EDITABLE`
    value = ABAP_FALSE ). // No Quotes, ABAP_TRUE or false not works use 1 0r 2 or ' ' 'X' .
    elseif lv_dropdown = 'Q'.
    set single attribute
    lo_el_check_fields1->set_attribute(
    name = `EDITABLE`
    value = ABAP_FALSE ).
    else.
    set single attribute
    lo_el_check_fields1->set_attribute(
    name = `EDITABLE`
    value = ABAP_TRUE ).
    Hope it solves..
    cheers,
    Kris.

  • Need to stop creation of second popup until first popup is completed

    Hi All,
    I have a popup window in a WD component that display a PDF report. It works perfectly. However, I just received a new requirement to create another popup window immediately prior to the PDF report popup window which will allow the users to answer a Yes/No question which will change the content of the PDF. I thought that this would be a simple request and created another window for this new popup and preceded the call to create the PDF popup window with a call to create and open the new popup window. The problem now is that when I run the WD Application, both popups are created and opened at the same time with the first popup behind the second popup.  I do not want the second popup to be created and opened until the user selects Yes/No on the first popup window.
    Does anyone have an idea how to accomplish this?
    Thanks,
    Gregg

    Following is the code that I am currently using that is causing the issue:
    *-- Data definition
      DATA: lv_title           TYPE string.
    *-- Window Definition
      DATA:
            lr_window_manager TYPE REF TO if_wd_window_manager,
            lr_api_component  TYPE REF TO if_wd_component,
            lr_popup_window   TYPE REF TO if_wd_window,
            lr_pdf_window     TYPE REF TO if_wd_window.
    *--  Update the context before any action processing
      wd_this->update_context(  ).
      lv_title = wd_assist->if_wd_component_assistance~get_text( 'TPP' ).
      lr_api_component  = wd_this->wd_get_api( ).
      lr_window_manager = lr_api_component->get_window_manager( ).
      lr_popup_window  = lr_window_manager->create_window(
                         window_name            = 'ZZ_W_POPUP'
                         title                  = lv_title
                         message_display_mode   = if_wd_window=>co_msg_display_mode_selected
                         button_kind            = if_wd_window=>co_buttons_yesno
                         message_type           = if_wd_window=>co_msg_type_question
                         default_button         = if_wd_window=>co_button_yes ).
      lr_popup_window->open( ).
      lv_title = wd_assist->if_wd_component_assistance~get_text( 'TPP' ).
      lr_pdf_window    = lr_window_manager->create_window(
                         window_name            = 'ZZ_W_PRINT_PDF'
                         title                  = lv_title
                         message_display_mode   = if_wd_window=>co_msg_display_mode_selected
                         button_kind            = if_wd_window=>co_buttons_ok
                         message_type           = if_wd_window=>co_msg_type_none
                         default_button         = if_wd_window=>co_button_ok ).
      lr_pdf_window->set_window_size( width  = '98%'
                                      height = '100%' ).
      lr_pdf_window->open( ).

  • How to present pics from SAP folder?

    Hi,
    I would like to present a pic that is on the SAP folder (visible via AL11).
    I want to use logical filename to get the path to that gif.
    How can I present this pic on the screen?
    Thanks,
    Itay

    hi itay,
    you can use webdynpro IMAGE ui element. Bind the Source Property of the image UI element to the URL for this image. Check the below code on how to get IMAGE source URL in HR
    DATA: it_toav0 TYPE TABLE OF toav0,
            wa_toav0 TYPE toav0,
            p_exists TYPE c.
      DATA: ex_length   TYPE int4,
            ex_document TYPE TABLE OF tbl1024,
            ex_message  TYPE bapiret2,
            img         TYPE xstring,
            url         TYPE string,
            pernr       TYPE persno VALUE `1006786`.
      DATA: cached_response TYPE REF TO if_http_response,
            guid TYPE guid_32.
    * check employee image
      CALL FUNCTION 'HR_IMAGE_EXISTS'
        EXPORTING
          p_pernr        = pernr
          p_tclas        = 'A'
        IMPORTING
          p_exists       = p_exists
          p_connect_info = wa_toav0.
      IF p_exists = 1.
    *   get image data
        CALL FUNCTION 'ALINK_RFC_TABLE_GET'
          EXPORTING
            im_docid    = wa_toav0-arc_doc_id
            im_crepid   = wa_toav0-archiv_id
          IMPORTING
            ex_length   = ex_length
            ex_message  = ex_message
          TABLES
            ex_document = ex_document.
    *   convert to xstring
        CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
          EXPORTING
            input_length = ex_length
          IMPORTING
            buffer       = img
          TABLES
            binary_tab   = ex_document.
        CREATE OBJECT cached_response
          TYPE
            cl_http_response
          EXPORTING
            add_c_msg        = 1.
    *   set image to mime
        cached_response->set_data( img ).
        cached_response->set_header_field(
                         name  = if_http_header_fields=>content_type
                         value = 'image/pjpeg'  ).
        cached_response->set_status( code = 200 reason = 'OK' ).
        cached_response->server_cache_expire_rel( expires_rel = 180 ).
        CALL FUNCTION 'GUID_CREATE'
          IMPORTING
            ev_guid_32 = guid.
        cl_wd_utilities=>construct_wd_url(
                         EXPORTING application_name = 'Z_JR05'
                         IMPORTING out_local_url    = url     ).
        CONCATENATE url '/' guid sy-uzeit INTO url.
        cl_http_server=>server_cache_upload(
                        url      = url
                        response = cached_response ).
    *   set photo
        DATA:
         node_photo           TYPE REF TO if_wd_context_node,
         elem_photo           TYPE REF To if_wd_context_element,
         stru_photo           TYPE wd_this->element_photo.
        node_photo = wd_context->get_child_node(
                    name = wd_this->wdctx_photo ).
        elem_photo = node_photo->get_element(  ).
        elem_photo->set_attribute(
          EXPORTING
            name =  `PHOTO`
            value = url ).
      ENDIF.
    Also check this excerpt from Thomas Jung for previous Thread on same issue
    SE78 is the old graphics store for SAPScript. Not the best place to store images now because of the limited support for graphic types. Usually you store as Bitmaps there, making those images highly inefficient for usage on the web. Unless you have thousands of images you need to use, I would suggest downloading them, converting their format and storing them in the MIME repository. If you absolutely must access those images for some reason, look at the function modules in group STXBITMAPS - function module SAPSCRIPT_GET_GRAPHIC_BDS or SAPSCRIPT_BITMAP_GET depending upon which of the two formats/folders where used in SE78.
    greetings
    Prashant

  • Problem with embeding the same view in dynamically created view container

    Hello Experts,
                  I am getiing a dump when i try to embed the same view inside the dynamically created view container of
    dynamically created tabs of a tabstrip
    The requirement go like this, i have 2 views in which i have have to embed the 2nd view to view1 where i have an empty
    tabstrip without tabs. During runtime i create tabs as well as view containers accordingly and then try to embed view2 in tabs.
    I have put the below mentioned code in HANDLEIN,
      DATA: lref_vcntlr  TYPE REF TO if_wd_view_controller,
            lref_comp    TYPE REF TO if_wd_component_usage,
            lv_embed_pos TYPE string.
      lref_vcntlr = wd_this->wd_get_api( ).
      lv_embed_pos = 'FILE_PERS_EDIT/VC_GENERAL'.
      TRY.
          CALL METHOD lref_vcntlr->do_dynamic_navigation
            EXPORTING
              source_window_name        = 'FILE_PERSISTENCE_WND'          " Window
              source_vusage_name        = 'FILE_PERS_EDIT_USAGE_1'       " Source View usage
              source_plug_name          = 'TO_EDIT_LAYOUT'                       " Outbound plug
              target_view_name          = 'PERS_EDIT_LAYOUT'                  " Second view to be embedded
              target_plug_name          = 'IN'                                                  " Second view inboun plug
              target_embedding_position = lv_embed_pos
            RECEIVING
              component_usage           = lref_comp.
        CATCH cx_wd_runtime_repository .
      ENDTRY.
      wd_this->fire_to_edit_layout_plg( ).
    This works fine for the first time.
    However onaction tab select i change the embeding position( 'FILE_PERS_EDIT/view container name of different tab') of the view2 an try to embed view2 in a different tab.
    At this point i get a dump stating View2 already present in the window 'FILE_PERSISTENCE_WND' of component.
    I think, the view2 embediing has to be removed before i add the view2 in a different tab
    Kindly let me know how to remove view2 embedding from tab1 before i add a view2 to a different tab or is there any other
    means to handle this problem?
    Thanks & Best Regards,
    Srini.

    Hello Srini,
    I found a solution to your problem, because I had a similar task.
    In WDDOINIT I changed the method do_dynamic_navigation to if_wd_navigation_services_new~prepare_dynamic_navigation:
    DATA:
        l_view_controller_api TYPE REF TO if_wd_view_controller.
      l_view_controller_api = wd_this->wd_get_api( ).
      TRY.
          CALL METHOD l_view_controller_api->if_wd_navigation_services_new~prepare_dynamic_navigation
            EXPORTING
              source_window_name        = 'WDW_MAIN'
              source_vusage_name        = 'VW_SUB_USAGE_1'
              source_plug_name          = 'TO_VW_CONTENT'
              target_component_name     = 'ZTEST_DYNAMIC'
              target_view_name          = 'VW_CONTENT'
              target_plug_name          = 'DEFAULT'
              target_embedding_position = 'VW_MAIN/VC_TAB.VW_SUB/TAB1_VC'
            RECEIVING
              repository_handle         = wd_this->g_rep_handle.
        CATCH cx_wd_runtime_repository .
      ENDTRY.
      wd_this->fire_to_vw_content_plg( param1 = 'TAB1' ).
    In the action I first deleted the navigation targets, then navigated to the empty-view and last I called my target view:
      DATA:
        lv_position           TYPE string,
        l_view_controller_api TYPE REF TO if_wd_view_controller,
        lr_view_usage         TYPE REF TO if_wd_rr_view_usage,
        lr_view_***_t         TYPE wdrr_vca_objects,
        lr_view_***           LIKE LINE OF lr_view_***_t.
      l_view_controller_api = wd_this->wd_get_api( ).
      lr_view_usage = wd_this->g_view->get_view_usage( ).
      lr_view_usage->delete_all_navigation_targets( plug_name = 'TO_VW_CONTENT' ).
      CLEAR lv_position.
      CONCATENATE 'VW_MAIN/VC_TAB.VW_SUB/' old_tab '_VC' INTO lv_position.
      TRY.
          l_view_controller_api->if_wd_navigation_services_new~do_dynamic_navigation(
          source_window_name = 'WDW_MAIN'
          source_vusage_name = 'VW_SUB_USAGE_1'
          source_plug_name   = 'TO_EMPTYVIEW'
          target_component_name = 'ZTEST_DYNAMIC'
          target_view_name   = 'EMPTYVIEW'
          target_plug_name   = 'DEFAULT'
          target_embedding_position = lv_position ).
        CATCH cx_wd_runtime_repository.
      ENDTRY.
      CLEAR lv_position.
      CONCATENATE 'VW_MAIN/VC_TAB.VW_SUB/' tab '_VC' INTO lv_position.
      TRY.
          wd_this->g_rep_handle = l_view_controller_api->if_wd_navigation_services_new~prepare_dynamic_navigation(
            source_window_name = 'WDW_MAIN'
            source_vusage_name = 'VW_SUB_USAGE_1'
            source_plug_name   = 'TO_VW_CONTENT'
            target_component_name = 'ZTEST_DYNAMIC'
            target_view_name   = 'VW_CONTENT'
            target_plug_name   = 'DEFAULT'
            target_embedding_position = lv_position ).
        CATCH cx_wd_runtime_repository.
      ENDTRY.
      wd_this->fire_to_vw_content_plg( param1 = tab ).
    Ann.: I my example, I had 3 views: VW_MAIN which embedds VW_SUB. VW_SUB has the tabs in it and VW_SUB embedds VW_CONTENT.
    BR,
    Roland

Maybe you are looking for

  • Appraisal approval after completion not possible in BSP

    Hi I have configured an appraisal template for a requirement in which the employee needs to approve the final appraisal given by Manager and then it goes into approved status. If he rejects it goes back to In Process status so that the Manager can ch

  • Videos and clips on webpages start and stop

    Why do videos and clips from various web pages stop and start and stutter? I am connected vis wifi but it is a brand new Belkin router N600?

  • HPM= Stock Transport Order = How to cancel an Gain or Loss posting

    Hi, In OGSD 4.72  functionality HPM==>"Two-Step Transfers Including Profit and Loss Determination" We manage Goods movments with a stock transport order so when The u2018Delivery Completedu2019 Indicator is Set we have a gain or loss posted . Questio

  • HT5295 Sync between devices

    Using the new Podcasts app, how do I get my subscriptions to sync between iOS devices?  Can it be done without using iTunes (ie iCloud)?

  • Question slide- Launch a full screen image in new window.

    Hi, I am using Captivate 4. In the question slide (MCQ/ Matching) I want to have a transparent button over a thumbnail image. On clicking this button, it lanches a full screen image in a new window. The student views the image and answers MCQ,  Match