Skip to Content
avatar image
Former Member

Execution of BAPI

Hi All,

I am using dynpage technology to create a portal application.

My requirement is, I need to have a confirmation window with OK & CANCEL. button on it. I have created it using javascript.

If ok is clicked, the bapi should be executed. How to do this?

stringBuffer strBuf = new stringBuffer();

strBuf.append("winopen = confirm("\do you want to continue?"\));

The above code opens a confirm window, with message 'do you want to continue?'. If you click ok, this window will return true value and it is assigned to winopen variable in the above code. if this window returns true, we can execute the bapi.

Now how to call the bapi execution code inside java script or Is there any other way wherein we can use this winopen variable which holds true value outside the javascript, so that we can execute the bapi?

Please suggest. Hope I am clear.

Thanks in Advance.

Regards,

Subashini.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Nov 29, 2008 at 08:56 PM

    Hi Subashini,

    Better not try an use javascript while using WebDynpro. You never know what SAP will allow in future versions, it may or may not work.

    Try the following.

    Create 2 eventhandlers in your view (under methods).

    • onActionOk

    • onActionCancel

    And where you want to open a confirmation dialog:

    -


    IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager()

    .createConfirmationWindow("Are you sure? ",controllerInfo.findInEventHandlers("onActionOk"),"yes");

    dialog.addChoice(controllerInfo.findInEventHandlers("onActionCancel"), "no");

    dialog.show();

    -


    Now in the eventhandlers you can program you BAPI call.

    Jeschael

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      This is not a webdynpro application. This is a dynpage application(PAR file). Pls suggest something.

      Thanks in Advance.

      Regards,

      Subashini.