Wednesday 24 August 2011

Sap abap webdynpro how to hide freely programmable f4 help for an input help

Freely Programmable F4 Helps are created to have custom F4 functionality for a webdynpro input field.
A freely programmable input field can be attached to the context attribute in the definition area.

The following code snippet explains how to hide  and unhide the f4 help if required. This function is mostly required if you have edit and display mode for your screen and you want to hide the f4 function in display mode.

  DATA lref_node_info     TYPE REF TO if_wd_context_node_info.
  DATA lo_nd_input TYPE REF TO if_wd_context_node.
  DATA ls_input TYPE wd_this->element_input.
* navigate from <CONTEXT> to <INPUT> via lead selection
  lo_nd_input = wd_context->get_child_node( name = wd_this->wdctx_input ).

  if lo_nd_input is INITIAL.
    return.
  endif.

  CALL METHOD lo_nd_input->get_node_info
    RECEIVING
      node_info = lref_node_info.

  IF iv_active IS INITIAL. "To Deactivate the F4 Help
    CALL METHOD lref_node_info->set_attribute_value_help
      EXPORTING
        name            = 'INPUTFIELD1'    "Input field name
        value_help_mode = if_wd_context_node_info=>c_value_help_mode-deactivated
        value_help      = 'F4_HELP_NAME'. "Freely programmable F4 help name
  ELSE.
    CALL METHOD lref_node_info->set_attribute_value_help
      EXPORTING
        name            = 'INPUTFIELD1'   "Input field name
        value_help_mode = if_wd_context_node_info=>c_value_help_mode-application_defined
        value_help      = 'F4_HELP_NAME'. "Freely programmable F4 help name
  ENDIF.




No comments :

Post a Comment