on 06-28-2007 1:47 PM
hi experts ..
I want to add a row in the alv when i click on add button..
I know there is insert row and append row buttons available in alv but i dont want those names ..
Can i change the name of standard buttons or is there sm class that i can use to develop this functionality.
jagruti.
Hi Jagruti,
You just have to add a new button with whatever name you want, and map it to the existing functionality in ALV. It will work and you dont need to do anything else.
The code will be:
data:
lr_button type ref to cl_salv_wd_fe_button,
lr_function type ref to cl_salv_wd_function.
CREATE OBJECT lr_button.
lr_button->set_text( 'Your text' ).
lr_button->set_tooltip( 'Your tooltip' ).
lr_function = l_alv_model->if_salv_wd_function_settings~create_function( id = 'INSERT' ).
<b>lr_function->set_function_std( IF_SALV_WD_C_STD_FUNCTIONS=>EDIT_APPEND_ROW ).</b>
lr_function->set_editor( lr_button ).
The method set_function_std sets your funcion to take the behaviour of the standard ALV function for inserting rows. So it would work automatically. You have only changed the text.
<b>If your problem is solved, please award points and close the threads. Couple of your previous threads are still open, please close them</b>
Regards,
Nithya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jagruti,
Include the following code before inserting the new function.
data: lt_std_func TYPE salv_wd_t_function_std_ref,
ls_std_func TYPE salv_wd_s_function_std_ref.
lt_std_func = l_alv_model->if_salv_wd_function_settings~get_functions_std( ).
LOOP AT lt_std_func INTO ls_std_func.
ls_std_func-r_function->set_visible( if_wdl_core=>visibility_none ).
ENDLOOP.
We have set ALL the standard functions here as not visible. If you want to set only a particular function as invisible, say only the insert row, then get_function_std by passing the ID of the function and set that only as invisible. Do this depending on your requirement.
<b>Please award points and close the thread.</b>
Regards,
Nithya
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.