12-03-2007 11:29 AM
friends i want to upload data using one tool which it accepts only .txt files..but on the presentation server i have only .csv...microsoft excel files...
so can u plz tell me how to convert .csv into .txt files after uploading..or how top upload and conver them..plz..any one..?
12-03-2007 11:35 AM
hi satish,
before uploading it do convrsion.
steps to convert csv file to txt file:
-> open excel file.
-> goto file menu-> select save as option .
-> save that csv file as tab delimited file with .txt extention.
-> now use that file in uploading.
<b><i>Reward points if useful</i></b>
Chandra
12-03-2007 11:54 AM
Hi,
ALSM_EXCEL_TO_INTERNAL_TABLE- try this func. module to upload values from excel file. Now we have values in internal table it_table
so at every new value of row move the values into an internal table with each value separated by tab( c_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab)
Now u have an internal table with the records tablimited..
Reward if helpful.
Regards,
Karthick.
12-03-2007 11:56 AM
Hi
The CSV is a text file, so I believe your problem can be on how the information are written in the file:
DATA: W_RECORD TYPE STRING,
T_FILE LIKE STANDARD TABLE OF W_RECORD.
DATA: BEGIN OF ST_RECORD,
FIELD1,
FIELD2,
FIELD3,
...........
FIELDN,
END OF ST_RECORD.
DATA: BEGIN OF T_VALUE OCCURS 0,
FIELD(100),
END OF T_VALUE.
FIELD-SYMBOLS: <FIELD> TYPE ANY.
* By FM GUI_UPOLAD import the file to T_FILE table:
LOOP AT T_FILE INTO W_RECORD.
* ; should be the symbol used as separator
SPLIT W_RECORD AT ';' INTO TABLE T_VALUE.
* Move the data from line of csv file to your structure
LOOP AT T_VALUE.
ASSIGN COMPONENT SY-TABIX OF STRUCTURE ST_RECORD TO <FIELD>.
IF SY-SUBRC = 0.
MOVE T_VALUE-FIELD TO <FIELD>.
ENDIF.
ENDLOOP.
Max