Message Handling in Web Dynpro (Assistance Class)

...Previous

Binding the context attribute value ‘NAME’ to input field  

image035  

Creating Push button and creating event ‘Validate’ 

image037  

Step 4 :  Go to ‘Method’ tab and double click on method ‘ONACTIONVALIDATE’

image039  

4.a Select Code Wizard(Ctrl + F7)  

image041  

Read the value of the context attribute ‘NAME’  

image043  

The variable ‘lv_name’ holds the input value  

image045  

Declare a variable named ‘msg’ which will hold message texts  

image047  

Using code wizard (Ctrl + F7),  Select radio button ‘Generate Message’ and choose a method ‘REPORT_ERROR_MESSAGE’ from the F4 help and press Enter  

image049  

Delete the below selected lines  

image051  

When user does not enter input value, Using instance object wd_assist, assign the error message text to variable ‘msg’ and call the method 'report_message_error', Otherwise assign success message text to variable ‘msg’ and call the method 'report_success'.  

image053  

Activate the whole web dynpro component.  

Step 5 : Create web dynpro application, enter description and save it  

image055  

image057  

Right click on created application and choose ‘test’  

  image059  

OUTPUT :  

When input field is empty  

image061  

When input value is provided  

image063

 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image