Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

validations

Former Member
0 Kudos

How to perform the validations and what r the types of validations ...give me with example?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Validations are done to avoid or intimate the user from entering wrong values.

for ex.

if on your selection-screen ,you have 2 parameters like-

parameters:

num1 type i,

num2 type i.

data result type i.

if num2 <>0.

result = num1 / num2.

else.

message 'Enter number greater than 0' type 'E'.

endif.

validations can also be done with the help of events like -

AT SELECTION-SCREEN ON FIELD, //if we want to validate a particular field

AT SELECTION-SCREEN ON BLOCK, //if we want to validate all fields in a block

AT SELECTION-SCREEN. // for validating some fields on selection-screen.

reward points if it helps.

Regards,

Neha Bansal

5 REPLIES 5

Former Member
0 Kudos

for example you have a requirement to divide two numbers and display the result,

if the end user wants to divide the first number by 0, i.e., num2 = 0, in this case,

if you execute the program it goes for a dump.... so restrict the user by giving an error message... or according to the requirement...

hope this would help you..

Regards,

Pavan P

Former Member
0 Kudos

hi,

Validation

It allows solid data entry regarding special rules. According to previous rules, the system can evaluate an entry and a message can appear on the user's terminal if a check statement is not met. A validation step contains prerequisite statement and check statement. Both of them are defined using Boolean Logic or calling an ABAP/4 form.

chk this:

http://www.is-edu.hcmuns.edu.vn/WebLib/Books/Database/0-672-31217-4/ch21/ch21.htm#DataValidationUsin...

keerthi

Former Member
0 Kudos

one more example is, if the user has to definitely input a value, without which no output will be displayed... but end user directly executes the output without inputing any value... so to avoid this case... make the parameter obligatory...

It depends on the situation and requirement, when and what to validate..

Regards,

Pavan P.

Former Member
0 Kudos

In Reports u can perform validations in the events

AT SELECTION-SCREEN and

AT SELECTION-SCREEN OUTPUT.

Say if u want to check some of the values entered on selection screen against check tables

parameters : p_bukrs like T001-bukrs.

AT SELECTION-SCREEN

select single BUKRS from T001 into T001-bukrs where bukrs eq p_bukrs.

if sy-subrc ne 0

message e000(ZZ) with 'please enter valid company code'.

endif.

Former Member
0 Kudos

Validations are done to avoid or intimate the user from entering wrong values.

for ex.

if on your selection-screen ,you have 2 parameters like-

parameters:

num1 type i,

num2 type i.

data result type i.

if num2 <>0.

result = num1 / num2.

else.

message 'Enter number greater than 0' type 'E'.

endif.

validations can also be done with the help of events like -

AT SELECTION-SCREEN ON FIELD, //if we want to validate a particular field

AT SELECTION-SCREEN ON BLOCK, //if we want to validate all fields in a block

AT SELECTION-SCREEN. // for validating some fields on selection-screen.

reward points if it helps.

Regards,

Neha Bansal