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

Value Check for Parameters does not work

ratna_rajeshp
Active Participant
0 Likes
5,275

Hi Experts,

Iam trying to use the Value Check addition for a paramter,but it does not do any validation.

Parameters : p_bukrs type t001-bukrs obligatory value check.

It allows me to enter any wrong values

Is there any thing that i need to do in addition to this.

Regards,

Ratna

1 ACCEPTED SOLUTION
Read only

former_member206377
Active Contributor
2,054

VALUE CHECK addition checks the input value against the fixed values defined in the domain of the data type. And if, If the data type is a component of a foreign key table, a check against the check table is done. See if either of these exists.

9 REPLIES 9
Read only

Former Member
0 Likes
2,054

Hi Ratna.

You can also write a logic for the validation.

use select query and show error if bukrs does not exist.

eg.

tables: t001.

select single bukrs

from t001

into t001-bukrs.

if sy-subrc <> 0. "no data exists

message: 'Company Code does not exist' type 'E'.

endif.

Read only

Former Member
0 Likes
2,054

hi, try this

AT SELECTION-SCREEN.
  
IF <your condition not satisfied>.
    MESSAGE E000(ZMSG_MUSTER) .
  ENDIF.

Sumit

Read only

former_member206377
Active Contributor
2,055

VALUE CHECK addition checks the input value against the fixed values defined in the domain of the data type. And if, If the data type is a component of a foreign key table, a check against the check table is done. See if either of these exists.

Read only

0 Likes
2,054

Thanks for your Replies

But,

1) I dont write an additionall select,because the use of Valucheck is to avoid it.

2) This has already the Value table.

Regards,

Ratna

Read only

2,054

Hi

Use T001D Instead of T001

Parameters bukrs type t001d-bukrs obligatory value check

"Since t001 bukrs doesnot have foreign key established it will not do value check
 "in case of T001d-bukrs foreign key is with table T001-BUKRS so it works for you

Ratna wrote

This has already the Value table.

Please note Having a Value table doesnt mean that there is a Foreign key provided it only proposes

Cheerz

Ram

Read only

0 Likes
2,054

Hi Ratna,

You can see that the field BUKRS in table T001 does not have foriegn key relation and neither does it have a value range. Check table of the domain BUKRS is table T001 itself and hence Foriegn Key maintenance is not possible.

So in such a case I think you will have to use FM COMPANY_CODE_READ as mentioned in one of the posts above or use any of the tables that has T001 as check table.

Read only

DirkAltmann
Active Participant
0 Likes
2,054

Hi Ratna,

implement at the event "AT-SELECTION-SCREN" the FM "COMPANY_CODE_READ"


AT-SELECTION-SCREEN.
CALL FUNCTION 'COMPANY_CODE_READ'
  EXPORTING
    i_bukrs                 = pa_bukrs.

Regards

Dirk

Edited by: Dirk Altmann on Jan 21, 2010 6:19 AM

Read only

Former Member
0 Likes
2,054

This message was moderated.

Read only

Former Member
2,054

Hi ,

When you use Value Check addition for a paramter content of the input field is checked against the fixed values defined in the domain of the data type. In case data type is a component of a foreign key table, a check against the check table is executed.

In case of T001-bukrs check table is same table T001.

If you will test same for Parameters :

p_MANDT type t001-MANDT obligatory value check.

Error message will come.

So , you can write your own logic for validation of field value from T001-bukrs.

Hope this helps you.