cancel
Showing results for 
Search instead for 
Did you mean: 

Constraint in Variant Table

former_member214775
Contributor
0 Kudos

Hi All,

There is variant table with the following characteristics:

Input (key fields):

A, B

Output:

C

ZSIGN is a "decision" flag:

If it is "+" then we should select the line.

If it is "-" then the we should not select the line (negative)

If it is empty and the value of A is empty or can be any value then we should select the line. (Due to performance reasons the empty cell od ZSIGN can also be replaced by a characteristic value e.g. "NA" and the empty A cell can be replaced by all possible values of the characteristic A)

I have the following constraint:

Objects:

X    is_object  (Material)(300)(NR = 'ZRT_VC01')

Restrictions:

TABLE ZRT_VT01

(

ZSIGN =X.ZSIGN,

A = X.A,

B = X.B,

C = X.C

).

Inferences:

X.C

When I enter A1, B1 in the configuration I would like to select the first line and infer C1 as the ZSIGN is +. Unfortunately the calculation of the ZSIGN is missing. How can I define a dependency for this logic?

When I enter A3, B1 in the configuration I would like to select the third line and infer C1 as the ZSIGN is empty and the value of A is not A1 nor A2. How can I define a dependency for this logic?

Thank you in advance!

Best regards

Tamas

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member183879
Active Contributor
0 Kudos

Hi Tamas

I am not sure why you use CONSTRAINT to decide the value of C. I dont see any need.

For your design, a procedure with variant table should suffice.

For your question on ZSIGN, I think this characteristic should also be an input char in your configuration. If you are using variant table in your function, then the dependency doesnt read any other characteristic apart from the one which are mapped in the v.table. I cannot confirm this but I hope this is the way the variant table and dependencies using variant table works. So you should include ZSIGN also in the variant table and use it as an input field. Once this is done, you can write the dependency as say ZSIGN <> XZSIGN and ZSIGN NOT SPECIFIED as the condition. I hope this will work.

If you use these enablers, your dependency will work.

try it and lemme know the result. If this doesnt work, we can try other alternatives.

former_member214775
Contributor
0 Kudos

Hi Navaneetha,

the ZSIGN is not an input parameter the system should decide based on that which line to select at the end even the other input parameters (A, B) have the same value.

I tried it like you proposed:

Objects:

X    is_object  (Material)(300)(NR = 'ZRT_VC01')

Condition:

ZSIGN <> X.ZSIGN and ZSIGN NOT SPECIFIED.

Restrictions:

TABLE ZRT_VT01

(

ZSIGN = X.ZSIGN,

A = X.A,

B = X.B,

C = X.C

).

Inferences:

X.C


It will not work as in the condition you can only use X.SIGN.

Error messages:

E28037 Logical expression required (Line 5)

E28051 Reference to characteristic required (Line 5)

E28061 Reference to a class/object required (Line 5)

E28075 Character string required in inverted commas (Line 5)

E28152 Function ZSIGN is not declared (Line 5)

I tried it with procedure as well but does not work.:

TABLE ZRT_VT01 (

A = A,

B = B,

C = $self.C,).

$self.C = C if $self.ZSIGN  = '+'.

Best regards

Tamas