cancel
Showing results for 
Search instead for 
Did you mean: 

Error handling on a field when search help does not return valid value.

gopalkrishna_baliga
Participant
0 Kudos

Hi Experts,

   I have a webdynpro ALV report. In the ALV table I have a field called CARRIER and it is modifiable.

   CARRIER field is linked TDLNR field in dictionary. TDLNR has domain LIFNR. LIFNR in turn has value table LFA1.

   My requirement is when the user enters a invalid value in CARRIER field then it should return a error message because it is not available in the value table LFA1. But it is not doing that.  How can I achieve this?

Thanks

Gopal

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Gopal,

use method DATA_CHECK in interface IF_SALV_WD_TABLE_SETTINGS or use another method from same interface CELL_ACTION_EVENT.

This are associated with class CL_SALV_WD_CONFIG_TABLE.

Hope this will solve your req.

Regards

Ravindra         

Sharathmg
Active Contributor
0 Kudos

in the OnChnage/OnEnter event of the input field, call the method which will verify the text typed by the user.

if its valid, allow navigation i.e. user to proceed.

Else, display an error and highlight the row.

Regards,

Sharath

0 Kudos

Hi gopal,

just read the entered input using code wizard.after that write select query

select single field lifnr  from LFA1 into WA where lifnr = readed value.

if WA is not initial.

then paste the following code.

   DATA lo_api_controller     TYPE REF TO if_wd_controller.

   DATA lo_message_manager    TYPE REF TO if_wd_message_manager.

   lo_api_controller ?= wd_this->wd_get_api( ).

   CALL METHOD lo_api_controller->get_message_manager

     RECEIVING

       message_manager = lo_message_manager

       .

*   report message

   CALL METHOD lo_message_manager->raise_error_message

     EXPORTING

       message_text  = 'ENTERED VALUE IS NOT AVALIABLE ON THE TABLE LFA1'.

*      params        =

*      msg_user_data =

       .

endif.

Thnaks & regards

jayaprakash T