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

check table

Former Member
0 Likes
376

Hi,

i have a doubt. how can we write the code to check the fields from check table to foreign key table.

Thanks & Regards,

sunil.

2 REPLIES 2
Read only

former_member156446
Active Contributor
0 Likes
346

Hi Sunil

Check tables are just to validate data given in the selection screen, it act on the domain level.

its nothing to do with field table primary key.. the check table tells u wheter the value your entered is allowed or not .. thats it..

think u have a domain SUNIL and while creating the domain u said allow only 2 to 7 values in this Domain SUnil... and next day I come and try to enter out of the range 2 to 7 it raises an error..

select single werks from t001w

into lv_werks

where werks eq pa_werks.

if sy-subrc NE 0.

message E001(m001).

endif.

award points if useful

Read only

Former Member
0 Likes
346

Hi Sunil,

This is done by the general property of foreign key relationship.

if u want to check it from your program, then put the data from these two DB tables to your own int tab.

then loop at the int tab which contains data of the foreign key table & READ the data of int tab which contains data of check tab with respect to the foreign key field. if SY-SUBRC is 0 then check is successful, otherwise not.

Reward if useful

Regards

ANUPAM