cancel
Showing results for 
Search instead for 
Did you mean: 

Row highlighted in red

Former Member
0 Kudos

Hi all,

I have my table with many rows. When I click on the Save Button, I make a check if the data are correct and when I find an error (for exemple when a data is required)I would to show my table with the row containing the wrong data that is highlighted. How can do for to realize it?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I have used this method:

  • CALL METHOD LO_MESSAGE_MANAGER->REPORT_ATTRIBUTE_ERROR_MESSAGE

  • EXPORTING

  • MESSAGE_TEXT = errore

  • ELEMENT = element

  • ATTRIBUTE_NAME = 'TABLE_S'

  • RECEIVING

  • MESSAGE_ID = errore_01.

but I don't have highlighted the row with I have wrong data, I displayed only the error message in top of view...

Former Member
0 Kudos

Hi,

REPORT_ATTRIBUTE will highlight only the cell

REPORT_ELEMENT will highlight the entire row.

Is the attribute for which this error is shwon is inside the visible area ie do yuo need to scroll to reach that cell/column..

Regards,

Lekha.

Former Member
0 Kudos

Tks! In effect the row now is highlighted, but I have this problem: when I have a selection of row and I click on save, I processing only this selection, but when I use the REPORT_ATTRIBUTE_ERROR_MESSAGE or the REPORT_ELEMENT_ERROR_MESSAGE, the row highlighted isn't right. For exemple: I have the table with 4 rows and I selected only the last two rows, and the wrong data is on the first of this selection. When I use REPORT_ATTRIBUTE_ERROR_MESSAGE I have highlighted the first row of the table (and not of the selection).Maybe I use the wrong sy-index for my element table, but what method can I use for to have the correct index?

Former Member
0 Kudos

Hi,

Correct me if I have understtod your testcase wrong..

Out of 4 rows, 2 are selected and SAVE is clicked, You have error in teh 1st record of selection right..and the error to be shown for this record...Is that right..

In this case...You need to use GET_SELECTED(lt_select) of if_wd_context_node as you will get the selected elements and

loop through them and throw the errors....

Donot use the index of the table and show the errors...

Rater use GET_ELEMENTS of if_wd_context_node in SAVE button handler....

if lt_select is not initial.

loop at lt_select into ls_elements.
ls_elements->get_static_attributes
importing
static_attributes = ls_table.

if ls_table-pernr is initial.
* use report attribute or report element....
elseif ls_table-ename is initial.
endif.
endloop.

else.

loop at lt_elements into ls_elements.
ls_elements->get_static_attributes
importing
static_attributes = ls_table.

if ls_table-pernr is initial.
* use report attribute or report element....
elseif ls_table-ename is initial.
endif.
endloop.

endif.

In this case there is no need to use the index....Now the above code works for both the selection and unselected ones....

as it is common...

Regards,

Lekha.

Former Member
0 Kudos

TKS SOLVED!

Former Member
0 Kudos

To have a RED Color Box :

if you want to change the color after an error , you can use the method for the message manager:

If error message in T100 :

lo_message_manager->report_attribute_t100_message

Else :

lo_message_manager->report_attribute_error_message