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

Configure Data Type to avoid wrong Entries

Former Member
0 Likes
447

Hi,

is it possible to configure a data type to avoid non corresponding entries?

For example a field like CCNN.NNNN-NN.NNNN

C should be a Character, N a number. All differences should be rejected.

Regards,

Udo

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
424

Hi,

If you want to configure such a data type in dictionay then you can attach conversion routine to that field in domain. Sample code provided by rich may help you in writing routine. You can flash messages when there is any error in input to that filed through conversion routine.

Regards,

Ramesh

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
424

You can't set up a datatype like that, but you can do this with a little coding.




report zrich_0002 .

data: s type string.
data: length type i.

s = 'A11234A6789'.
length = strlen( s ).

if s+0(2) ca '1234567890'.
  write:/ 'first two characters are not characters'.
endif.

length = length - 2.
if  s+2(length) ca sy-abcde.
  write:/ 'other characters are not numbers'.
endif.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
424

Hi,

Create a number range object using SNRO transaction

for table field.

Regards

Amole

Read only

Former Member
0 Likes
425

Hi,

If you want to configure such a data type in dictionay then you can attach conversion routine to that field in domain. Sample code provided by rich may help you in writing routine. You can flash messages when there is any error in input to that filed through conversion routine.

Regards,

Ramesh