Skip to Content
0
Former Member
Feb 13, 2009 at 10:36 AM

bsp error

22 Views

hi,

I have written the following piece of code to download in excel the contencts in local file :

ALL FUNCTION 'SCMS_STRING_TO_XSTRING'

EXPORTING

text = output

IMPORTING

buffer = l_xstring

EXCEPTIONS

failed = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

l_content_size = XSTRLEN( l_xstring ).

runtime->server->response->set_data( l_xstring ).

l_content_length = l_content_size.

runtime->server->response->set_header_field(

name = 'Content-Length' value = l_content_length ).

runtime->server->response->delete_header_field( name = 'pragma' ).

runtime->server->response->delete_header_field( name = 'cache-control' ).

runtime->server->response->delete_header_field( name = 'expires' ).

runtime->server->response->set_content_type( 'application/vnd.ms-excel' ).

response->set_header_field( name = 'content-disposition' value = 'attachment; filename="pr_results.xls"' ).

but when i am downloading the system is flashing a file name .htm not the excel,what can be the problem

regards

Prasun