cancel
Showing results for 
Search instead for 
Did you mean: 

Want to fetch all the Characteristics (CT04) for KMAT material by MATNR

Former Member
0 Kudos

Hi Experts,

i have one interesting requirement from my client.

They want to have a report for USAGE PROBABILITY for their KMAT material orders. This means if a KMAT material is a car and it comes in Black, Blue & Red colours as 3 characteristic values, then they want to determine the percentage of each of the colours against the total number of cars sold.

For example, if 1000 cars were sold in a given period of time, then Black coloured cars were 400, Red ones 300 & Blue ones 300 (total 1000).

By doing so, they want to be able to carry out more efficient demand forecasting and customer buying trend analysis.

I know we can achieve this requirement by developing a Z report and the remaining logic is already suggested by me but i am stuck here.

I want to know how we can pull all the characteristics maintained for a material based on the material number. is there any Table for this one? I know CAWN & CABN tables are for characteristics and Classes respectively but HOW TO HAVE A LOGICAL LINK (ABAP) BETWEEN THE KMAT MATERIAL NUMBER (MATNR) AND IT'S CLASSES / CHARACTERISTICS?

Please suggest as I believe this will be an important learning for me and most of the people here in this forum.

Thanks,

Siddhant

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Use this BAPI --BAPI_OBJCL_GETDETAIL_KEY.

Put Objkey as Material Number  and ClassNum  as your class as an input parametres and get the value of all characterstics maintained in that class.

Let me know,if i misunderstood your requirement.

Regards

Amit

Answers (6)

Answers (6)

Former Member
0 Kudos

Guys,

thanks for all the vital inputs. good learning for me.

@Sai Krishna,

I had already tried to search the forum before posting but could not find the relevant threads mentioned by you. may be my search key words were wrong

Thanks for the help anyway,

Siddhant

former_member184080
Active Contributor
0 Kudos

Hi Siddhant,

I request you to search in forum before posting it. We have lot of threads in SCN on this.

Few examples:

http://scn.sap.com/thread/3279960

http://scn.sap.com/thread/3283661

http://scn.sap.com/thread/3188482

This will save everyone's time.

Regards,

Sai Krishna.

Former Member
0 Kudos
Former Member
0 Kudos

Also, there is one more query here.

Can we pull what characteristics were selected for that material in the sales order?

I mean a KMAT material can have many variants & characteristics but at the time of sales order we select only those characteristics / variants which the customer wants. So can we fetch the data for only the selected characteristics for the order?

Pls suggest

Former Member
0 Kudos

Yes - You can use VC_I_GET_CONFIGURATION_IBASE to get the sales order data

Pass the sales order number (VBELN) to VBAP and  get the value of CUOBJ from VBAP and pass it to INSTANCE and Language EN to Function Module.

Regards

Amit

bastinvinoth
Contributor
0 Kudos

Hi Siddhant,

Based on the sales order number and item, you will get object number CUOBJ field in VBAP,

then pass the same no to following function module (VC_I_GET_CONFIGURATION).

DATA: IT_CONFIG LIKE TABLE OF CONF_OUT,

        WA_CONFIG LIKE LINE OF IT_CONFIG.

SELECT SINGLE CUOBJ INTO WA_FINAL-CUOBJ FROM VBAP

WHERE VBELN = WA_FINAL-VBELN AND POSNR = WA_SALES-ITM_NUMBER.


CALL FUNCTION 'VC_I_GET_CONFIGURATION'

       EXPORTING

         INSTANCE            = WA_FINAL-CUOBJ

         LANGUAGE            = SY-LANGU

       TABLES

         CONFIGURATION       = IT_CONFIG

       EXCEPTIONS

         INSTANCE_NOT_FOUND  = 1

         INTERNAL_ERROR      = 2

         NO_CLASS_ALLOCATION = 3

         INSTANCE_NOT_VALID  = 4

         OTHERS              = 5.

     IF SY-SUBRC <> 0.

* Implement suitable error handling here

ENDIF.

Regards,

Bastin.G

Former Member
0 Kudos

Thanks for the info Bastin and Amit. I will surely check this out and post it here.

Siddhant

bastinvinoth
Contributor
0 Kudos

  Try to use this FM also .

CLAF_CLASSIFICATION_OF_OBJECTS

BAPI_OBJCL_GETDETAIL

Regards,

Bastin.G