03-13-2007 5:23 AM
How to perform the validations and what r the types of validations ...give me with example?
03-13-2007 5:38 AM
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
03-13-2007 5:27 AM
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
03-13-2007 5:31 AM
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:
keerthi
03-13-2007 5:32 AM
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.
03-13-2007 5:33 AM
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.
03-13-2007 5:38 AM
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