04-01-2009 8:48 AM
Hi All,
I'm down loading text file data to CSV format,it's downloading to CSV As each field is not separating the output is comming like:
01;OPA01/2009;063840045;P;20090122;1;2009;2000.00;AV00612/ADVANCE;;4000145004501/20
the CSV file has to be :
01 | PA01/2009 | 063840045 | P | 2009122 |.
I followed the logic is:
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 NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Please help one this..
Thank you..
Srii...
04-01-2009 9:28 AM
04-01-2009 9:42 AM
Hi.
Please try here.
CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
p.s.
Because SAP_CONVERT_TO_CSV_FORMAT uses a fixed value for the separator[;].
04-01-2009 10:36 AM
Hi,
I try it with SAP_CONVERT_TO_TEX_FORMAT and works well
constants:C_FIELD_SEPARATOR type c value '|'.
CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
EXPORTING
I_FIELD_SEPERATOR = C_FIELD_SEPARATOR
I_LINE_HEADER = I_LINE_HEADER
I_FILENAME = I_FILENAME
TABLES
I_TAB_SAP_DATA = itab
CHANGING
I_TAB_CONVERTED_DATA = itab1
EXCEPTIONS
CONVERSION_FAILED = 1.
Best regards.
04-02-2009 3:54 AM
Thank q very much for ur help and I'll award points ...now its downloading fine..
But wn this downloaded CSV file i want to upload.
this CSV file is not clearly seperated according to coloumns ..
Like
the CSV file now downloading format is:
A B C D E
01 | OPA01/2009 | 063840045 |
02 | OPA01/2009 | 073840046 |
It only will upload when we can see to CSV file : A | B | C |
01 | OPA01/2009 | 063840045 |
02 | OPA01/2009 | 073840046 |
Suggest me on this...
thank you.
Srii
Edited by: sridhar reddy on Apr 2, 2009 5:06 AM
Edited by: sridhar reddy on Apr 2, 2009 5:07 AM
Edited by: sridhar reddy on Apr 2, 2009 5:08 AM
Edited by: sridhar reddy on Apr 2, 2009 5:41 AM
04-02-2009 7:38 AM
04-02-2009 10:07 AM
04-02-2009 10:10 AM
Hi Sreedhar
Is your issue with header data??
regards
sas
If so just when ayou are passing the header details just make sure that they are seperated by '|' and append them to INTERNAL table and pass to the download details....this will solve your problem...
Edited by: saslove sap on Apr 2, 2009 11:11 AM
04-03-2009 3:32 AM
Yes this is master data.. but y this CSV file downloading with ';' .
help me on this
02-25-2011 3:13 AM