Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

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 mara-cuobf,
     lv_objibin TYPE ibin-instance,
     lv_recnr TYPE ibin-in_recno,
     lv_sumid TYPE ibinvalues-symbol_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_selsym-SIGN = 'I'.
     wa_selsym-OPTION = 'EQ'.
     wa_selsym-low = wa_symids-SYMBOL_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_symbols-atinn
       IMPORTING
         OUTPUT        = w_symbols-atinn_s.

     MODIFY t_symbols FROM w_symbols.
   ENDLOOP.

ENDFUNCTION.

Conversion Routine

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


...

       

         w_float = wa_symbols-ATFLV.
         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.

1 Comment