Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

GUI_OPLOAD inserting empty rows

TimVDB92
Participant
0 Likes
1,296

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
947

DELETE FROM it_datatab WHERE table_line = space.

Should work too to remove ALL blank lines.

3 REPLIES 3
Read only

hitesh_gabani
Participant
0 Likes
947

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

Read only

Former Member
0 Likes
948

DELETE FROM it_datatab WHERE table_line = space.

Should work too to remove ALL blank lines.

Read only

SwadhinGhatuary
Active Contributor
0 Likes
947

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 .