on 10-30-2009 10:08 AM
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?
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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.