on 10-27-2011 8:28 PM
I had 2 buttons in my input screen of the WebDynpro, for both buttons some piece of logic is common. So i wrote that common logic in the default method 'WDDOBEFOREACTION', which will be triggered always before the corresponding methods got triggered.
Now my problem is the method 'WDDOBEFOREACTION' triggering even when user hits ENTER in the input screen, to prevent the common logic not to execute need to write some condition based on the user action. But unfortunately was not able to find the way. Could any one suggest me on this.
For your specific requirement :
you should first determine the current action which triggered this WDDOBEFOREACTION method,
as this method triggers for every action performed on the webdynpro view.
For that below is the code
DATA lo_api_view_controller TYPE REF TO if_wd_view_controller.
DATA lo_action TYPE REF TO if_wd_action.
lo_api_view_controller = wd_this->wd_get_api( ).
lo_action = lo_api_view_controller->get_current_action( ).
IF lo_action IS NOT BOUND.
IF lo_action->name EQ 'BUTTON1' OR lo_action->name EQ 'BUTTON2'.
Where BUTTON1 and BUTTON2 are the actions associated with both the buttons.
Write your common logic here and now it would get executed only for both these button cliks only
ENDIF.
ENDIF.
Edited by: Avasarala Sampath on Oct 28, 2011 7:26 AM
Edited by: Avasarala Sampath on Oct 28, 2011 7:29 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are no OK Codes or Function Codes in WDA. The event handling is all OO based. If you have shared logic between two event handlers, you should create a separate method for this logic and call it from both button event handlers. Of if the two events are very similiar you can tie both buttons to the same event handler action/method.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can't you check the OK code in that method and only execute the common logic for the OK codes you want?
Rob
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.