cancel
Showing results for 
Search instead for 
Did you mean: 

How to give Hyper Link to Custom Message in sap MDG

Hi Experts,

I have a requirement to give hyper link (directly go to that mandatory attributes to fill) to Custom error message in sap MDG UI (Customer and Vendor Governance) , when we click on check button or press enter. As of now it's working for SAP Standard Messages in SAP MDG.

Please help to resolve this requirement.

Thanks

Sachin Kapoor

Accepted Solutions (0)

Answers (4)

Answers (4)

0 Kudos

Hello, i did exactly how its explained here but my error messages still doesn't have navigation link, they appear as plain text. I have created function module like below, i get row number thru function but error messages appear as plain text as i said before. I tried another method to accomplish same thing it does create link but doesnt navigate (code below FM )

FUNCTION zmdg_get_highlight_row.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(IM_O_MODEL) TYPE REF TO  IF_USMD_MODEL_EXT
*"     REFERENCE(IM_ST_DATA) TYPE  ANY
*"     REFERENCE(IM_V_ENTITY) TYPE  USMD_ENTITY
*"     REFERENCE(IM_V_FIELDNAME) TYPE  USMD_FLD_SOURCE
*"  EXPORTING
*"     REFERENCE(EX_V_ROW) TYPE  MDG_MESSAGE_ROW
*"----------------------------------------------------------------------


  DATA:
    lr_key         TYPE REF TO data,
    lr_strucdesc   TYPE REF TO cl_abap_structdescr,
    li_components  TYPE abap_component_tab,
    lst_components TYPE LINE OF abap_component_tab,
    l_fieldname    TYPE usmd_fieldname.

  FIELD-SYMBOLS:
    <lfs_st_key>   TYPE any,
    <lfs_v_source> TYPE any,
    <lfs_v_dest>   TYPE any.

  l_fieldname = im_v_entity.
  im_o_model->create_data_reference(
  EXPORTING
  i_fieldname = l_fieldname
  i_struct    = if_usmd_model_ext=>gc_struct_key
  if_table    = abap_false
  IMPORTING
  er_data     = lr_key
  ).

  ASSIGN lr_key->* TO <lfs_st_key>.

  IF sy-subrc IS NOT INITIAL.
    RETURN.
  ENDIF.

  lr_strucdesc ?= cl_abap_structdescr=>describe_by_data( p_data = <lfs_st_key> ).
  li_components = lr_strucdesc->get_components( ).

  LOOP AT li_components INTO lst_components.
    ASSIGN COMPONENT lst_components-name OF STRUCTURE <lfs_st_key> TO <lfs_v_dest>.
    IF sy-subrc IS NOT INITIAL.
      RETURN.
    ENDIF.
    ASSIGN COMPONENT lst_components-name OF STRUCTURE im_st_data TO <lfs_v_source>.
    IF sy-subrc IS NOT INITIAL.
      RETURN.
    ENDIF.
    <lfs_v_dest> = <lfs_v_source>.
  ENDLOOP.

  ex_v_row = cl_mdg_bs_key_row_map_service=>set_key(
  is_key       = lr_key
  iv_entity    = im_v_entity
  iv_fieldname = im_v_fieldname
  ).


ENDFUNCTION.

   

   DATA: lo_fpm    TYPE REF TO cl_fpm,
            mo_message_manager TYPE REF TO if_fpm_message_manager.
      lo_fpm ?= cl_fpm_factory=>get_instance( ).
      mo_message_manager = lo_fpm->mo_message_manager.
      call method mo_message_manager->report_t100_message
        EXPORTING
          iv_msgid                     = 'ZMM'    
          iv_msgno                     = '000'    
          iv_parameter_1               = 'Clickable error message test' 
          iv_attribute_name            = 'SPART' 
          is_enable_message_navigation = 'X'.
0 Kudos

Hi All,

I am able to give hyper link for custom messages through BADI - USMD_RULE_SERVICE ( Method Name - CHECK_ENTITY).

1 - We have ET_MESSAGE type USMD_T_MESSAGE, In the error table we have attribute(ROW), so we have to fill Row also for the same. And How to fill Row is :-

lv_row = cl_mdg_bs_key_row_map_service=>set_key( is_key = lr_key

iv_entity = lv_entity_tr "'AD_POSTAL'

iv_fieldname = 'RFE_POSTL' ).

l_message-row = lv_row.

2 - How to populate lr_key is :- using create_data_reference and once u populate lr_key with primary key attribute then fill the attribute with the values.

example:- In my case as Entity is 'AD_POSTL', so lr_key will have structure-attribute

a - Addrno , b - Bp_header, c- ad_nation. accordingly fill value in both the attributes.

3 - This code will run on the base entity_type i.e

I_ENTITYTYPE = Entity Name

Thanks

Sachin Kapoor

former_member230136
Contributor
0 Kudos

Very Nice piece of Info Sachin

I am filling the ROW but only raising the USMD message with ROW.

Thanks I will use it with your technique to raise the Error Message.

-Rohit

Former Member
0 Kudos

Hello Sachin,

Even I am facing similar issue. Can you please elaborate the steps for creating lr_key.

Thanks,

Hardik

0 Kudos

Dear Hardik,

Please see step number 2 for your query.

I am able to give hyper link for custom messages through BADI - USMD_RULE_SERVICE ( Method Name - CHECK_ENTITY).

1 - We have ET_MESSAGE type USMD_T_MESSAGE, In the error table we have attribute(ROW), so we have to fill Row also for the same. And How to fill Row is :-

lv_row = cl_mdg_bs_key_row_map_service=>set_key( is_key = lr_key

iv_entity = lv_entity_tr "'AD_POSTAL'

iv_fieldname = 'RFE_POSTL' ).

l_message-row = lv_row.

2 - How to populate lr_key is :- using create_data_reference and once u populate lr_key with primary key attribute then fill the attribute with the values.

example:- In my case as Entity is 'AD_POSTL', so lr_key will have structure-attribute

a - Addrno , b - Bp_header, c- ad_nation. accordingly fill value in both the attributes.

3 - This code will run on the base entity_type i.e

I_ENTITYTYPE = Entity Name

Thanks

Sachin Kapoor

h_h_ak
Participant
0 Kudos

Hey Sachin,

you have to redefine Feeder class method.At the moment it is almost impossible do it via BRF+ or within the BADI. This functionality needs webdynpro instances.Fastest way should be within the Feeder class...

BR,

Hasan

0 Kudos

Dear hasan,

In Feeder class (Error internal table FPMGB_T_MESSAGES-REF_NAME, we can pass Attribute name and we can get hyperlink- This is I know), But this should not be recommended , because Feeder Class gets executed every times once you do anything on UI, and more over we can not restrict code of Feeder class on the base of Entity. and also I have 50 Custom Error messages to be displayed on screen.

So Please let me know if you have any other solution.

Thanks

Sachin Kapoor

former_member230136
Contributor
0 Kudos

Hi Sachin,

I am not sure whether this feature is supported by Standard Framework ( For Vendor & Customer ). As it's a BOL framework whether you provide the Error Messages through BRF+ or you provide in the BADI.

Also if you provide Mandatory fields at Data Model level, still the hyperlink is not coming.

This is what I believe & the reason behind is BOL framework.

Till that time, you can convince you client by saying, "Providing hyperlink is not supported & we are still working on 🙂"

If it is possible by any means, I will also be glad.

Regards,

Rohit Singh

0 Kudos

Dear Rohit,

We have raised this issue to SAP and waiting their reply.

Thanks

Sachin Kapoor