2016 Oct 04 12:43 PM
Hello Everyone,
I would like to validate a value against an existing domain (without fixed values).
Example:
value = '99'
tabname = 'MARA'
fieldname = 'SPART'
domain = 'SPART'
I want to check if the value '99' is a suitable entry for the field MARA-SPART with the domain SPART. The domain has no check table or value table. The domain has datatype char 2. So '99' would be valid, but 'ABC' would not be valid because it's too long.
I already found and tried several function modules, but they all seem to work for domains with fixed values only. For example 'FM_DOMAINVALUE_CHECK' works fine, but if I use it with a domain that has no fixed values, I always get an exception 'input error'.
So my question is: is there something similar for domains that have no fixed values? A function module where I can use tabname+fieldname or domain as input aswell as the value would be great.
Best regards,
Sebastian
2016 Oct 04 1:06 PM
Hi,
You can create a Check table. And assign values over-there.
Regards,
Niraj Sinha
2016 Oct 04 1:35 PM
2016 Oct 04 2:24 PM
Hi Raymond,
thank you for that hint. Unfortunately, my example with MARA and SPART was not very good.
I tried FM DDUT_INPUT_CHECK. Like the other FMs that I tested, it only gives correct error messages for domains with check tables or value tables.
One problem with this FM is that it doesn't care about the length. When I have a domain like STFAK that has the data type INT2 (5 places) and I use value = '123456' it doesn't complain. I know how I can check if the length is ok, but I would like to avoid doing that seperately.
Another problem: it doesn't complain about value = 'ABD' either, although that is not even a number.
Best regards,
Sebastian
2016 Oct 04 3:10 PM