on 04-13-2009 2:31 AM
Dear Experts,
Please advise on standard alv standard function buttons and how to call methods in the view to check out the parameters and put our own code for validation.
Could you please advise on this.
Your time and help much appreciated.
Many thanks in advance.
Best Regards
Chandra
Dear Vivekananthan,
Thanks for the info directed me which demonstrates the custom buttons.
But my question is I wanted to use the standard alv function "check, append and insert button" which will appear in ALV. I need to intercept these in my view and put the custom code. For eg when I click 'append 'button I want to update the table, like wise check button I wanted to validate the data therefore I need to get the parameters to get to know what button is clicked. Please advise.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi chandra,
Refer this Doc:
Regards
Vivekananthan.s
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Vivekananthan,
As per your doco I have created the custom button and it looks good in ALV Then I created a new method
called on_search and put the following code.
DATA: temp TYPE string.
temp = r_param->id.
IF temp = 'LBUTTON'.
wd_comp_controller->fill_sflights( ).
It is coming out as syntax error that r_param IS NOT DEFINED.
Could you please explain in steps how to do this bit.
"Specify event, ON_FUNCTION of the interface controller of ALV for the event handler method"
Your time and help is much appreicated.
Many thanks.
Cheers
Chandra
Hi,
I think the Button Id that you are passing against r_param->id is wrong.
Please check the below code -
Create custom button -
DATA:
lr_btnui_save type REF TO CL_SALV_WD_FE_BUTTON,
lr_function_save TYPE REF TO CL_SALV_WD_FUNCTION.
CREATE OBJECT lr_btnui_save.
lr_btnui__save->SET_TEXT( 'SAVE' ).
lr_function_save =
lr_model->IF_SALV_WD_FUNCTION_SETTINGS~create_function( id = 'BTN_SAVE' ).
lr_function_save->SET_EDITOR( lr_btnui_save ).
in the On_function of that specific ALV -
DATA:
lv_temp TYPE string. "Holds the button id
lv_temp = r_param->id.
IF lv_temp EQ 'BTN_SAVE'.
wd_this->save_data( ).
endif.
Please check ST22 for more detailed error analysis.
Regards,
Lekha.
Hi Chandra,
I hope you have used the below code:
DATA : lr_table_settings TYPE REF TO if_salv_wd_table_settings.
lr_table_settings ?= l_value.
lr_table_settings->set_read_only( abap_false )
when you use this code you will get 4 standard buttons on alv tool bar....
Insert, append, delete...
whenever you want to write your custom code in these specefic buttons then you need to create a method with using function selection(not remeber exactly), but you need to select one of ALV functions there..use F4 on the right side of your new method creation.
inside you will be able to write your custom code....for insert,append,deletion.
let me know if you are not cleared,...I will send you sample code for you.
thanks,
Naresh.
Hi Naresh & others
Many thanks for your kind help so far. Let me clear what i wanted to know.
I followed the below link for creating a custom button in ALV tool bar which looks great.
But I am missing the last bit of the exercise that is "Capturing Events triggered by Toolbar elements"
That I DO NOT know HOW TO "Specify event, ON_FUNCTION of the interface controller of ALV for the event handler method. The importing parameter r_param of the method contains unique ID of the function for which the toolbar element is assigned."
Please shed light on this one with steps to follow:
Your time and help much appreciated.
Warm Regards
Chandra
Hi Chandra,
In the view, Methods tab, You give an entry as
(name) (type) ( Desc) Name
ONACTIONSAVE EVENTHANDLER Action for Save ON_FUNCTION(click f4 and choose the
ON function of your ALV) . This is the way you define the event for the ALV. Save it. Now double click on this method then you can see r_param as the importing parameter.
If you have names your ALV as ALV then on F4 help select ON_FUNCTION row for this ALV.
If you have used other ALV component usages then that list will also be seen in the F4.
If you dont see any F4 help entries as specified above then first have this ALV as a component use in the view's properties tab.
Regards,
Lekha.
Hi,
To have our own functionality, then we have use custom buttons not the Standard buttons of the ALV.
Regards,
Lekha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.