on 05-03-2016 9:39 AM
Hi Everyone,
i have a requirement to implement derivation for processing multiple materials ,need to read the selected material from multiple materials attached to one change request.
Any idea how to achieve this?
Regards,
Bhuvaneswari
Hi Vemulapalli,
Are you doing MASS update of Materials ? Even during MASS update, DERIVE ENTITY will be triggered. Check BADI's USMD_RULE_SERVICE, USMD_RULE_SERVICE_CROSS_ET
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi MDG user,
In derive_entity method for BADi USMD_RULE_SERVICE.
CALL METHOD io_model->read_entity_data_all
EXPORTING
i_fieldname = 'MATERIAL'
if_active = abap_false
i_crequest = lv_crequest
* it_sel =
it_entity_filter = lt_filter
IMPORTING
* et_message =
et_data_entity = e_data.
with the above code able to read the materials attached to change request but i need to read only selected material for derive_entity method.
regards,
Bhuvaneswari.
Hi Vemulapalli,
In general you would always get the Material number in case of change happens in other entities also.
EX:
DATA: lr_mod TYPE REF TO data.
FIELD-SYMBOLS: <lt_mod> TYPE SORTED TABLE.
FIELD-SYMBOLS: <ls_mod> TYPE any.
FIELD-SYMBOLS: <lv_matnr> TYPE matnr.
DATA: lt_matnr TYPE SORTED TABLE OF matnr WITH UNIQUE KEY table_line.
CALL METHOD io_changed_data->read_data
EXPORTING
i_entity = if_mdg_bs_mat_gen_c=>gc_entity_valuation
IMPORTING
er_t_data_mod = lr_mod.
CHECK lr_mod IS BOUND.
ASSIGN lr_mod->* TO <lt_mod>.
CHECK sy-subrc = 0 AND <lt_mod> IS ASSIGNED AND <lt_mod> IS NOT INITIAL.
" Get the material numbers
LOOP AT <lt_mod> ASSIGNING <ls_mod>.
ASSIGN COMPONENT if_mdg_bs_mat_gen_c=>gc_attr_material OF STRUCTURE <ls_mod> TO <lv_matnr>.
INSERT <lv_matnr> INTO TABLE lt_matnr.
ENDLOOP.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.