Skip to Content
0
Former Member
Nov 16, 2006 at 10:42 AM

Opening the word document

19 Views

Hello All,

I am facing a peciular problem. I am using the following

code to get the contents of the in the cache in the <b>

display_url</b> variable

doc_len = XSTRLEN( var_string ).

***Create an intance of the cache

CREATE OBJECT cached_response TYPE cl_http_response

EXPORTING

add_c_msg = 1.

***Sets the HTTP body of the entity to the given data

cached_response->set_data( data = var_string

length = doc_len ).

***Sets the value of the header field

cached_response->set_header_field(

name =

if_http_header_fields=>content_type

value = 'application/doc' ).

***Sets current HTTP status code

cached_response->set_status( code = 200 reason

= 'OK' ).

***Sets relative expiry time for this response in server

cache

cached_response->server_cache_expire_rel( expires_rel

= 180 ).

url = runtime->application_url.

CONCATENATE url '/' partner '.doc' INTO <b>display_url</b>.

CONDENSE display_url NO-GAPS.

****Put New Object in the ICM Server Clipboard (ICM)

cl_http_server=>server_cache_upload( url =

display_url

response =

cached_response ).

Its is working fine.

To open a new window I use the following code But with

every click it opens a new window..

<A href = "#" onclick = "Javascript:Show_CV()" >Display Uploaded CV </a>

<script language="Javascript">

function Show_CV()

{

var x = window.open('<%= display_url%>');

x.focus();

}

</script>

To Over come the Problem so that every click will not

open a new window I make the following

changes.But problem with this code comes that for first

click it opens a window thats ok. But on

second click it closes that already opened window.

<A href = "#" onclick = "Javascript:Show_CV()" >Display Uploaded CV </a>

<script language="Javascript">

function Show_CV()

{

var x = window.open('<%= display_url%>',<b>'window_name'</b>);

x.focus();

}

</script>

Please provide a solution for that. Points will be

surely awarded.

Thanks & Regards

Aashish Garg

Message was edited by:

aashish garg