Application Development 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: 

Extra line generation during upload

prasad_reddy9
Explorer
0 Kudos

I have a file on Application server in binary.

While getting this file into internal tables, program is generating an extra line at the end with space in Char types and '0' in int types.

This is an extra blank line generated and not modification of last line. I am guessing since the file on Application server is binary, this problem exists.

Any idea to solve this?

Message was edited by:

Prasad Reddy

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

While upload the file into Application server, there may be an extra line, let say if you are uploading the .txt file then if you press just a enter at the last line then this will upload a blank line, so in that same way this is happenging, here, the Int type fields will take the value 0 because the default value is 0.

if you want to delete this row, then use the DELETE statment after getting the line into an internal table

Regards

Sudheer

5 REPLIES 5

Former Member
0 Kudos

Hi Reddy

Do one thing

if u have internal table itab with extra line.

find the number of lines in itab.

DESCRIBE TABLE itab LINES lines.

loop at itab.

if sy-tabix = lines.

delete itab.

endif.

modify itab.

endloop.

or

delete table itab index lines.

reward points to all helpful answers

kiran.M

Message was edited by:

KIRAN KUMAR

Former Member
0 Kudos

shift v_char left deleting leading ' '.

Refer

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/shift.htm

prasad_reddy9
Explorer
0 Kudos

Can anyone explain why this is happening though?

Former Member
0 Kudos

Hi,

While upload the file into Application server, there may be an extra line, let say if you are uploading the .txt file then if you press just a enter at the last line then this will upload a blank line, so in that same way this is happenging, here, the Int type fields will take the value 0 because the default value is 0.

if you want to delete this row, then use the DELETE statment after getting the line into an internal table

Regards

Sudheer

Former Member
0 Kudos

Hi prasad,

This happens when you have an extra blank line in your file,

Assuming that you are using a text file, i suggest you this.

Open your text file that your using to upload data.

Place your cursor on the last line, last character and keep pressing delete button

till you notice that, there are no more blank spaces existing after the last character.

Eg: The text file u r using now will be somewat like this.

___________________

field1 field2 field3 field4

field1 field2 field3 field4

field1 field2 field3 field4

field1 field2 field3 field4

field1 field2 field3 field4

___________________

Here you can see a blank line after the data, so please delete this n chek again.

I am sure this will help you...

Regards,

SJ