cancel
Showing results for 
Search instead for 
Did you mean: 

Inferring values from multiple key fields in a table

Former Member
0 Kudos

Hello,

I have encountered a problem with inferring values from tables with two or more key fields. In classification, upon entering the values in the key fields, the other values are not inferred. This works fine when there is only one key field.

I used a procedure to infer the values, following the examples given in the SAP Library. However, I was not able to find any information whether it is possible to infer values using two key fields.

My procedure looks something like this:

TABLE Z_3036_1

(M_MANUFACTURER = M_MANUFACTURER,

M_PART_NO = M_PART_NO,

M3P_MODEL = $SELF.M3P_MODEL,

M_DIAMETER = $SELF.M3P_DIAMETER)

However, upon inserting values in both the manufacturer and part no. characteristics, no values are inferred for the other characteristics.

The manufacturer is not a unique value, however, the part no. is, so the combination of those two should always be unique, therefore I do not think it might be the problem.

Therefore I would like to ask for any advice on what might be wrong or is it even possible to infer values from multiple key fields?

Sincerely,

Mindaugas

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

No, I am talking about type 001 (material type), so that shouldn't be the problem. Any other suggestions as to where the problem might be would be much appreciated.

Regards,

Mindaugas

Ritz
Active Contributor
0 Kudos

Hi Mindaugas,

it appeares you are trying it for class type 001, if so how you have attached your procedure to material if there is no configuration profile?

as per my knowledge it doesnt work with material class 001, but not sure as i havent give it a try myself, and reason behind my answer is based upon thinking how you have attached procedure to material.

As you mentioned , in your case with one key firld its working fine, can you please explain how you have tested it ?

including how you created configuration profile, attached this procedure, and where you are getting result of infered values by one key field.

Hope it will help you.

Thanks

Ritesh

Former Member
0 Kudos

Hi,

I attached the procedure to the class which I assign to the material. That is, I use the transaction CL02 and open up the relevant class. On the basic data screen, I go to Extras>Object dependencies>Assignments and assign the procedure. When I go to classification in MM01 (or MM02 for that matter), I can infer all of the values from one characteristic. However, this same thing does not work if there are two key fields in the table.

Regards,

Mindaugas Kadzys

Former Member
0 Kudos

Hi,

I checked through all of the points you suggested. Thought it might be the case of spacing, but it isn't. None of the rules are violated. But that got me wondering, is there a difference in the rules of writing a procedure for classification and variant configuration? Because I'm writing it for classification and you seem to be talking about variant configuration.

Also, as a side note, inferring values from just one key field works just fine, but it doesn't if I set two key fields.

Sincerely,

Mindaugas

Former Member
0 Kudos

Hi,

If I am not wrong you are talking about Variant class (type 300) classification.

As far my understanding you have created one procedure by calling table TABLE Z_3036_1 to infer values to MODEL and DIAMETER and assigned this procedure in classification of type 300 to char M_MANUFACTURER and observed that the values are not inferring.

SOLUTION: Requested to add this procedure in the configuration profile of the configurable material and check.

REASON: In case of multiple key fields the procedure assigned to classification may not trigger.

Hope this will help and solve your issue

Regards,

Brahmaji D

former_member183879
Active Contributor
0 Kudos

Hi

If I am not wrong, there has to be only one non-key field. There can be multiple key fields. There is no issue with the V.Table with various key fields. But the non-key field should be only one and this non-key field is the field /characteristic which will be determined based on the values of the key field characteristic values maintained in the table.

In your case, you are trying to determine the value of 2 fields based on some key fields. This may not be completely successful. You should be creating two variant tables with the same key fields, but different nonkey fields the value of which can be determined by two different dependencies.

However, I may also be incorrect. Let me know if so.

Former Member
0 Kudos

Hi,

As far my understanding on your concern, we can infer any number of char values using Variant table procedure. For example in a Varinat table with 10 char, the first 2 char as key fields and remain 8 were non key fields. The procedure works fine and infer the char values to those 8 char as per the 1st 2 key fields entry in the configuration.

We have to take care of these check points if the procedure not working means not infering values.

1) There should not be any Multiple values char included in the structure

2) There should be unique combinations in the table

3) There should not be any blank values or spaces in the table entries. Some times there will be some space in table values while uploading from Excel

4) Further procedure code should be perfect Means writing $self for the infer char and released

5) The sequence of the procedure is most important while assigning in the profile.

Hope these points are useful.

Regards,

Brahmaji D

Former Member
0 Kudos

Hi,

As per my opinion the problem is not with Multiple key fields. It can be either table entries problem or Procedure code.

1) Variant table: Model and Diameter is not having unique values for the combination of Manufacture and Part no.This you can verify by downloading the data in excel and check by applying filters.For the combination of Manufacture and part no you should have only one Model and Diameter value. If there exists more than one value set for model and Diameter system can not infer values to those char.

2) Please check the last line in the Procedure code

M_DIAMETER = $SELF.M3P_DIAMETER.

I feel it should be M3P_DIAMETER = $SELF.M3P_DIAMETER

Regards,

Brahmaji D

Former Member
0 Kudos

Regarding the procedure code, yes, you are right, I mistyped it here, it should be as you say(M3P_DIAMETER = $SELF.M3P_DIAMETER). However, the code is fine in the actual procedure.

EDIT: I misunderstood your message. However, I have checked the table using the check function and it says it is fine. I have also tried this on a small table by manually checking through the value combinations and the key combinations are indeed unique. By that I mean that there is only one combination of a manufacturer and part no. in the whole table, making the diameter and model for the combination unique.

As I have said, the table check also does not detect any ambiguity in the values.

Sincerely,

Mindaugas

Edited by: MKadzys on Jan 22, 2012 1:40 PM