Application Development 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: 

BAPI_MATERIAL_MAINTAINDATA_RT and characteristics

Former Member
0 Kudos

We're encountering a problem when creating a material with characteristics using the retail-specific BAPI_MATERIAL_MAINTAINDATA_RT function.

The material is created and accessible using MM43. When viewing the material, there is a button 'Values' to view the characteristics. However the characteristics that were saved with the material are not shown here.

What I've been able to find, is that the characteristics are saved in table AUSP. And indeed, there are several records for my material in that table. However there seems to be a difference between characteristics that were created with the BAPI and chararacteristics that were edited using MM42.

Now for the technical stuff:

We're using the 'ALL_FIELDS' indicator in the header structure to indicate that all fields are relevant for update. As a result, we don't have to populate all the x-structures for individual fields.

The material number is used in table INOB to retrieve the CUOBJ number. With this CUOBJ number, I can find my BAPI characteristics in the AUSP table. In case of characteristics that were added with MM42, another step is added: with the CUOBJ number, the CLINT number is retrieve from the KSSK table. With this CLINT number, I find the MM42 characteristics in the AUSP table.

BAPI --> char. type = 'O' (object)

MM42 --> char. type = 'K' (class)

BAPI: objek --> (INOB) --> cuobj --> (AUSP) --> atinn/atwrt

MM42 objek --> (INOB) --> cuobj --> (KSSK) --> clint --> (AUSP) --> atinn/atwrt

Can anyone please explain to me why there is a difference? How can I create characteristics with the BAPI and still view them using MM43?

Thanks in advance!

4 REPLIES 4

che_eky
Active Contributor
0 Kudos

Have you tried completing the following and passing to the BAPI:

* Fill header

    headdata-basic_view = 'X'.

* Characteristic

    characteristicvalue-material = matnr.

    characteristicvalue-char_name = charname.

    characteristicvalue-char_value = atwrt.

    APPEND characteristicvalue TO characteristicvalue.

    characteristicvaluex-material = matnr.

    characteristicvaluex-char_name = charname.

    characteristicvaluex-char_value = 'X'.

    APPEND characteristicvaluex TO characteristicvaluex.

That is all you should need.

Che

Former Member
0 Kudos

Hi Che, thanks for the quick reply. Yes I've tried that also. Unfortunately, specifically using the x-structure also means I have to maintain that for all tables, even though all values are to be updated. That's why we've set the 'ALL_FIELDS' indicator.

What I've found now is that characteristics that existed before we upgraded from 4.6 to ECC6.0 are working as expected. We can create those and they show up in the MM43 'Values' screen.

All characteristics that were created after the upgrade, are apparently stored in a different way and don't show up.

Update:

Even stranger, the characteristics DO show up in the Basic view tab on the bottom. But still not in the 'Values' screen. Seems that SAP now uses two different ways of saving and reading characteristics, but hasn't synchronized the method on the different screens in which they are used.

che_eky
Active Contributor
0 Kudos

Yes keep using ALL_FIELDS, I was just trying to narrow down the problem.

Are these variant creating characteristics or not? There is a Values and a Variants screen. Sorry I cannot help any more.

Former Member
0 Kudos

The Color and Size characteristics are used to create variants, that works. The rest of the characteristics are just extra information on the material. Both types are displayed on the Values screen, but only the values of color and size are updated.

We're going to indicate that one of the other characteristics should be used for variant creation also... and see what that does.

Update:

That seems to be the difference in the two display methods. The characteristics listed under the 'Values' button should be the ones that are relevant for variant creation. Even though you can show the labels, the values will never be populated. The remaining characteristics can be displayed where you want (using customizing). We're set those at the bottom of the Basic view, or even in their own view.

Apparently that is the way SAP designed it and I don't think there's much we can do about it.