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

Domain Fixed Value- Affected Fields

Former Member
0 Likes
5,910

Hi,

I am new to ABAP and I'm facing an issue with Domain Fixed Value. I created a sample table with two columns, one of which represents the primary key.

I tried to set a domain fixed value for both. I found that the fixed value logic (i.e. not accepting any other value other than the range values) is applicable only to the column which is not the primary key but the primary key column accepts values other than the range values.

Can anyone explain this concept to me? Is the Domain Fixed value applicable only to non-key fields?

Thanks,

Priyanka

8 REPLIES 8
Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
4,070

That's strange. Fixed domain values should be enforced for the key field as well. Please double check.

Read only

edgar_nagasaki
Contributor
0 Likes
4,070

Hi Priyanka,

Just did a quick test and had no issues in creating such table structure... Which error message you're receiveing?

Edgar

Read only

Former Member
0 Likes
4,070

HI Priyanka,

      just now i have created a custom  table ZSTUDEN with 2 fields.. in this SID is primary key field with dataelement-ZSID1, and its domain-ZSTDID

another non key field SNAME with dataelement - ZSNAME_1 ,Domain - ZSNAMEE

Created domain ZSTDID with fixed value ranges. and repeated it for another field also.

Now i have created table maintanence generator to create entries and able to create entries in it successfully without any problems.

Please refer to  screen shots attached and reply me for any info...

thanks,

venkata Vamsi krishna ch

Read only

0 Likes
4,070

Thank you for your reply and sorry that I put the question wrongly...

Actually the problem is that when I am using char datatype it is working perfectly but when I am using int2 it is not working.

The field is accepting all values while it should accept only those values declared in the domain fixed value.

For eg., in the given attachment the  field is accepting the value 6 while it should accept {1,2,3} and must throw an error if the value is other than {1,2,3}.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
4,070

That is standard behavior of dialog maintenance, check online help for "Fixed Values" of "domains".

It is only possible to define fixed values for domains of data types CHAR, NUMC, DEC, INT1, INT2 and INT4. There is only an input check of the template for data types CHAR and NUMC.

Regards,

Raymond

Read only

0 Likes
4,070

Guess Raymond is correct. The way you could try to achieve same result is to define your domain as NUMC instead of INT (once you would have fixed values defined it will avoid to accept undesired input values such as 01, 02 and so on, with leading zeros). Please try and let us know.

Edgar

Read only

Former Member
0 Likes
4,070

hi ,

          Raymond has given correct explanation.

Please go through this link for full information: http://help.sap.com/saphelp_nw04s/helpdata/en/e2/66708f730811d2959500a0c929b3c3/frameset.htm

Thanks,

Venkata vamsi krishna ch

Read only

Former Member
0 Likes
4,070

Hello,

Domain Fixed values work  for any field regardless of it bieng a primary key or not.

Make sure you are following proper procedure and entering your fixed values in Fixed values field not Range field.

1 value per Fixed value row.

If filling values in range field and it would accept all values that would comply with the range.

Thank You.