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

How to execute automatically

hi

i want to execute bapi first time when first time view displays

so please let me know how to execute the BAPI when first view executes.

regards

mmukesh

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 Mar 05, 2007 at 01:50 PM

    Hi Mukesh,

    you must simply put the executeBAPI method into the wdDoInit() method of your Component controller.

    Regards,

    Gianluca Barile

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 05, 2007 at 02:13 PM

    Hi,

    Yes u need to write the execute method in the init method of the Customcontroller or View.

    import the model and context mapping from the contextcontroller to view controller

    and design ur view and add the following code.

    BAPI_input input = new BAPI_input();

    wdContext.nodeBAPI_inputElement().bind(input);

    //pass the input for the BAPI.

    input.set<params1>();

    input.set<params2>();

    try{

    wdContex.currentBAPI_inputElement().modelObject().execute();

    wdContext.nodeOutput().Invalidate();

    }catch(Exception e)

    {

    }

    It migh helps u .

    Thanks,

    Lohi.

    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.