on 01-07-2009 3:45 PM
Dear Experts,
i use an ALV and i now have a Problem.
In my ALV the user can insert lines, change them oder delete them.
i wrote a method for every action and they work well.
The Problem i have is that every time he does something the method data_check is called.
How can i find out the difference between the actions so i can coll the correct method
or exclude some actions ?
for example: If the User inserts a new empty line in the ALV it should do nothing exept the insert.
I dont know how to differentiate.
please help.
Thanks and best regeards
René
Hi Rene,
If you go to your WDDOBEFOREACTION method you would be already seeing the necessary coding in there like:
data lo_api_controller type ref to if_wd_view_controller.
data lo_action type ref to if_wd_action.
lo_api_controller = wd_this->wd_get_api( ).
lo_action = lo_api_controller->get_current_action( ).
if lo_action is bound.
case lo_action->name.
when '...'.
endcase.
endif.
You would just have to substitute your action id's in the when clause to handle the various possible actions. Check the example below:
METHOD wddobeforeaction .
DATA lo_api_controller TYPE REF TO if_wd_view_controller.
DATA lo_action TYPE REF TO if_wd_action.
lo_api_controller = wd_this->wd_get_api( ).
lo_action = lo_api_controller->get_current_action( ).
IF lo_action IS BOUND.
CASE lo_action->name.
WHEN 'ACTION1'.
" report dummy message that action 1 was performed
CALL METHOD wd_this->lo_message_manager->report_success
EXPORTING
message_text = 'Button Action 1 was clicked!'.
WHEN 'ACTION2'.
" report dummy message that action 2 was performed
CALL METHOD wd_this->lo_message_manager->report_success
EXPORTING
message_text = 'Button Action 2 was clicked!'.
ENDCASE.
ENDIF.
ENDMETHOD.
Regards,
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rene,
The method ON_DATA_CHECK will be called every time when you try to change any data present in the ALV.
This is the method which handles or checks the change of data in ALV.
For all the buttons like INSERT, DELETE, MODIFY, canbe written in a single method, which is registered by an event ON_FUNCTION.
Get the function code of each button, and handle it accordingly.
You can get the event triggered from the WD_EVENT reference, which has the method GET_NAME.
Hope it clears your question.
Regards,
Shashikanth. D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
23 | |
11 | |
9 | |
8 | |
5 | |
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.