cancel
Showing results for 
Search instead for 
Did you mean: 

Webdynpro Error Messages

0 Kudos

Hi, Webdynpro Guru's.

I have one scenario where i am not able to solve the problem so i need help on this,

Thanks In advance.

I have developed a webdynpro Application which will throw error messages when user clicks on submit button. The error messages will be thrown when user skips mandatory fields , user provides any wrong input etc etc.

When user clicks on submit button without giving any input then consider that there are 10 error messages are thrown, If user provides only one correct input and press enter all other messages will get cleared and once again on click of submit button the error messages will be thrown , So i want to keep the error messages on the screen till user provides all correct inputs ( after pressing submit button also want to keep the error messages ) . How to achieve this please help me guru's.

Regards,

Vikram Bhat.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi,

Try using message area UI element.

Steps to create Message area UI element - Web Dynpro ABAP - SCN Wiki

Hope it solves your problem.

Regards,

Taiyeb

former_member183072
Active Participant
0 Kudos

HI,

     Hmm, my first idea is that for the mandatory fields you can use the standard method: cl_wd_dynamic_tool=>check_mandatory_attr_on_view.

       If you want to check for wrong inputs, again you can look inside this method to see exactly how SAP is doing it(error raise, report message)

Have fun,

Ovidiu

0 Kudos

Hi,

Thanks for the reply , I have used same thing for mandatory message , but my problem is when there is 10 mandatory error message and if i provide only one input and press enter, then all other 9 error messages will be cleared and it will appear again once i press submit button. ( i want the other 9 error message should be there on screen till they provide all 10 input values.

Thanks & Regards,

Vikram Bhat.

former_member183072
Active Participant
0 Kudos

Hi,

        hmm... OK .. My first impresion is that you have called your method(check_attr..) for the submit button. I`m right?

        My first idea: try to call this method...on another event? maybe in modify_view(), but you need to use a flag(if the submit buttton was pressed) in this case..

    

Ovidiu

Former Member
0 Kudos

Hi,

I think you cannot achieve this as user has to interact with the application and then respective action will trigger for validation.

Thanks

KH

s1252
Participant
0 Kudos

HI,

the way that you following is throwing errors means , there is no issue with the methods that you are using to throw errors.

The issue is where you are calling that method. as you are saying all 10 fields are input fields. that means "onenter" it will interact with the system starting from "WDDOBEFOREACTION" , call your validation method there in that method , it will take care of validations.

METHOD wddobeforeaction .

   DATA lo_api_controller TYPE REF TO if_wd_view_controller.

   DATA lo_action         TYPE REF TO if_wd_action.

   lo_api_controller = wd_this->wd_get_api( ).

   lo_action = lo_api_controller->get_current_action( ).

   IF lo_action IS BOUND.

     "" Your Code Here

   ENDIF.

ENDMETHOD.

Regards,

Krishna S

0 Kudos

Hi Krishna ,

Thanks for your reply , it is a valid point which you have maintained but our application is a vast application where we are maintaining some views visibility and based on views which are visible only for that particular views input field will be validated and for that particular thing to happen we have to call the validate method in Submit button , so unfortunately i cannot change the architecture of my code so is there any other way to achieve the same?

Thanks & Regards,

Vikram Bhat.

s1252
Participant
0 Kudos

Hi Vikram,

As per your previous message , if i am not wrong you are having different views embedded in one view in which  "Submit" Action was there .

And i hope you used "cl_wd_dynamic_tool=>check_mandatory_attr_on_view" to validate your fields , it will validate the fields in that view only,  you can use "cl_wd_dynamic_tool=>check_mandatory_attributes"  to validate your fields by giving Node references and Attribute Names. and you can  use this method on particular actions  or all actions  or for only submit as you wish,  the prerequisite is that your input fields also have some action attached for ONEnter action. then irrespective of your View , all fields will be validated in Proper way.


and call cl_wd_dynamic_tool=>check_mandatory_attributes multiple times for multiple nodes.



Regards,

Krishna S.