cancel
Showing results for 
Search instead for 
Did you mean: 

Need assistance with wd_create_action

Former Member
0 Kudos

Hello Friends ,

I am currently involved with dynamic programming and would like to know more about the wd_create_action method . I looked for documentation and discussion , but could not get anything concrete on the way to use it .

Basically I need to know , can we create ACTION  and its corresponding ACTION HANDLER method dynamically through code placed in WDOINIT of the view controller. I am aware of declaring the ACTION and handler method statically , but need to know how can we do it using code.

thanks

S

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

While creating button we assign ACTION to the button ..but the
pre-requisite is that the action(TEST_ACTION) should already be there in
created mode.

Ex Code:-


   


DATA lr_button TYPE REF TO cl_wd_button.


CALL METHOD cl_wd_button=>new_button

  EXPORTING

  enabled = 'X'

  id = 'B1'

  on_action = 'TEST_ACTION'

  text = 'My Dynamic Button'

  RECEIVING

  control = lr_button.

Create an action by name TEST_ACTION under the "Actions" tab of your component. You would then get the corresponding eventhandler ONACTIONTEST_ACTION. Write your desired coding in there and it should be fine.Hope this helps you.

Br,

KH

Gowtham
Contributor
0 Kudos

Hi Shilpa,

Kindly refer the following link :

http://scn.sap.com/message/5030313#5030313

wd_create_action | SCN

- Gowtham

Former Member
0 Kudos

Hello Gowtham ,

thanks for the links, But they do not say anything about the usage of the wd_CREATE_action in specific.

I was searching for atleast any DEMP examples on SAP , but could not find .

Any help in this regard will greatly help.

regards

S