Skip to Content
0

USMD_SSW_RULE_CONTEXT_PREPARE

Jan 17, 2017 at 10:21 AM

210

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

7 Answers

Loga Nathan Duraisamy Jan 18, 2017 at 04:17 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Natalia Malova Jan 26, 2017 at 09:05 AM
0

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.
Share
10 |10000 characters needed characters left characters exceeded
Loga Nathan Duraisamy Jan 26, 2017 at 12:44 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Natalia Malova Jan 30, 2017 at 12:46 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Loga Nathan Duraisamy Jan 30, 2017 at 10:04 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Natalia Malova Mar 03, 2017 at 11:35 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Natalia Malova Apr 05, 2017 at 12:44 PM
0

Dear Loga !

I founded out relevant entity name - MARDSTOR.

Thank a lot for your help.

Best regards.

Natalia

Share
10 |10000 characters needed characters left characters exceeded