cancel
Showing results for 
Search instead for 
Did you mean: 

Dependency code to count characteristics values

former_member218144
Participant
0 Kudos

Hi All,

I have particular requirment with object dependency code.Say we have two characteristics assigned to a class .

The first characteristics values would have multiple values entered on it(For eg1st value=1001,2nd values=1002,3rd value=1003)

I need the second characteristics value to count the number of characteristics values in it.(Result to be populated=3).

Thanks in advance.

Regards

Richie

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member184627
Active Contributor
0 Kudos

Dear Richie,

Try with a procedure:

$SELF.CHAR2 =0,

$SELF.CHAR2 = $SELF.CHAR2 +1 IF $SELF.CHAR1 ='1001',

$SELF.CHAR2 = $SELF.CHAR2 +1 IF $SELF.CHAR1 ='1002',

$SELF.CHAR2 = $SELF.CHAR2 +1 IF $SELF.CHAR1='1003

Regards,

Senthilkumar SD'

former_member218144
Participant
0 Kudos

Hi Senthil,

We do not have any fixed values for the characteristics.The values would be generated randomly.

Regards

Richie


ravi_kumar204
Active Participant
0 Kudos

Hi

The example explained by me previously will work for fixed values, not for random values.

If char values are assigned dynamically, Use variant functions, check below links.

Creating a Function to Dynamically Determine the D - Batch Management (LO-BM) - SAP Library

Take your ABAP team help also.

Regards

Ravikumar B

former_member184627
Active Contributor
0 Kudos

Dear Richie,

Could you please post the screenshot of the values tab of the characteristic ? We would like to understand how you are bringing in the random values. If it is a numeric or if you have additional values etc.

Regards,

Senthilkumar SD

0 Kudos

This message was moderated.

Ritz
Active Contributor
0 Kudos

Flint Entrec,

Please open a new thread instead of updating an old thread. If you have silimar issue , you can refer a link of old thread. While doing so please also mention have you tried the solution suggested in this thread.

Thanks

Ritesh

Flavio
Active Contributor
0 Kudos

Hi Richie,

This document could be useful:

Thank you and bye,

Flavio

Ritz
Active Contributor
0 Kudos

Richie Ravikumar,

It will be nice , if you can share business requiremnt tied with it ,  isnt its already visible in configuration how many values user already assign to a multi-value characterstic? Why do you want to calculate that number again?

Thanks

Ritesh

former_member218144
Participant
0 Kudos

Hi Ritesh,

The requirement is the material has various batch characteristics.Based on these charactersitics values the system would identify the suitable customer as per the maintenance in the inspection rule and would update in the first characteristic value .We can identify the number of characteristics values(customer) in the first charcteristic itself,But still we need a separate characteristic value to capture the count.

I saw a command called "COUNT_PARTS",but it doesnt work.

please help me with some ideas to capture the count.

Regards

Richie

ravi_kumar204
Active Participant
0 Kudos

Hi Richie Ravi

Check with below procedure and assign it to Mutli Value char.

$SELF.COUNT = 0,

$SELF.COUNT = $SELF.COUNT + 1

IF MULTI_CSTIC = '1',

$SELF.COUNT = $SELF.COUNT + 1

IF MULTI_CSTIC = '2',

$SELF.COUNT = $SELF.COUNT + 1

IF MULTI_CSTIC = '3',

$SELF.COUNT = $SELF.COUNT + 1

IF MULTI_CSTIC = '4',

$SELF.COUNT = $SELF.COUNT + 1

IF MULTI_CSTIC = '5'.

It is working for me. check and reply.

former_member218144
Participant
0 Kudos


Hi Ravi,

I tried the same .I facing the below error

"6/

W28101 Invalid value 5 for characteristic XXXXX


W28101 Invalid value 4 for characteristic XXXXX


W28101 Invalid value 3 for characteristic XXXXX


W28101 Invalid value 2 for characteristic XXXXX

"

Please guide

Regards

Richie

ravi_kumar204
Active Participant
0 Kudos

Hi Richie,

Check the char. values characteristic XXXXX.

In my example Multiple value char as below values.

1              Cust 1

2             Cust 2

3              Cust 3  

4            Cust 4

5             Cust 5.

Regards,

Ravikumar B

Caetano
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello

Thread moved to the space SAP ERP PLM - Classification and Variant Configuration.

BR
Caetano