Skip to end of metadata
Go to start of metadata

In this tutorial i demonstrated the necessity of "freely programmed input help" and how to develop the same.

Generally most of the fields in the SAP system will have input help available,but in certain cases the available input help will not suite our requirement or the selection criteria in that will be a complicated one,so to match our requirements the availabe option in webdynpro ABAP is the "freely programmed input help"

In this tutorial i will explain how to use this "freely programmed input help" for the costcenter field,I referred shruti's blog for the purpose of explanation..

kindly refer to my code tutorial https://wiki.sdn.sap.com/wiki/display/WDABAP/Organization+Hierarchy+in+TREE+structure+as+F4+help developing the component which displays the costcenter in a tree structure

On clicking the Freely programmed input help for the costcenter we will get the following selection screen
By selecting any one of the costcenter will trigger an event which leads to displaying the selected value in the input field
Steps to be followed:

1.Declare the component ZWDT_TREE (https://wiki.sdn.sap.com/wiki/display/WDABAP/Organization+Hierarchy+in+TREE+structure+as+F4+help)in the used component list in your webdynpro component
2.In the Properties tab of your view in which the "freely programmed input help" has to be implemented, declare the usage of the ZWDT_TREE interface controller in the "used Web Dynpro Controller" list.
3.In the View controller's context, in the attribute to which "freely programmed input help" has to be provided, select "Freely programmed" as Input Help Mode and select the "freely programmed input help" Component decalred in the "freely programmed input help" Component usage through the help given to the right.
4.Declare the event handler method in the Method tab of the view that subscribe to "freely programmed input help" event.
5. Implement the following code in the event handler method declared above.

  method DATA_SELECT .
  data: l_node          type ref to if_wd_context_node,
        l_data_selected type if_v_main=>element_vh_data_selected.

  l_node = wd_context->get_child_node( 'VH_DATA_SELECTED' ).
  l_node->get_static_attributes(
     importing
       static_attributes = l_data_selected ).

  l_node = wd_context->get_child_node( 'COSTCENTER_NODE' ).
  l_node->set_attribute( name  = 'OBJID'
                         value = l_data_selected-OBJID ).

endmethod.

Thanks..

Tamilselvan

2 Comments

  1. HI,

    I have gone through the whole procedure but i cound not understand one thing from where shall i get the  'vh_data_selected' Node to the V_Main View context in Z_SAMPLE_1 Component.

    can you please put more light on it.

    i have done every thing but not getting the values on F4 Help.

    Thanks,

    Mahesh.Gattu

  2. Anonymous

    Hi

        'Vh_data_selected' is the interface node which should be created in the component which you are using as f4 help,while using this component the node will also be visible so you can map with the current component.

    If you dont get values on f4 help then this is not the issue,it might be the problem with your component which you created for 'f4 help'

    Regards

    Tamil