on 04-11-2016 10:27 AM
Hi Everyone,
Method for reading technical key for material number in MDG-M.or table containing change request number,technical key and material number.
thanks & regards, Bhuvaneswari
Hi Bhuvaneswari,
Why would you need to read technical key. If you want to read the Entity data or change request data or workflow data you have MDG API. You call the API and get the information you need.
Thanks
Goutham
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Goutham,
Thanks for your reply,
I am trying to read the selected material for single processing in the list of materials attached to one change request in method CHECK_ENTITY for BADI USMD_RULE_SERVICE.
but by using this method READ_ENTITY_DATA_ALL it retrieves all the materials attached to request.
Any inputs,
Thanks
Bhuvaneswari
Hi Bhuvaneswari,
The import parameter IT_DATA in CHECK_ENTITY method will have the material data. If you need any further information of the material use import parameter IO_MODEL and call READ_CHAR_VALUE method by passing information like material number etc. Below is a sample piece of code.
Data: lr_data type ref to data.
Field-symbols: <lt_data> type sorted table,
<ls_data> type any.
CALL METHOD io_model->create_data_reference
EXPORTING i_fieldname = "Entity Name"
i_struct = io_model->gc_struct_key_attr
if_table = abap_true
i_tabtype = io_model->gc_tabtype_sorted
IMPORTING
er_data = lr_data.
ASSIGN lr_data->* TO <lt_data>.
* Read MATERIAL via material number and Change Request ID
CLEAR lt_sel.
ls_sel-fieldname = if_mdg_bs_mat_gen_c=>gc_fieldname_material.
ls_sel-sign = lc_incl.
ls_sel-option = lc_equal.
ls_sel-low = "Material Number".
INSERT ls_sel INTO TABLE lt_sel.
ls_sel-fieldname = usmd0_cs_fld-crequest.
ls_sel-low = "Change request number".
INSERT ls_sel INTO TABLE lt_sel.
CALL METHOD io_model->read_char_value
EXPORTING i_fieldname = "Entity Name"
it_sel = lt_sel
i_readmode = if_usmd_model_ext=>gc_readmode_default
if_use_edtn_slice = abap_false
IMPORTING et_data =.<lt_data>.
Thanks
Goutham
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.