‎2006 Oct 18 5:13 PM
IS there a way to tell the function to use '<b>,</b>' instead of '<b>;</b>'?
I am using this
I_FIELD_SEPERATOR = ','
Still the output files shows-up with ';'
I need the output file as <b>.CSV</b>
any solutions please
...
CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
EXPORTING
I_FIELD_SEPERATOR = ','
TABLES
I_TAB_SAP_DATA = OUTPUT_REC
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 = v_outputfile
TABLES
DATA_TAB = itab1
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
OTHERS = 8.
...
Message was edited by: Anwarul Kabir
<b></b>
Message was edited by: Anwarul Kabir
‎2006 Oct 18 5:16 PM
Hi,
Try to use the FM SAP_CONVERT_TO_TEX_FORMAT. THis FM is called inside the function module SAP_CONVERT_TO_CSV_FORMAT..
Thanks,
Naren
‎2006 Oct 18 5:16 PM
Hi,
Try to use the FM SAP_CONVERT_TO_TEX_FORMAT. THis FM is called inside the function module SAP_CONVERT_TO_CSV_FORMAT..
Thanks,
Naren
‎2006 Oct 18 5:23 PM
it works for .txt files but i need the output file to be .csv
‎2006 Oct 18 5:37 PM
Hi
A CSV file is a text file and that fm seems not to use the parameter filename, so it should work for csv file too.
Max
‎2006 Oct 18 5:43 PM
When I change the extension to csv it chages the account number to 1.45592E+11 from 145591769339. is there anyway to prevent it from doing so?
‎2006 Oct 18 5:20 PM
‎2006 Oct 18 5:29 PM
hi anwarul,
instead pf using function module
take one internal table say IT_UPLOAD' in that
REC(300) TYPE C,
and SPLIT IT_UPLOAD AT ','
INTO
yu internal table.
it will work.
‎2006 Oct 18 5:38 PM
Hi,
Check this example..
TYPE-POOLS: TRUXS.
DATA: BEGIN OF T_INPUT OCCURS 0,
CHAR4(4) VALUE 'ABCD',
CHAR10(10) VALUE '1234567890',
CHAR20(20) VALUE '12345678901234567890',
END OF T_INPUT.
DATA: T_OUTPUT TYPE TRUXS_T_TEXT_DATA.
APPEND T_INPUT.
CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
EXPORTING
i_field_seperator = ','
tables
i_tab_sap_data = T_INPUT
CHANGING
I_TAB_CONVERTED_DATA = T_OUTPUT
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:\TEST_FILE.CSV'
tables
data_tab = T_OUTPUT
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
THanks,
Naren
‎2006 Oct 18 5:46 PM
I have the same code. the out put files shows with ';' not ','
‎2006 Oct 18 5:44 PM
‎2006 Oct 18 5:47 PM
Hi,
Did you check my sample code..It is working fine for me..
In the output file I am having the following data..
ABCD<b>,</b>1234567890<b>,</b>12345678901234567890
Thanks,
Naren
‎2006 Oct 18 5:52 PM
Thank you all. Naren your code was eaxctly as mine but i was onpenning it in xl which you pointed out. so its working thanks.