on 03-27-2006 6:46 AM
Hello Everyone,
I want to download .CSV file in presentation server.
I am able to download through FM WS_DOWNLOAD.
As this FM is obsolete now, i want to download with
FM GUI_DOWNLOAD but this FM is giving short dump.
I tried with many option but my efforts got futile.
Any clue about this FM GUI_DOWNLOAD downloading file in .CSV format.
Regards,
Tarun
Hai Tarun,
Here is a sample code for downloading .CSV file..
report ztest.
type-pools:TRUXS.
data: begin of itab occurs 0,
vbeln like vbap-vbeln,
posnr like vbap-posnr,
end of itab.
data: itab1 type TRUXS_T_TEXT_DATA.
select vbeln
posnr
up to 10 rows
from vbap
into table itab.
CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
EXPORTING
I_FIELD_SEPERATOR = ','
TABLES
I_TAB_SAP_DATA = itab
CHANGING
I_TAB_CONVERTED_DATA = itab1
EXCEPTIONS
CONVERSION_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.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\TEMP\test.TXT'
TABLES
data_tab = itab1
EXCEPTIONS
OTHERS = 1.
You can even refer this link...
Regards,
Srikanth.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Tarun,
try like this..
A sample
type-pools:TRUXS.
data: begin of itab occurs 0,
vbeln like vbap-vbeln,
posnr like vbap-posnr,
end of itab.
data: itab1 type TRUXS_T_TEXT_DATA.
select vbeln
posnr
up to 10 rows
from vbap
into table itab.
CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
EXPORTING
I_FIELD_SEPERATOR = ','
TABLES
I_TAB_SAP_DATA = itab
CHANGING
I_TAB_CONVERTED_DATA = itab1
EXCEPTIONS
CONVERSION_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.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:TEMPtest.TXT'
TABLES
data_tab = itab1
EXCEPTIONS
OTHERS = 1.
regards
satesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
4 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.