cancel
Showing results for 
Search instead for 
Did you mean: 

Report_attribute_error_message

Former Member
0 Kudos

Hi


i can use Report_attribute_error_message but Didnt call this method.


DATA lo_nd_emp_group_travel TYPE REF TO if_wd_context_node.
 
DATA lo_el_emp_group_travel TYPE REF TO if_wd_context_element.
 
data lo_api_controller     type ref to if_wd_controller.
 
data lo_message_manager    type ref to if_wd_message_manager.

 
DATA: it_emp_gt1 TYPE TABLE OF YTMS_GT_EMP_DETA,
        wa_emp_gt1
TYPE YTMS_GT_EMP_DETA.

 
DATA: it_emp_gt2 TYPE TABLE OF YTMS_GT_EMP_DETA,
        wa_emp_gt2
TYPE YTMS_GT_EMP_DETA.

 
DATA lv_value TYPE string.

    lo_api_controller ?= wd_This->Wd_Get_Api( ).

  it_emp_gt1 = lt_emp_group_travel.
   
SORT it_emp_gt1 by emp_id.
  it_emp_gt2 = it_emp_gt1.


  
LOOP AT it_emp_gt1 INTO wa_emp_gt1.
    lv_value = sy-tabix.
    lv_value = lv_value +
1.
   
READ TABLE it_emp_gt2 INTO wa_emp_gt2 INDEX lv_value.
   
if sy-subrc = 0.

     
if wa_emp_gt1-emp_id = wa_emp_gt2-emp_id.
*
       
CALL METHOD lo_api_controller->GET_MESSAGE_MANAGER
          RECEIVING
            MESSAGE_MANAGER = lo_message_manager
            .

*         report message
    CALL METHOD lo_message_manager->report_attribute_error_message
         
EXPORTING
            message_text   =
'Duplicate entries are not allowed'
            element        = lo_el_emp_group_travel
            attribute_name =
'EMP_ID'.


     
CLEAR : wa_emp_gt2,wa_emp_gt1.

       
ENDIF.


     
endif.
   
ENDLOOP.

Accepted Solutions (0)

Answers (1)

Answers (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi,

Whats the issue you are facing here ? could you please elaborate.

Regards,

Rama

Former Member
0 Kudos

Hi

Rama,

Thanks for u r  Replay.

My issue was solved.