cancel
Showing results for 
Search instead for 
Did you mean: 

Mandatory field checking

Former Member
0 Kudos

Hi all,

I have two input field on a view.I want to put validations on mandatory fields.It should display messages or popup on wrong input.so kindly provide with step-by-step procedure for the same .

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Darshna,

Hope i would be able to ans this ques as well.

some code snippet:

DATA:

l_current_controller TYPE REF TO if_wd_controller,

l_message_manager TYPE REF TO if_wd_message_manager.

Read your attribute to which your UI element is binded.

here i have attached an assistance class with the component, or else you can give a user defined message.

IF stru_flightinfo-connid IS INITIAL.

lv_text = wd_assist->if_wd_component_assistance~get_text( key = '002' ).

  • report message

CALL METHOD l_message_manager->report_attribute_error_message

EXPORTING

message_text = lv_text

element = elem_flightinfo

attribute_name = 'CONNID'.

ENDIF.

in this case whenver your UI element is intial, the message would be displayed.

Hope this solves your Problem.

Cheers!

ashish

Former Member
0 Kudos

Hi,

you should implement note

Note 948753 - WD ABAP:Check for mandatory fields

grtz

Koen