cancel
Showing results for 
Search instead for 
Did you mean: 

Field highlighting with error message in SAP MDG-M 8.0

Former Member
0 Kudos

Hi Experts,

We are implementing SAP MDG 8.0 for material. Now, for custom error messages we are using BADI usmd_rule_service ( single entity BADI) , method IF_EX_USMD_RULE_SERVICE~CHECK_ENTITY.

Now, in the code we append the changing parameter ET_MESSAGE table with custom messages. The messages comes all right in the screen as hard stop, that is ok. But it does not highlight the concerned field with red as it happens for standard messages.

The code I am using is as below :

ls_message-fieldname = 'MATKL'.
ls_message-msgid = 'ZMDGM'.
ls_message-msgno = '008'.
ls_message-msgty = 'E'.
APPEND ls_message TO et_message.

Any idea how it can be done?

Many thanks,

Saikat

Accepted Solutions (0)

Answers (4)

Answers (4)

prabhat_singh6
Explorer
0 Kudos

Hi,

You need pass the row number as well.

Use the below code to generate the row number :


DATA: zlv_fieldname TYPE usmd_fieldname,
zlr_data TYPE REF TO data.

FIELD-SYMBOLS: <zls_key> TYPE any.

zlv_fieldname = id_entitytype.
IF zlv_fieldname IS NOT INITIAL.
CALL METHOD io_model->create_data_reference
EXPORTING
i_fieldname = zlv_fieldname
if_table = ''
IMPORTING
er_data = zlr_data.
IF zlr_data IS NOT INITIAL.
ASSIGN zlr_data->* TO <zls_key>.
IF <zls_key> IS ASSIGNED.
MOVE-CORRESPONDING is_data TO <zls_key>.
CALL METHOD cl_mdg_bs_key_row_map_service=>set_key
EXPORTING
is_key = zlr_data
iv_entity = id_entitytype
iv_fieldname = id_attribute
RECEIVING
rv_row = ev_row.
UNASSIGN <zls_key>.
ENDIF.
ENDIF.
ENDIF.

Plass this row number in et_messages.

0 Kudos

Dear All,

I have achieved this by giving hyperlink in custom message.

Follow below link.

https://answers.sap.com/questions/147935/how-to-give-hyper-link-to-custom-message-in-sap-md.html?chi...

Thanks

Sachin Kapoor

former_member187651
Active Participant
0 Kudos

Hi Saikat,

I am also facing the issue while trying to make the message as link to the field in material. Can you please share the answer, how you achieved this ?

Thanks

Chandan

bpawanchand
Active Contributor
0 Kudos

Hi ,

This can be achieved probably by populating the entity services message table. I am not sure how you implemented the validation process. However, by looking at the provided validation implementation it should be clear that the entity services class have a Message reference where you need to update the attribute details. For instance, look the below code excerpt where the attribute detiails are updated with the message class.

dr_entity_services->dr_message->add_message_to_table(
 EXPORTING
* iv_tabstrip =
 iv_attribute = if_usmdz_cons_attributes=>gc_attr_accgrpacc
* iv_msgid =
 iv_msgno = '019'
* iv_msgv3 =
* iv_msgv3_attribute =
* iv_msgv4 =
* iv_msgv4_attribute =
 CHANGING
 ct_message = lt_message ).

Thanks,Pavan

Former Member
0 Kudos

Hi Pavan,

Thanks for the quick reply. i have implemenetd the code but there seems to a customising which is required. When I click on check I am getting the message as 'No message type defined for message "017(ZMDGM)" in Customizing.

Can you kindly share where do I need to maintain this setting..I guess its somewhere in MDGIMG?

Thanks,

Saikat