on 07-27-2009 5:06 PM
Hi friends,
I´m using cl_bsp_utility=>download method from my BSP to download a file. I´ve never used it, but as long as I could see in the forum, it´s suppossed to open a popup to choose the file destination, right?...
Well, I´m getting nothing...what could be happening? I´ve tried the same code from different pc´s, to discard antivitrus, or popup blockers, or something like that, and nothing at all. After my pushbutton click, runs all the code without any error, but no popup.
I would appreciate very much any kind of help. Here´s my code, just in case...
call function 'SCMS_STRING_TO_XSTRING'
exporting
text = lv_string
mimetype = 'APPLICATION/MSEXCEL;charset=utf-8'
importing
buffer = lv_xstring.
concatenate cl_abap_char_utilities=>byte_order_mark_little
lv_xstring into lv_xstring in byte mode.
call method cl_bsp_utility=>download
exporting
object_s = lv_xstring
content_type = 'APPLICATION/MSEXCEL;charset=utf-8'
content_disposition = 'attachment;filename=*.xls'
response = _m_response
navigation = navigation.
Thanks in advance!
I finally did it, my mistake was to use the mreponse object, instead of the response object belonging to my page.
As it is not available from OnInputProcessing event, all I did was fetch it from the runtime:
response = runtime->server->response.
Hope this could help someone else.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Federico,
Could you please suggest about m_response population, whihc is you generating at Run time of .htm,
from where u got this instance populated, which view of the component, please guide us, as we are not at all getting XLS download popup, it is giving page error, please guide us.
Thanks & Regards,
Vjmhyd
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
I am using the same as mentioned above while Download the data into Excel.
I got the popup with SAVE, CANCEL and OPEN. After SAVING file
it stores the data into Excel sheet. But cursor will not move to the regular place.
am i missing anything here . I want to know the reson why it's not going back after SAVE file or CANCEL?
Secondly i tried the below link also,
According to this I tryied to call the URL using Java script. But it is working in some browsers but not in other browsers.
Is there any changes I need to do in this.
I am not bale to fingure it out. Please suggest some points on it ...
Thanks..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your suggestion.
Indeed, one those code samples is what I´m trying to make work, but it doesn´t. I´m looking for someone who might have experienced the same problem.
Kind regards,
Federico.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much.
I´ve replaced my code with your proposal, but I had the same result (or the lack of it, in fact). The code doesn´t do anything.
What could be missing?
Regards,
Federico.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try the below code in place of the cl_bsp_utility=>download.
DATA: L_APP_TYPE TYPE STRING,
L_FILENAME TYPE STRING,
L_XSTRING TYPE XSTRING, "needed for HTTP response
L_XLEN TYPE I.
* Setting Content Type
MOVE 'application/msexcel' TO L_APP_TYPE.
MOVE 'attachment; filename=webforms.xls' TO L_FILENAME.
CLEAR L_XSTRING.
L_XSTRING = V_XSTRING. " Here you can directly pass your XSTRING
*-----------------------------------------------------------------------
* Fill HTTP request
*-----------------------------------------------------------------------
RESPONSE->SET_HEADER_FIELD( NAME = 'content-type'
VALUE = L_APP_TYPE ).
RESPONSE->DELETE_HEADER_FIELD(
NAME = IF_HTTP_HEADER_FIELDS=>CACHE_CONTROL ).
RESPONSE->DELETE_HEADER_FIELD(
NAME = IF_HTTP_HEADER_FIELDS=>EXPIRES ).
RESPONSE->DELETE_HEADER_FIELD(
NAME = IF_HTTP_HEADER_FIELDS=>PRAGMA ).
RESPONSE->SET_HEADER_FIELD(
NAME = 'content-disposition'
VALUE = L_FILENAME ).
* finally display XLS format in Browser
L_XLEN = XSTRLEN( L_XSTRING ).
RESPONSE->SET_DATA( DATA = L_XSTRING
LENGTH = L_XLEN ).
NAVIGATION->RESPONSE_COMPLETE( ).
I have used it one of my program and it worked.
Thanks,
Sreekanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.