cancel
Showing results for 
Search instead for 
Did you mean: 

Execution of BAPI

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

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

Thanks in Advance.

Regards,

Subashini.