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

Checking domain fixed values

Former Member
0 Likes
4,227

I have a screen field in a dynpro where the domain has a fixed value range. The values shows up in the F4 help, but I can't figure out the best way to validate it in the PAI short of hardcoding, which I'd like to avoid.

Take for example a domain with possible values 'A', 'B', 'C', '1', '2' or '3'. These values pull through to the search help but I also need to validate manual user input against this list.

I understand the DDIC attribute for a screen element can do this, but that's not an option in this case as the name of the field does not match the name of a dictionary field. Any other suggestions?

Thanks

1 ACCEPTED SOLUTION
Read only

christine_evans
Active Contributor
0 Likes
1,649

>

> I have a screen field in a dynpro where the domain has a fixed value range. The values shows up in the F4 help, but I can't figure out the best way to validate it in the PAI short of hardcoding, which I'd like to avoid.

>

> Take for example a domain with possible values 'A', 'B', 'C', '1', '2' or '3'. These values pull through to the search help but I also need to validate manual user input against this list.

>

> I understand the DDIC attribute for a screen element can do this, but that's not an option in this case as the name of the field does not match the name of a dictionary field. Any other suggestions?

>

> Thanks

If this field should only contain values from the domain fixed value range, why don't you make it into a drop down listbox field? This would make manual input impossible and all they can do is select values from the drop down list.

5 REPLIES 5
Read only

Sm1tje
Active Contributor
0 Likes
1,649

After input, retrieve the value from the input field and use FM SXMB_CHECK_DOMAIN_VALUES.

Read only

Former Member
0 Likes
1,649

Hi,

May be you can check using the table as below

SELECT DOMVALUE_L DDTEXT FROM DD07T INTO TABLE LIST

WHERE DOMNAME = <domain name>

AND DDLANGUAGE = SY-LANGU.

Hope this is useful.

Regards,

Krishna.

Read only

christine_evans
Active Contributor
0 Likes
1,650

>

> I have a screen field in a dynpro where the domain has a fixed value range. The values shows up in the F4 help, but I can't figure out the best way to validate it in the PAI short of hardcoding, which I'd like to avoid.

>

> Take for example a domain with possible values 'A', 'B', 'C', '1', '2' or '3'. These values pull through to the search help but I also need to validate manual user input against this list.

>

> I understand the DDIC attribute for a screen element can do this, but that's not an option in this case as the name of the field does not match the name of a dictionary field. Any other suggestions?

>

> Thanks

If this field should only contain values from the domain fixed value range, why don't you make it into a drop down listbox field? This would make manual input impossible and all they can do is select values from the drop down list.

Read only

Former Member
0 Likes
1,649

Hi,

Use the table DD07T as it contans the values and text for fixed values in a domain.

In the PAI processing simple select from the table DD07T sa if it is a textbox with name txt1

select single domvalue_l into var1 where domname = <domain name> and ddlanguage = sy-langu and domvalue_l = txt1.

if sy-subrc <> 0.

error message.

endif.

Hope this helps.

Regards,

Sachin

Read only

Former Member
0 Likes
1,649

Hi Chris,

Create the range for these values and check if not fields in the range then throw the error enter valid fields.Based on these you can validate.

Regards,

Sravanthi