2009 Jul 23 1:58 PM
How can i upload a txt file in which fields are seperated by pipe symbol ( | ) , into the database using GUI_UPLOAD or some other function module?
2009 Jul 23 2:24 PM
Hi,
You can upload the file usnig GUI_UPLOAD with filetype as ASC and field_seprator as space. For this you need to take the internal table as Char of 1000 (which is per your requirement).
loop at table and using SPLIT statement you can split the string at pipe '|' in to internal table. check the help on SPLIT statement.
How can i upload a txt file in which fields are seperated by pipe symbol ( | ) , into the database using GUI_UPLOAD or some other function module?
2009 Jul 23 2:19 PM
The FM GUI_UPLOAD can identity only a tab separator or no separator. If your txt file has | separator, then do onething. Open the txt file go to menu edit and select replace. Here in find field give | and replace field give 5spaces then click replace all. This will replace all | symbols into tab. Now u can use FM GUI_UPLOAD with parameter HAS_FIELD_SEPARATOR = 'X'.
2009 Jul 23 2:24 PM
Hi,
You can upload the file usnig GUI_UPLOAD with filetype as ASC and field_seprator as space. For this you need to take the internal table as Char of 1000 (which is per your requirement).
loop at table and using SPLIT statement you can split the string at pipe '|' in to internal table. check the help on SPLIT statement.
2009 Jul 23 4:01 PM
you can use method also
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = pa_cnfg
filetype = 'ASC'
CHANGING
data_tab = gt_file1
EXCEPTIONS
file_open_error = 1
the file format is
0000263764|005000|0000036122
0000266053|005000|0000034790
0000267268|005000|0000036051
0000267962|005000|0000034792
0000268248|005000|0000038958
0000270838|005000|0000044025
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |