Skip to Content
0
Nov 14, 2013 at 03:22 AM

Can i call action_A from action_B of same view by exporting WDEVENT_of_A?

16 Views

Hello

I put a button on my_view of my_wdc, its associated action is my_action_of_button_clicked_hence_open_popup.

In this my_action_of_button_clicked_hence_open_popup am calling a popup (say, my_popup_for_user_input_and_text_view) by using code

wd_this->w_window = lo_window_manager->create_window.

Say, my_popup_for_user_input_and_text_view has 2 input field FIRST NAME and LAST NAME

On my_popup_for_user_input_and_text_view i have assigned an action to standard SAP's OK button, say, its name is my_action_on_popup_on_OK_button_for_z_tbl_update

As we know all these 2 actions are part of my_view

Now, i need to handle the errors, say, for example, user entered FIRST NAME but forgot to enter LAST NAME and clicked the OK button, immediately my_popup_for_user_input_and_text_view will be closed

I want to show the error message on my_popup_for_user_input_and_text_view itself, so, what i did is,

1) i saved the WDEVENT of my_action_of_button_clicked_hence_open_popup. as view's attribute

2) am capturing the user's fault in my_action_on_popup_on_OK_button_for_z_tbl_update

3) if LAST NAME is missing then, am re-opening / re-launching the my_popup_for_user_input_and_text_view by calling the

my_action_of_button_clicked_hence_open_popup action-method by passing saved attribute WDEVENT in the beginning

Pls. let me know is my approach is safe?

Any better approach?

Thank you