cancel
Showing results for 
Search instead for 
Did you mean: 

Opening the word document

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

eddy_declercq
Active Contributor
0 Kudos

Hi,

Can you try to put the code more readable pls?

Eddy

Former Member
0 Kudos

Hello ,

Actually my problem is not in opening the document.

My problem is when I open the window for first time with window.open code it opens the winow with contents.

when I click on the window next time it closes that open window.

I am using the following code.

function Show_CV()

{

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

x.focus();

}

Now I think you will understand my problem.

Regards,

Aashish Garg

Message was edited by:

aashish garg

eddy_declercq
Active Contributor
0 Kudos

Hi,

Did you try the code button?

Eddy

Former Member
0 Kudos

even i had the same prblem(formatting). the 'code' is not working with the recent changes to the website i guess.

what is the issue? you r not able to open word doc or the formatting/data is wrong or something else?

regards,

manasa

Message was edited by:

manasa manasa