cancel
Showing results for 
Search instead for 
Did you mean: 

How to get back to the calling application ?

Former Member
0 Kudos

Hi Friends ,

I am having a BSP application which is being called from different Planning layouts in BPS .

Its a stateful application and I am finding that when i hit standard browser Back button i am returning to my application again .

I tried creating a button and passing the javascript method history.back()

<htmlb:button id = "BACK"

onClick = "BACK"

text = "BACK"

tooltip = "Back"

disabled = "<%= v_save_disable %>"

onClientClick="history.back();"

width = "15" />

it is notworking.

Please let me know how can i resolve the issue ? I have another idea to divert the user to the calling application using URL but dont know how to capture the URL of calling application ?

i appreciate your contribution in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Raja ,

I am giving below the code patch I used for calling my BSP application from the BPS layout BSP , it creates a button for calling my application:

<html>

<a class="urBtnStd urV" href="http://sap:1022/sap/bc/bsp/sap/ztest/session_start.htm">Maintain Master data</a>

</>

athavanraja
Active Contributor
0 Kudos

if this is the case, the history.back() should work, are you getting any javascript error when you hit back button.

in the browser next to back button there is a dropdown, can you pull down that (when you are in second bsp) to see whether history is available?

whats the url pattern of planning layout application?

Regards

Raja

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Raja ,

Yes that did IT !!

You are right since I was calling my page thru the start page I need to go two step back in history .

Thanks very much ..

Former Member
0 Kudos

Hi Raja ,

I relooked into the thing and made simple BSP page with call to history.back ..it works .

When i compared that to my application ..i need to tell you one thing I am having a start page for session management ( a copy of page :session_single_frame.htm of BSP application SYSTEM ) . Which internally calls my first page of application from where I am trying to come back using hostory object.

I think this envelope page is creating the issue. To over come that i tried parent.history.back() from my application ..doznt give the desired result.The browser opens the same application again.

Can you please let me know how can I get the back functionality in this case.

Thanks again for your support raja .Theres a lot I am learning from you here.

athavanraja
Active Contributor
0 Kudos

now the situation is more clear.

instead of history.back use the following code.

<htmlb:button text = "Press Me"

onClientClick = "javascript:history.go(-2);"/>

Regards

Raja

Former Member
0 Kudos

Hi Raja ,

I was busy in putting up the trials for this work arround ..its working . That was a good work arround . But I am quite surprised to see that in BSP we are not able to use the history object like in Javascript.

I still have a feel we mite be missing some solution here as I think it would be a regular requirement to browse back .

athavanraja
Active Contributor
0 Kudos

we can use javascript history.back, it does work.

Regards

Raja

athavanraja
Active Contributor
0 Kudos

can you post the code you have used in Planning layouts in BPS for creating the link to BSP page?

Regards

Raja

assign points to helpful answers by choosing the appropriate radiobutton and mark the thread as answered once your question is answered

Former Member
0 Kudos

Thanks raja ,

i am briefing the scenario below :

1.I have a customised Master data maintenance transaction (my current BSP application), this application will be called from multiple planning layouts of BPS.

2.These BPS layouts are generated using the BPS web interface builder tool. It generates a BSP in which i am adding a URL link to call my application.

3.Now when a user hits back button in my application , I want him to get back to the calling BPS layout interface.There are multiple Layout applications calling my application so I think If i am able to capture the calling application ..it should work as history.back() is not helping here.

I think your current suggesstion is not possible here as i am calling from external application ..not from one page to another in same application .

Anything more you need please let me know ..I am wondering how come on Sunday also you being so prompt ..really thankful for your proactiveness .

athavanraja
Active Contributor
0 Kudos

<i>It generates a BSP in which i am adding a URL link to call my application.</i>

while adding the url add a parameter to it masterdatabsp.htm?frompage=<currentpagename>

(runtime->PAGE_NAME will return current page name)

and in the master data maintenance bsp page declare a page attribute and name it frompage type string and check the auto check box.

now within your masterdatamanintenance bsp you will have the calling page name.

Hope this is clear. if not do getback.

Regards

Raja

i work in a place where weekends are on thursdays and fridays - today is a working day

Former Member
0 Kudos

Hi Raja,

Thanks for the suggesstion . there are two things happening .

1. When i come to my application and hit back ..it comes back to the same application.

2.If after coming to my application i fill in some data and do some user activity and then hit back ..it comes to the warning page that cannot go to earlier page as data entered earlier is not available now ..u mite need to provide data again.

Looks like the application is calling itself afresh ..when it is using this script. I would like to luk into two motives :

1. Either i get to the back page using browser's history functionality.

2.If thats not working is there someway of capturing the URL which is calling my application at the start of application. I would then link the same with the BACK button as URL.

let me have ur suggesstions. i appriciate your time .

athavanraja
Active Contributor
0 Kudos

lets say you have page A and page B

page A calls page B by naviagation->goto_page('pageb.htm') .

now in page B to get the previous page you can use javascript , just place the following javascript in page B

<script language="javascript">

myvar = document.referrer ;

alert(myvar);

</script>

if you tell us what exactly you are trying to do, the whole scenario and how you are expecting it to work, then we can come up with a better suggestion.

Regards

Raja

athavanraja
Active Contributor
0 Kudos

The reason why its not working is that, when you have both onClientclick and onClick for the button, first onClientClick gets executed and then onClick.

<htmlb:button id = "BACK"

onClick = "BACK"

text = "BACK"

tooltip = "Back"

disabled = "<%= v_save_disable %>"

onClientClick="history.back();"

width = "15" />

if you want your button to work for back navigation with javascript you should remove the onclick attribute.

<htmlb:button id = "BACK"

text = "BACK"

tooltip = "Back"

disabled = "<%= v_save_disable %>"

onClientClick="javascript:history.back();"

width = "15" />

Try this and let us know.

Regards

Raja