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_float = wa_symbols-ATFLV. |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
3 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 |