Application Development and Automation 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: 
Read only

SAP Characteristic Issue

Former Member
0 Likes
1,240

Hi Gurus,

I'm facing a problem where I need to get "sub characteristics" (if this is what they are called) for a Material. I searched SDN and Found how to get characteristics for a Material, using tables KSSK, KLAH, AUSPm using BAPI_OBJCL_GETDETAIL, etc.

For a Material I have several characteristics, one of them Being VS_TREATMENT (141) and value TM. Now, going to transaction CT04, I see that this characteristic has a field called Active Type N (N = 1 to 10 --> Untreated, Fungicied, etc).

My problem is how can I get this Active Type for the Material I'm in? I can't find the relationship between these 2. Can anyone give me a light on this?

Thanks in advance.

Regards,

Ernesto.

1 ACCEPTED SOLUTION
Read only

SharathYaralkattimath
Contributor
0 Likes
1,055

Are you referring to characteristics values as "sub characteristics"?

Hi Gurus,

I'm facing a problem where I need to get "sub characteristics" (if this is what they are called) for a Material. I searched SDN and Found how to get characteristics for a Material, using tables KSSK, KLAH, AUSPm using BAPI_OBJCL_GETDETAIL, etc.

For a Material I have several characteristics, one of them Being VS_TREATMENT (141) and value TM. Now, going to transaction CT04, I see that this characteristic has a field called Active Type N (N = 1 to 10 --> Untreated, Fungicied, etc).

My problem is how can I get this Active Type for the Material I'm in? I can't find the relationship between these 2. Can anyone give me a light on this?

Thanks in advance.

Regards,

Ernesto.

3 REPLIES 3
Read only

SharathYaralkattimath
Contributor
0 Likes
1,056

Are you referring to characteristics values as "sub characteristics"?

Read only

0 Likes
1,055

Hi Sharath,

Material has a characteristic called VS_TREATMENT, from class VS_INFO_TREATMENT which can have Active Type, Phase and Color as "sub characteristics". These last have values so I guess they are characteristic values.

Hope I answered your question.

Thanks

Ernesto

Read only

0 Likes
1,055

Hi Sharath, I managed to found the solution. Will share it below:

First Need to get the data for the VS_TREATMENT Characteristic. For this we need to do the following Selections:

1) SELECT SINGLE CLINT INTO KSSK-CLINT FROM  KSSK

         WHERE  OBJEK       = MATNR

         AND    MAFID       = 'O'

         AND    KLART       = '001'

2) SELECT SINGLE KLART INTO (KLAH-KLART) FROM  KLAH

         WHERE  CLINT       = KSSK-CLINT

3) SELECT IMERK FROM KSML

          WHERE CLINT = KSSK-CLINT

4) SELECT ATINN ATNAM FROM CABN

          WHERE ATINN = KSML-IMERK

With all the ATINN obtained from CABN + Material Number, retrieve records from AUSP.

5) SELECT OBJEK ATINN ATZHL ATWRT FROM AUSP

          WHERE OBJEK = MATNR (18 DIGIT WITH LEADING ZEROS)

          AND ATINN = CABN-ATINN.

Now here is the trick:

For all records from AUSP table from the previuos search, concatenate ATINN + ATWRT. This will be the key for further selections,

lv_val   LIKE ausp-objek,
lv_atwtb
LIKE cawnt-atwb,

lv_atinn TYPE atinn,
lv_objek
TYPE objnum,
lv_atwrt
TYPE atwrt,

lv_atzhl TYPE atzhl,

----CABN

    SELECT SINGLE atinn INTO lv_atinn                                  

    FROM cabn WHERE atnam = 'VS_ACTIVETYPE'.

----AUSP

    SELECT SINGLE atwrt INTO lv_atwrt

    FROM ausp WHERE atinn = lv_atinn AND objek = lv_val.     "<-----------

----CAWN

    SELECT SINGLE atzhl INTO lv_atzhl

    FROM cawn WHERE atinn = lv_atinn AND atwrt = lv_atwrt.

----CAWNT

    SELECT SINGLE atwtb INTO lv_atwtb

    FROM cawnt WHERE atinn = lv_atinn AND atzhl = lv_atzhl

    AND spras = sy-langu.

Here is how I managed to pull this "sub characteristic". The key was to concatenate Internal Characteristic + Value to get a New Key and search for it.

Regards,

Ernesto.