cancel
Showing results for 
Search instead for 
Did you mean: 

validating an input field......

Former Member
0 Kudos

Hi Friends,

I have two coloumns in my table. first is product number second is its description.

whenever user enter product in that field.. and

1 ..does any other action

2. cursor moves to other field or button...

i want to get the description of that product and populate it in description field.

I can see onEnter action for input field, but user has to specifically hit Enter.. i even want to make this description appear, once the cursor is out of Product .....

can someone help.

Niraja

Accepted Solutions (0)

Answers (3)

Answers (3)

uday_gubbala2
Active Contributor
0 Kudos

Hi Niraja,

There isn't any event associated with loss of tab focus in Web Dynpro ABAP. So you wont be able to realize this functionality.

Regards,

Uday

Former Member
0 Kudos

used Enter button as a training for user. i think

vishalc_kava
Explorer
0 Kudos

Hi

Assuming you have 2 columnts 1st with key value and 2nd with it corresponding description.

In the action of the 1st column where you put the key value check for the validity of the content enetered, if it is invalid value entered throw the error. for this either create method in componenet controller or in assistance class which checks the validity of the value as wel as returns description of the key value if its valid.

e.g.


wd_assist->get_pafkt_desc(
        EXPORTING
          ppafkt = ls_clnt_tknvk-pafkt
        IMPORTING
          stpfkt = ls_tpfkt
          perror = lv_error
          ).
METHOD get_pafkt_desc.
  CALL FUNCTION 'ISM_SELECT_SINGLE_TPFKT'
    EXPORTING
      aktsprsl       = sy-langu
      pafkt          = ppafkt
    IMPORTING
      tpfkt_i        = stpfkt
    EXCEPTIONS
      no_entry_found = 1
      OTHERS         = 2.
  IF sy-subrc <> 0.
    perror = abap_true.
  ENDIF.
ENDMETHOD.

In the wdmodify method check first get the change list of the context.

i.e.


  DATA lt_change_list TYPE wdr_context_change_list.
  DATA ls_change_list LIKE LINE OF lt_change_list.
  DATA lo_componentcontroller TYPE REF TO ig_componentcontroller .

  lo_componentcontroller =   wd_this->get_componentcontroller_ctr( ).
  lo_componentcontroller->get_contxt_changes(
    IMPORTING
      changes = lt_change_list                        " wdr_context_change_list
  ).
than loop at change list
LOOP AT lt_change_list INTO ls_change_list .

    IF ls_change_list-node_name = 'CLNT_TKNVK'.
      IF ls_change_list-attribute_name = 'PAFKT'.
*   Get code description

*****write the code for setting the description.

*Read the node first than call this method
	wd_assist->get_pafkt_desc(
        EXPORTING
          ppafkt = ls_clnt_tknvk-pafkt
        IMPORTING
          stpfkt = ls_tpfkt
          perror = lv_error
          ).
	
*****write the code for setting the description if lv_error is false.
      ENDIF.
    ENDIF.

  ENDLOOP.

Regards

Vishal

vivekananthan_sellavel
Active Participant
0 Kudos

hi

Tat is not possible in webdynpro frame work.

input we have only onEnter event only.

So try to make use of that.

Regard,s

Vivekananthan.S