cancel
Showing results for 
Search instead for 
Did you mean: 

how to call custom button events

Former Member
0 Kudos

Hi experts,

I am creating component.This component have three buttons in main view.1.create  2.change 3.save

In save method how to get create event ID  and change event ID .please help me in this issue.

Thanks&Regards

ananth

Accepted Solutions (1)

Accepted Solutions (1)

harsha_jalakam
Active Contributor
0 Kudos

Hi Ananth,

Please find the following snippet for fetching the event ID.

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->name EQ '   '.               "lo_action->name gives the action name

ENDIF.

Regards,

Harsha

Former Member
0 Kudos

Hi Harsha,

I tried your code,but i am getting this error:ERROR: Method IF_WD_VIEW_CONTROLLER~GET_CURRENT_ACTION can only be called by WDDOBEFOREACTION (termination: RABAX_STATE).If you have any idea please help me out.

Thanks&Regards,

ananth

ramakrishnappa
Active Contributor
0 Kudos

Hi Anantha,

You have write your code in method WDDOBEFOREACTION( ) method of your view.

Regards,

Rama

harsha_jalakam
Active Contributor
0 Kudos

Hi Anantha,

Please check with the following code,if it works.

DATA : lv_event_id type string.

CALL METHOD wdevent->get_string EXPORTING name  = 'ID'

     RECEIVING

       value = lv_event_id.

Or you can add an importing parameter to the method in the component controller. Whenever you are calling that method from the event handler, pass this parameter with an ID so that it can be distinguished with the others.

Regards,

Harsha



Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

I got reqired solution.Thanks to all for your helpful information.

Thanks&Regards,

ananth

ramakrishnappa
Active Contributor
0 Kudos

Hi Anantha,

If your issue is resolved, please close this by marking suitable replies as helpful / correct answer.

Regards,

Rama