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
776

Hi all,

can anyone please tell me what a Check table is ?

thanks

Sabrina.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
595

Hi Sabrina

The Check Table is the table used by system to check if a data exist or not exist.

While creating a table if you want to be sure that a field can have some values and these are in a certain table, you can give IT this table as CHECK TABLE.

For example: I've created my Z-TABLE where is a field KUNNR (customer). Now I want only custemers which are in master data table KNA1 can be inserted in my Z-table.

So I assign KNA1 as check table to field KUNNR in my Z-TABLE.

However this control is active only in the screens:

nothing'll be able to prevent to insert a wrong value in my Z-TABLE in a program.

If I write:

TABLES Z-TABLE.

Z-TABLE-KUNNR = 'AAAAAAAAAAA'.

MODIFY Z-TABLE.

The system'll update Z-TABLE even if the value 'AAAAAAAAAAA' isn't in KNA1. In this case the control can't work.

But if you use the field in a screen, if user insert 'AAAAAAAAAAA' and push enter, the system'll automatically give a error message. So you can avoid to check the existence in your program, it' useless to write

SELECT SINGLE * FROM KNA1 WHERE KUNNR = <FIELD_DYNPRO>.

IF SY-SUBRC <> 0.

........

The system'll do the control for you.

Max

Message was edited by: max bianchi

3 REPLIES 3
Read only

Former Member
0 Likes
595

Hi,

Check table is kind of a validation for entry on screens

and maintaining referential integrity of RDBMS.

These are for defining foreing keys on table fields.

For exmple EKKO-LIFNR has a check table LFA1. This means that if you enter a vendor number which does not exist in LFA1 the system will throw an error.

Cheers.

Read only

Former Member
0 Likes
596

Hi Sabrina

The Check Table is the table used by system to check if a data exist or not exist.

While creating a table if you want to be sure that a field can have some values and these are in a certain table, you can give IT this table as CHECK TABLE.

For example: I've created my Z-TABLE where is a field KUNNR (customer). Now I want only custemers which are in master data table KNA1 can be inserted in my Z-table.

So I assign KNA1 as check table to field KUNNR in my Z-TABLE.

However this control is active only in the screens:

nothing'll be able to prevent to insert a wrong value in my Z-TABLE in a program.

If I write:

TABLES Z-TABLE.

Z-TABLE-KUNNR = 'AAAAAAAAAAA'.

MODIFY Z-TABLE.

The system'll update Z-TABLE even if the value 'AAAAAAAAAAA' isn't in KNA1. In this case the control can't work.

But if you use the field in a screen, if user insert 'AAAAAAAAAAA' and push enter, the system'll automatically give a error message. So you can avoid to check the existence in your program, it' useless to write

SELECT SINGLE * FROM KNA1 WHERE KUNNR = <FIELD_DYNPRO>.

IF SY-SUBRC <> 0.

........

The system'll do the control for you.

Max

Message was edited by: max bianchi

Read only

0 Likes
595

thanks Sanjay and Max, your answers were very helpful.

Sabrina.