Application Development and Automation 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: 
Read only

field check

Former Member
0 Likes
693

Hi,

How to check the validity of fields in select options.

I have 4 fields

fields : werks, matnr, verid, sptab

table: s225.

Thank you.

5 REPLIES 5
Read only

Former Member
0 Likes
640

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

Read only

Former Member
0 Likes
640

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

Read only

Former Member
0 Likes
640

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.

Read only

Former Member
0 Likes
640

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

Read only

Former Member
0 Likes
640

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.