on 09-02-2015 10:47 AM
Hi Gurus,
Can someone help me how to read classification data(class and characteristics values) assigned to material while creating material in SAP MDG-M
Hi,
The question is not clear. As I understand you need to read the classification data entered in the MDG-M UI.
- You can read the class & charact data in CHECK BADI
- You can read the class & charact data in Derive BADI (Howewer you cannot default/derive classification entity using the derive BADI)
- You can read classification entity using Governance APIs
Where do you want to access this data ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Anand,
Can you please explain where,when and why you want to read the classification data to get clear picture ?
Anyway,
In Derive and Check BADI you get reference to IO_MODEL instance of type IF_USMD_MODEL_EXT.
This interface has many methods to read the entity values :
You can try methods
IO_model->retrieve_char_value ()
For using the API please refer the below document.
http://scn.sap.com/docs/DOC-45127
Best Regards,
Shivanand
Hi Shivanand
I am trying to read the material number with the below code in Derive method of interface IF_USMD_MODEL_EXT but it is returning null.could you please correct me if anything wrong in below code.
CALL METHOD io_model->create_data_reference
EXPORTING
i_fieldname = if_mdg_bs_mat_gen_c=>gc_fieldname_material
i_struct = if_usmd_model_ext=>gc_struct_key_attr
i_tabtype = if_usmd_model_ext=>gc_tabtype_sorted
IMPORTING
er_data = lr_t_data_material
et_message = lt_usmd_message.
ASSERT lt_usmd_message IS INITIAL. " Room for error handling here...
ASSIGN lr_t_data_material->* TO <lt_data_material>.
CREATE DATA lr_data_material LIKE LINE OF <lt_data_material>.
ASSIGN lr_data_material->* TO <ls_data_material>.
* Selection Criteria - MATNR
ls_sel-fieldname = 'MATERIAL'.
ls_sel-option = 'EQ'. "equal
ls_sel-sign = 'I'. "including
INSERT ls_sel INTO TABLE lt_sel.
* Read Material
CALL METHOD io_model->read_char_value
EXPORTING
i_fieldname = if_mdg_bs_mat_gen_c=>gc_fieldname_material
i_readmode = if_usmd_model_ext=>gc_readmode_all_inact
it_sel = lt_sel
IMPORTING
et_data = <lt_data_material>
et_message = lt_usmd_message.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.