on 04-12-2007 8:49 AM
When i click on the Append row (standard) button of the ALV grid, i want that the newly added row should hold some default value which is based on the preceding row (of course the first row will be an exception).
Basically each row has two dates - starting and ending dates. Based on the ending date of the previous row, the newly added row should have the the starting date as the next day.
Could anyone tell me which event do i code this in?
regards,
Priyank
Hi Priyank,
To solve your problem, Please don't use the APPEND ROW functionality of the WD ALV. Follow the folloing steps:
<b>Step1:</b> It will add the custom button in an ALV.
<b>Step2:</b> Add the functionality in the View where you embeded the ALV TABLE
i) Create a Event handle method ON_APPL_FUNCTION . This event handle must be referewith the ON_FUNCTION event which is avilable in SALV_WD_TABLE. And write the code in that event handle method
<i><b>CODE</b></i>
<b>Step1: In Component Controller</b>
**Declaration
data:
lr_functions type ref to if_salv_wd_function_settings.
lr_functions ?= wd_this->r_table.
data:
lr_function type ref to cl_salv_wd_function.
data:
lr_button type ref to cl_salv_wd_fe_button,
lr_function = lr_functions->create_function( 'MYBUTTON' ).
create object lr_button.
lr_button->set_text( 'MYBUTTON' ).
lr_function->set_editor( lr_button ).
<b>Step-2: Write this one in View where you emped the ALV Table</b>
method on_appl_function .
data:
lr_node type ref to if_wd_context_node.
lr_node = wd_comp_controller->get_function_elements_node( ).
data:
l_value type string.
case r_param->id.
when 'MYBUTTON''.
write code here ie give your logic like, pick the infromation from the table and add new row to that table
endcase.
Warm Regards,
Vijay.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Priyank,
That is the only solution which you can do for you requirement. If you are using the Standard functionality of Appended row, then you can't control that functionality and you can't modify its behaviour also.
There is no other option for you. I spent lot of time for an alternative throught SAP Notes and Books also. So that is the only possible way...
Best Regards,
Vijay
Hi Priyank
Just check the following link by Thomas Jung
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/webDynproABAP-ALVControllingStandard+Buttons&
Best Regards
Naresh
Message was edited by:
Naresh Kumar Malik
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.