cancel
Showing results for 
Search instead for 
Did you mean: 

Open window in web ui probleme

Former Member
0 Kudos

Hello,

1-i have created a bsp page test.pdf which has an URL  lv_url

2- in bsp_wd_cmpwb i have a view, which contain page.htm , in Layout i have :

<%
if controller->url is not initial.            " Line 1
  %>                                              
" Line 2
<script language="javascript">         " Line 3
window.open("<%= controller->url %>").focus();

</script>
<%
endif   .
%>

The controller->url is filled by 'lv_url in previous events ,  until here its OK .

The problem :

When i click the first time in button(in my view)  its go very well (it shows me test.pdf), but if i click another time in the  button  it shows nothing .

but If i change the url in debugger ( for exemple while pasing by in line 2) and i give http://www.google.com , it works very well .

if i execute after  www.google .com  the 'xxxxxx'  its go very well .

So the problem is i can't execute the same URL two times successively

Thanks for your help

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member214677
Active Participant
0 Kudos

Hi, Rida


I'm facing the same problem, did you solve the problem? Please help. Thanks.

former_member214677
Active Participant
0 Kudos

Hi, Rida


I may find the reason. Maybe the ie cache cause the problem.


You can solve it two ways:


1.  add attributes to the html head


<meta http-equiv="Pragma" content="no-cache"/>

<meta http-equiv="Cache-Control" content="no-cache"/>

<meta http-equiv="Expires" content="0"/>

2. add a random value to the URL, as below


GET TIME STAMP FIELD lv_timestamp.

CONCATENATE lv_zprint_url

                         '?guid=' lv_str_guid

                         '&time=' lv_str_timestamp

                 INTO lv_zprint_url.


Former Member
0 Kudos

Hi yang,

Even i was facing the same problem, this was happening because of the cache.

so basically i wanted to give the hyperlink to one of the column in the table assignment block .

So how i solved this problem is, i just coded in the get P method of that particular field, where i just gave the property as a link and provided the value.

If you need more information please let me know.

Thanks & Best Regards,

Nikhil H

former_member188098
Active Contributor
0 Kudos

Hi,

Facing same issue.

In table view I have a hyperlink to view excel.

I used window.open( "url") method to open excel.it is opening excel first time only but not after that.

Any suggestions please..

Regards,

Harish Kumar.

Former Member
0 Kudos

Hi Harish,

the web ui seems to have problems opening the same URL again.

Here is an example of SAP Standard code from a solution manager System regarding this problem. They just concatenate a '&' to the URL:

    IF mv_url_to_open IS NOT INITIAL.

      "!!!Use different URL for the same document to be openned again

      "!!!otherwise the BSP framework will not open the same URL again

      IF mv_url_openned = mv_url_to_open.

        CONCATENATE mv_url_to_open '&' INTO mv_url_to_open.

      ENDIF.



      mv_url_openned = mv_url_to_open."Record the URL to be openned



    ENDIF.

Best Regards,

Christoph

former_member188098
Active Contributor
0 Kudos

Hi Christoph,

Thanks for your response.

I have resolved the issue with following statement.

window.open("<% = url%>" ,"<%=sy-uzeit%>");

Regards,

Harish Kumar

kumar5
Active Contributor
0 Kudos

Check in your event where you are filling lv_url that wehn you click on the button second time is the lv_url getting filled with URL or not.

This may be the reason because your lv_url does not contain any value when you click on the button second time.

Check there .

Thanks

Kumar

Former Member
0 Kudos

@ Caique : i have made a clear and its not working ,

@ Kumar : Url is always have the value because when i click in button it pass by event method which give a value to url  + i checked that in debugger .

I need for your help ,

Thanks

Former Member
0 Kudos

Any help please.

former_member197655
Active Participant
0 Kudos

Refer to this link

http://scn.sap.com/thread/2091874

Hope it helps.

Regards,

Manjeet.

Former Member
0 Kudos

Hi Rida,

Even i am facing the same problem , can you please tel me how did u solve this problem.

Please reply me soon , very urgent.

Thanks & Best Regards,

Nikhil H

Caique
Employee
Employee
0 Kudos

I guess you have to set a clear in controller->url before the endif.

Regards,

Caíque