2015 Jul 14 11:17 AM
I'm using the FM 'GUI_UPLOAD' to read a .TXT file into an internal table in my code, the file is tab delimitted.
The function is working, but when my txt-file is ending with 50 empty rows,
the function is adding these rows to my Internal table in a '#' format.
Is it possible to delete these?
Code:
call function 'GUI_UPLOAD'
exporting
filename = p_path
filetype = 'ASC'
dat_mode = ''
tables
data_tab = it_datatab
exceptions
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
others = 17.
2015 Jul 14 12:13 PM
DELETE FROM it_datatab WHERE table_line = space.
Should work too to remove ALL blank lines.
Hi,
If possible attach the tab delimited file with code for inspection.
try not to put any blank space line other wise make a loop at internal table
read first char of first field which will # then delete that row from internal table .
2015 Jul 14 11:45 AM
Hi,
Loop at it_datatab into some work area(wa_datatab)
then use the follwing split statement.
SPLIT wa_datatab AT
cl_abap_char_utilities=>horizontal_tab INTO workarea-fields
and check if WA_MAT is not initial
than append to another internal table before ending loop.
Regards,
Hitesh
2015 Jul 14 12:13 PM
DELETE FROM it_datatab WHERE table_line = space.
Should work too to remove ALL blank lines.
2015 Jul 14 12:23 PM
Hi,
If possible attach the tab delimited file with code for inspection.
try not to put any blank space line other wise make a loop at internal table
read first char of first field which will # then delete that row from internal table .
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |