cancel
Showing results for 
Search instead for 
Did you mean: 

USMD_SSW_RULE_CONTEXT_PREPARE

0 Kudos

Hello,

I am new in the MDG area.

I found the HowTo "Master Data Governance for Material: BADI USMD_SSW_RULE_CONTEXT_PREPARE to enhance User Determination". There it is described how to enhance the context via Enhancement Spot USMD_SSW_SERVICE_PROCESSOR and example implementation MDG_BS_MAT_BRF_CONTEXT_LABOR.

I implemented the BadI and replaced LABOR with MTART in example implementation.

It works correctly. Now I need added the 'lgort' for the decision tables in BRF+ (User Agent Desition table). How is it possible to enhance the code to retrieve the lgort values ?

Thanks in advance.

Regards,

Natalia Malova

Accepted Solutions (0)

Answers (7)

Answers (7)

0 Kudos

Dear Loga !

I founded out relevant entity name - MARDSTOR.

Thank a lot for your help.

Best regards.

Natalia

0 Kudos

Dear, Loga!

Thanks for your help, I checked all of entity MM model. I found entity LGORT, but it doesn't contain any attributes.

Can I extend this entity or , may be, I can extend entity MATERIALS ?

Best regards.

loga201
Contributor
0 Kudos

Hi,

Enter relevant entity name in the field name instead of attribute name igort..For an example i_fieldname = 'MARASALES'...It_data will return a table/struct of value from that you can get igort...Check igort is part of which entity,I can't remember...

Thank you

0 Kudos

Dear, Loga!

could you explain in more detail "how-to" use this method pls.... When I try to use it I've got error due to call of the method. I could not understand why... at the below you can find part of my code. I can't go to the code of the method READ_CHAR_VALUE using "F5" in the debuger - I have error at this time!

* Get read-only access to USMD model data
CALL METHOD cl_usmd_model_ext=>get_instance
EXPORTING
i_usmd_model = if_mdg_bs_mat_gen_c=>gc_model_mm
IMPORTING
eo_instance = lr_model.
* Read object list of CR and get the one and only material:
* Get the key of the (type 1) entity MATERIAL
* from the object list of this CR
ls_sel-sign = lc_incl.
ls_sel-option = lc_equal.
ls_sel-fieldname = usmd0_cs_fld-crequest.
ls_sel-low = iv_cr_number.
INSERT ls_sel INTO TABLE lt_sel.

>>> the next call of the method is going to the ABAP-dump (

GETWA_NOT_ASSIGNED)

call method lr_model->read_char_value
exporting
i_fieldname = 'LGORT'
it_sel = lt_sel
i_readmode = if_usmd_model_ext=>gc_readmode_default
Importing
et_data = <lt_data>.
Et_message = lt_message.

Regards, Natalia

loga201
Contributor
0 Kudos

call method ir_model->read_char_value

exporting

i_fieldname = 'Entity name'

it_sel = lt_sel

i_readmode = if_usmd_model_ext=>gc_readmode_default

Importing

et_data = <lt_data>

Et_message = lt_message.

0 Kudos

Hi,

Thanks for your help . After analyze code of method READ MATERIAL I understand,that enhance the code to retrieve the lgort values is impossible.

ls_sel-sign = lc_incl.
ls_sel-option = lc_equal.
ls_sel-fieldname = usmd0_cs_fld-crequest.
ls_sel-low = iv_cr_number.INSERT ls_sel INTO TABLE lt_sel.

CALL METHOD lr_model->read_char_valueEXPORTING
i_fieldname = usmd0_cs_fld-crequest
it_sel = lt_sel
if_use_edtn_slice = abap_falseIMPORTING
et_data = lt_objlist.

lt_objlist doesn’t contain entity LGORT.

Accordingly:

CALL METHOD lr_model->read_char_value

EXPORTING
i_fieldname = if_mdg_bs_mat_gen_c=>gc_fieldname_material
it_sel = lt_sel
i_readmode = if_usmd_model_ext=>gc_readmode_default
if_use_edtn_slice = abap_falseIMPORTING
et_data = <lt_data>.

There is no gc_fieldname_lgort.

There are entity type LGORT in tr.MDGIMG

Can you give me advance to solve this problem ?

Best regards.
loga201
Contributor
0 Kudos

Hi,

There is no difference. Instead of reading material read storage location data.create new method or change the read_material method and just change entity field name to storage in the method calling.

Thank you