Application Development 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: 

validation in table.

Former Member
0 Kudos

Hi,

in table i have one character field with length 4.

i want to validate char field while directely entering values in table level.

i want to enter only numc values in char field because i doesnot change char to numc datatype.

how can i validate at table level.

Regards,

Suresh.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

try on at selection-screen on char field.

take string length of char field( string u entered ) and perform do.

check for every literal in sy-abcde.

if sy-subrc eq 0.

give message like donot enter characters.

exit.

endif.

endloop.

12 REPLIES 12

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Suresh,

Is it a custom or a standard table?

BR,

Suhas

Former Member
0 Kudos

this is custom table

Regards,

Suresh

0 Kudos

>

> this is custom table

>

> Regards,

> Suresh

Hello,

What is the Data Element for that particular field? Can you change it to NUMC4 and check ?

BR,

Suhas

Sm1tje
Active Contributor
0 Kudos

So how are you maintaining this table? Via SM30, well then, as already mentioned, use the predefined events for this.

Former Member
0 Kudos

Iam maintain through sm30

Regards,

Suresh

Former Member
0 Kudos

no, i cann't change it to numc.

Regards,

Suresh.

Sm1tje
Active Contributor
0 Kudos

How are you entering data directly into this table? Via maintenance view? If so, there are several events defined for maintenance views to do all sorts of validation.

Former Member
0 Kudos

Hi,

try on at selection-screen on char field.

take string length of char field( string u entered ) and perform do.

check for every literal in sy-abcde.

if sy-subrc eq 0.

give message like donot enter characters.

exit.

endif.

endloop.

Former Member
0 Kudos

Hi ,

Value range in domain level of that field you can specify Intervals as " 0000 to 9999 ".

It might solve your problem.

Regards

Pinaki

Former Member
0 Kudos

Hi,

Try this condition

IF NOT '1,2,3,4,5,6,7,8,9,0' CS ITAB-num.
 " Error Message
ENDIF.

Former Member
0 Kudos

Hi Suresh,

u can not validate char field while directely entering values in table level.

Regards,

N.Neelima

Former Member
0 Kudos

Hi Suresh,

while appendng the record to the table check for the validation.

say w_char(4) type c is the field of table t_tab to be validated.

w_char = '0010'.

if w_char na sy-abcde.

append t_tab.

endif.

Regards,

Mdi.Deeba Najam.