cancel
Showing results for 
Search instead for 
Did you mean: 

Variant Config - selection number of char values

Former Member
0 Kudos

Hello All, Thanks.

Could you pls put some light on these questions-

1. There is Char "COLOR" with 10 different values (10 different colors)...but selection should allow selecting only maximum 4 values...if its more than 4 values then system should display error message.

2.Another Char is "Percentage" and each color will have number of percentage value but total value should not go more than 100% or less than 100%.

Regards

SUNIL

Accepted Solutions (1)

Accepted Solutions (1)

former_member184627
Active Contributor
0 Kudos

Dear Sunil,

Below is one of the method to achieve the above requirement. Please check & let us know.

1. Create two numerical characterisitcs COUNT1, COUNT2

2. Create a procedure:

$SELF.COUNT1 =0,

$SELF.COUNT1 = $SELF.COUNT1 +1 IF $SELF.COLOR ='RED',

$SELF.COUNT1 = $SELF.COUNT1 +1 IF $SELF.COLOR ='GREEN',

$SELF.COUNT1 = $SELF.COUNT1 +1 IF $SELF.COLOR ='BLACK',

$SELF.COUNT1 = $SELF.COUNT1 +1 IF $SELF.COLOR ='BLUE',

$SELF.COUNT1 = $SELF.COUNT1 +1 IF $SELF.COLOR ='WHITE'

etc for all colors...

This will increment the value of COUNT1.

3. Create another procedure to calculate the total percentage into COUNT2.

4. Create Dependency Net:

OBJECTS:

      A IS_A (300) KMAT_CLASS.

CONDITION:

      A.COUNT1 > 4,

      A.COUNT2 <> 100

RESTRICTION:

      FALSE

Regards,

Senthilkumar SD

Former Member
0 Kudos


Hello Senthilkumar, Thanks for perfect information.

Its worked.

Could you pls help me on COUNT2 code for Percentage calculation (maximum 4 colors and total percentage should not go more than 100 and less than 100...

RED - 20

GREEN - 30
BLACK - 40

BLUE - 10

Regards

SUNIL

former_member184627
Active Contributor
0 Kudos

Hi Sunil,

Nice to hear it worked

To calculate COUNT2, try with the below code.

$SELF.COUNT2 = $SELF.PERCENT1 + $SELF.PERCENT2 etc..

The constraint in the previous post, will have a check whether this calculated value is equal to 100 or not.

Regards,

Senthilkumar SD

Former Member
0 Kudos

Hello Senthilkumar, Thanks.

I am getting below syntax error....any thought..

E28110 Keyword RESTRICTION: expected

E28025 Syntax error in constraint

Code is as below:-

--------------------------------------------

OBJECTS:

MAT1 IS_A(300) SIZE.

CONDITION:

    MAT1.COUNT1 > 4,

    MAT1.COUNT2 <> 100.

RESTRICTION:

   FALSE

--------------------------------------------------

Regards

SUNIL

former_member184627
Active Contributor
0 Kudos

Hi Sunil,

I guess SIZE is your class...

Try with

MAT1.COUNT1 > 4 AND

MAT1.COUNT2 <> 100.

Regards,

Senthilkumar SD

Former Member
0 Kudos

Hello Senthilkumar, Thanks.

Yes...SIZE is Char.

I tried this but nothing is working - No control for COUNT1 & COUNT2.

Regards

SUNIL

former_member184627
Active Contributor
0 Kudos

Hi Sunil,

Under objects do not enter the characterisitc, enter the KMAT class .

Also, Just enter the code for COUNT1 & check if it works.

Regards,

Senthilkumar SD

Former Member
0 Kudos

Hello Senthil, Thanks.

Yes...I did and its work for COUNT1 and not COUNT2.

Pls check attached.

1 more question- Header & component materials base unit of measure is "PC" and sales unit "FT2"...when i create order with SUOM "FT2" i see the correct calculation as below-

COLOR - Qty 100 - "FT2" - this is header material

RED - Qty 30 - FT2 (30%) - Component 1

BLACK - Qty 30 - FT2 (30%) - Component 2

BLUE - Qty 40 - FT2 (40%) - Component 3

but if i create order with BUOM "PC" then still component calculate in the form of FT2....componenst should follow the same unit of measure of header material....

former_member184627
Active Contributor
0 Kudos

Hi Sunil,

Can you post the codes relevant to COUNT2, so that we can check ?

Regards,

Senthilkumar SD

Former Member
0 Kudos

Hello Senthil, Thanks.

COUNT2 code is as below-

$SELF.COUNT2 = $SELF.RED_PERCENTAGE + $SELF.BLUE_PERCENTAGE + $SELF.BLACK_PERCENTAGE.

Note - RED_PERCENTAGE, BLUE_PERCENTAGE & BLACK_PERCENTAGE are CHAR's of Percentage.

Regards

SUNIL

Former Member
0 Kudos

Hello Senthil, Thanks.

Its worked as assigned above DEP to each color Char.

Thanks for your valuable information. i am closing this discussion.

Regards

SUNIL

Answers (0)