Skip to Content
author's profile photo Former Member
Former Member

Need assistance with wd_create_action

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 06, 2015 at 05:13 AM

    Hi Shilpa,

    Kindly refer the following link :

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

    wd_create_action | SCN

    - Gowtham

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2015 at 06:36 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.