I recently had a lot of trouble finding the requested characteristics on a specific material. For some reason the class assigned to the material didn’t contain the characteristics that I needed. I’m not an SD consultant so I had no idea where to even begin to resolve this problem. After running to every SD and MM consultant that I knew, I finally found one who helped me really quickly.

First, he indicated that there is a configurable master material that contains the characteristic class. But unfortunately that material wouldn’t contain any data as it’s the master of many child materials. After some digging he helped me find the link to MARA that CLAF_CLASSIFICATION_OF_OBJECTS for some reason couldn’t find. This function module is a result of that.

For ZIBSYMBOL I just made a copy of structure of table IBSYMBOL and added ATINN_S as a type CHAR20.

Also, keep in mind that the from field will be required for some characteristics. It’s a floating point value and will need to be converted to be readable.

Function – Get Master Characteristic Data for a Material
FUNCTION z_get_config_mat_char.
*”———————————————————————-
*”*”Local Interface:
*”  IMPORTING
*”     REFERENCE(P_MATNR) TYPE  MATNR
*”  TABLES
*”      T_SYMBOLS TYPE  ZIBSYMBOL
*”———————————————————————-

   DATA: lv_objmara TYPE maracuobf,
     lv_objibin TYPE ibininstance,
     lv_recnr TYPE ibinin_recno,
     lv_sumid TYPE ibinvaluessymbol_id,
     w_symbols LIKE LINE OF t_symbols.

   DATA: it_symids TYPE TABLE OF IBINVALUES,
         wa_symids LIKE LINE OF it_symids.

   DATA: it_selsym TYPE TABLE OF selopt,
         wa_selsym LIKE LINE OF it_selsym.

   SELECT SINGLE cuobf
     FROM mara
     INTO lv_objmara
     WHERE matnr = p_matnr.

   lv_objibin = lv_objmara.

   SELECT SINGLE in_recno
     FROM ibin
     INTO lv_recnr
     WHERE instance = lv_objibin.

   SELECT * FROM ibinvalues
     INTO CORRESPONDING FIELDS OF TABLE it_symids
     WHERE in_recno = lv_recnr.

   LOOP AT it_symids INTO wa_symids.
     wa_selsymSIGN = ‘I’.
     wa_selsymOPTION = ‘EQ’.
     wa_selsymlow = wa_symidsSYMBOL_ID.
     APPEND wa_selsym TO it_selsym.
   ENDLOOP.

   SELECT * FROM ibsymbol
     INTO CORRESPONDING FIELDS OF TABLE t_symbols
     WHERE symbol_id IN it_selsym.

   LOOP AT t_symbols INTO w_symbols.
     CALL FUNCTION ‘CONVERSION_EXIT_ATINN_OUTPUT’
       EXPORTING
         input         = w_symbolsatinn
       IMPORTING
         OUTPUT        = w_symbolsatinn_s.

     MODIFY t_symbols FROM w_symbols.
   ENDLOOP.

ENDFUNCTION.

Conversion Routine

data : w_float type f,
        w_character type auspatwrt,
        w_number(10) TYPE P DECIMALS 0.


       

         w_float = wa_symbolsATFLV.
         CALL FUNCTION ‘CEVA_CONVERT_FLOAT_TO_CHAR’
           EXPORTING
             float_imp = w_float “Feld TYPE F
             format_imp = w_number “Field Format
             round_imp = ‘ ‘ “Round off
           IMPORTING
             char_exp = w_character. “Feld TYPE C
         <field> = w_character.

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Tim Ratelle

    The title of this blog entry is incorrect.  It should be Characteristics for Configurable Materials since you are dealing with configurable materials here (typically class type 300) and not a regular material classification like class type 001.

    Also I would try to use a better function module especially one built for conversion of characteristic values like CTBP_CONVERT_VALUE_INT_TO_EXT or FLTP_CHAR_CONVERSION.  I try to avoid using function modules or classes built for a specific module/package of SAP.

    (0) 

Leave a Reply