on 05-31-2012 3:41 PM
Dear Experts
I have the following requeriment.
In the application FITE_EXPENSES if the employee not select a row, when the user press the button "Lanzar" the system display a message of type Error and not allow continue.
http://www.freeimagehosting.net/newuploads/gul2y.jpg
How can solve this requirement?
Thanks in advance
Regards
Hi,
As per my understanding from the image you have posted you are just using the TABLE UI element and not ALV. You can achieve your requirement in this way.
On the action of the button "LANZAR " you can read the node from the context you used for the table binding ( make sure that the node used for the table has the Lead Selection unchecked) then after reading the node just check if the context element is filled , it would be filled only if there is a row selected in the table. If not the context element would return initial then in that condition you can write a message that would be displayed to the user.
Below is the code to handle:
DATA lo_nd_tab TYPE REF TO if_wd_context_node.
DATA lo_el_tab TYPE REF TO if_wd_context_element.
DATA ls_tab TYPE wd_this->element_tab.
lo_nd_tab = wd_context->get_child_node( name = wd_this->wdctx_tab ).
lo_el_tab = lo_nd_tab->get_element( ).
IF lo_el_tab IS INITIAL.
** Message to be displayed to the user
EXIT.
ENDIF.
This is the way you can handle your requirement.
Thanks
Phani Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
would you like this solution?
Just call action of "lanzar" in the onSelect or onLeadSelect event of the table. Thus when selecting a row action of "lanzar" will be called. This is a one-click usage unlike selecting row and clicking lanzar (two clicks).
With this solution you have just one click for lanzar-action and no need for an error message (you could also remove button lanzar).
Regards
ismail
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this:
method ONACTIONLANZAR .
DATA lo_nd_XXX TYPE REF TO if_wd_context_node.
DATA lt_table TYPE wd_this->Elements_table.
lo_nd_XXX = wd_context->path_get_node( path = `yourpath to your node the table is bound to` ).
data lt_selected_elements type WDR_CONTEXT_ELEMENT_SET.
lt_selected_elements = lo_nd_xxx->GET_SELECTED_ELEMENTS( ).
if lt_selected_elements is not initial.
"execute Lanzar
else.
"Message Please select a row
endif.
endmethod ONACTIONLANZAR.
regards
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
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.