cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a function module in BSP

Former Member
0 Kudos

Hi all,

I want to add a call to an exisitng function module to run once a user exits the BSP page.

Any body has idea on how this is done ?

Uche

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI

I dont know if there is any such event in BSP or HTMLB which will fire on pressing close button of your page...But there is one in HTML...

Use this tag in Page Layout

<body onUnload="unload()">

<script language="JavaScript"><!--

function unload() {

<%

*Place your Function call here......

%>

}

//--></script>

I have not tested but it seems to me that it will definitely work.....

Do reward points if it works...

Cheers:)

Mithlesh

eddy_declercq
Active Contributor
0 Kudos

Hi,

Pls don't forget to reward points and close the question if you find the answers useful.

Eddy

Former Member
0 Kudos

Hi Mithlesh,

Thanks a lot. Your suggestion worked quite well and seems to be a lot simpler to implement.

Regards,

Uche

Former Member
0 Kudos

Hi

If your problem is solved do close the thread...

Cheers:)

Mithlesh

Answers (1)

Answers (1)

eddy_declercq
Active Contributor
0 Kudos

Hi,

I would suggest to work a bit like the logoff session described in https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/564ba07e-0701-0010-06ab-da2...

and

/people/eddy.declercq/blog/2005/11/15/enemy-of-the-state

In the start page of your app, you create a frame where your actual app resides in. Then you use the onunload event in Javascript to submit staring page. In the oninputproecessing of the BSP page in that upper frame you put the FM you want to run.

It looks a bit like this.

This is your starting page

<html>

<head>

<script language="JavaScript">

function exitBSPApplication(newTargetUrl) {

document.aform.submit();

}

</script>

</head>

<body scroll="no" bottommargin="0" leftmargin="0" topmargin="0" rightmargin="0" onUnLoad="exitBSPApplication();" >

<iframe id="fr0" frameborder=no height=100% width=100% src="pageb.htm">

</iframe>

<form name="aform">

<input type="submit" name="OnInputProcessing(callFM)" value="callFM">

</form>

</body>

Then in oninputprocessing:

case event_id.

when 'callFM'.

call .... your fm

endcase.

pageb.htm is the first page of your app.

Eddy

Former Member
0 Kudos

Thanks Eddy. Your direction was very helpful.

Regards,

Uche