‎2006 Dec 07 12:03 PM
Hi,
How to check the validity of fields in select options.
I have 4 fields
fields : werks, matnr, verid, sptab
table: s225.
Thank you.
‎2006 Dec 07 12:07 PM
Hi
You can use the following code.
select single *
into wa_s225
from s225
where werks in s_werks and
marnr in s_matnr and
verid in s_verid and
sptab in s_sptab.
if sy-sybrc ne 0.
Message 'Error in S225 table' type 'E'.
endif.
Regards
Bhupal Reddy
‎2006 Dec 07 12:09 PM
hi
at selection-screen.
Perform validate_user_selection.
Form validate_user_selection.
if not p_werks is initial.
select singel werks
from t001w
into lv_werks.
where werks eq p_werks. ( Parameters)
where werks in s_werks. (Select-option)
endif.
if not p_matnr is intial.
endif.
......
.....
endform.
Regards,
Satya
‎2006 Dec 07 12:11 PM
If you give the check tables for all of them , automatically it will get validated
or else you have to code
AT SELECTION-SCREEN OUTPUT.
Select single werks from T001W where werks not in s_werks.
if sy-subrc eq 0.
*display error messgae here
endif.
Select single matnr from MARA where matnr not in s_matnr.
if sy-subrc eq 0.
*display error messgae here
endif.
Select single verid from MKAL where verid not in s_verid.
if sy-subrc eq 0.
*display error messgae here
endif.
‎2006 Dec 07 12:12 PM
Hi ,
You can use the event AT SELECTION SCREEN .
Here write a select statement to chcek if the entered value is correct or not.
The master tables are
WERKS : <b>T001W</b>
MATNR : <b>MARA</b>
VERID : <b>MKAL</b>
There is no field SPTAB , there is a field called SPTAG , that is date .
Now how we get the master table in this case if you look at table S225 there will be a column <b>'Check Table'</b> or a tab <b>Entry help / check</b>, this will contain the master table for each field if any.
Regards
Arun
‎2006 Dec 07 12:47 PM
Hi S Vj ,
You always have the option of creating the search help object in the ABAP Dictionary and assign that to either entire database table , or a particular data element or a particular screen element .
OR
If the select-options are in a report program ,
you have the option to use the event key word : "AT SELECTION-SCREEN ON VALUE REQUEST FOR <select-option> "
then you can use the function module "F4IF_FIELD_VALUE_REQUEST" or
"F4IF_INT_TABLE_VALUE_REQUEST" to generate the value request for the fields .
The user will be allowed to enter only the entries present in the database table .
Regards ,
Kamlesh Dhera H. R.