06-23-2008 9:16 AM
06-23-2008 9:18 AM
HI...
Do u mean to say..u want to validate data wen u r updating the database table...if so then just before updating the data from ur program to the database table...just use the validation u want to put...
Hope this is wat ur requirement is...
06-23-2008 9:20 AM
hi,
do this way on to your suitable table ...Assuming that you are looking for validating the selection screen data
at selection-screen.
if not p_matnr is initial.
select single * from mara where matnr = p_matnr.
endif.
06-23-2008 10:19 AM
06-23-2008 11:18 AM
hii
you can validate data different ways.like if its blank or if its invalid data in database table.for database table you can write a query like below & validate data.
* Validate Plant
SELECT werks
INTO w_werks
FROM t001w
UP TO 1 ROWS
WHERE werks IN s_werks.
ENDSELECT.
CHECK sy-subrc NE 0.
SET CURSOR FIELD 'S_WERKS'.
MESSAGE e220(zmsg). " Invalid Plant
reward if useful
thx
twinkal
06-23-2008 3:09 PM
Hi Siva... check this...
PARAMETER:
P_CARRID.
AT SELECTION-SCREEN ON p_carrid.
perform validate_carrid.
form validate_carrid.
select carrid
connid
from spfli
up to 1 rows
where carrid eq p_carrid.
if sy-subrc NE 0.
message 'Record not found' TYPE 'E'.
endif.
endform.
06-23-2008 3:10 PM
hi.. u can execute the above stated example..
Reward points if useful..
Regards,
Narin Nandivada
06-24-2008 5:31 AM
hi siva
at selection-screen on p_matnr.
if p_matnr is not initial.
select single matnr
into lw_matnr
from mara
where matnr eq p_matnr.
if sy-subrc <> 0.
message e272(61).
endif.
endselect.
06-24-2008 11:08 AM
Hi,
If u need to validate data while entering new entries in the database table then you can maintain an event and restrict and validate the entries by writing the code in the event.
Event is maintained in table maintainence generator.
In detail,
Go to table maintainence generator.create one table maintainence generator for the table.
Go to environment tab and go for modifications in which you can find the events in the dropdown.
Click on that and create one event with code as 05.
Write the code in that event.
For example to write the code for restricting the user to enter all the fields as mandatory.
IF ( ( ztable-field1 IS INITIAL ) OR
( ztable-field1 IS INITIAL ) OR
(ztable-field1 IS INITIAL ) ).
MESSAGE e000(yco_message) WITH text-000.
ENDIF.
save the table maintaince generator.
create a tcode and give the screen as sm30 and skip teh first screen to maintain the values through sm30.
Reward me the points if the info is useful.
06-27-2008 9:46 AM
Select data from database table into internal table while giving the condition with which you want to validate it.
then check sy-subrc whether it is 0 or not.
if is 0 then data is valid otherwise it is invalid.
E.g
select * from vbrp into corresponding fields of table it_vbrp
where vbrp-vbeln = it_vbrp-vbeln.
if sy-subrc EQ 0.
write: "Data Valid.".
endif.
hope this will work fine for you.
Thanks& Regards,
Rajesh Kumar.