cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP: Valdation of required fields

Former Member
0 Kudos

Hello,

This has been mentioned here and there but the question remains.

I have to perform validation of required fields that I have on a page. I do not know how many fields (input fields, drop down by key, etc.) I might have on a page since the content is very dynamic. When a user tries to submit the form I need to validate all of these fields and make sure they contain values.

Is there an efficient way in WD ABAP to validate fields?

Or I have to manually parse the page get element, get value of an element, check it and if is NULL (INITIAL) raise a message?

Thank you.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member215843
Active Participant
0 Kudos

Hi Georgy,

the check fpr mandatory fields is not implemented in the framework, but you can use the service function cl_wd_dynamic_tool=>check_mandatory_attributes.

You have to pass a list of nodes, elements and attributes, and we check, whether values are entered.

More information is available in note 948753.

Regards, Regina

Former Member
0 Kudos

Hello Regina,

Unfortunately, CL_WD_DYNAMIC_TOOL does not have method by name CHECK_MANDATORY_ATTRIBUTES.

Also, WD applicatoin that is mentioned in the note does not exist.

Could you please comment?

Thank you.

Former Member
0 Kudos

Hi,

this is valid from NW2004s SPS9 onward, perhaps you have a lower SPS.

Regards, Heidi

former_member85655
Active Participant
0 Kudos

.

Message was edited by: Arun Bhat J

thomas_szcs
Active Contributor
0 Kudos

Hi Georgy,

Since you bind the primary attribute of those ui elements to a context attribute, just check the context attributes for being initial. There is no need to iterate through the screen.

Best regards,

Thomas