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

extra data in table

Former Member
0 Likes
1,032

I have 2 records in my file after uploading this file iam getting 3 records in my table .In last record some fileds filled with zeros.any one can guide how to resolve this one?

10 REPLIES 10
Read only

abdul_hakim
Active Contributor
0 Likes
1,000

hi

this is due to the fact that your file may contain empty last record.so before appending the record into the table you just check

IF NOT wa IS INITIAL.

APPEND wa TO itab.

ENDIF.

Cheers,

Abdul Hakim

Mark all useful answers..

Close the thread if your question has been answered..

Read only

0 Likes
1,000

hi Priya,

sometimes in the which u r uploading file will have blank lines also(ex:- in d flat file 2lines r there and 3 line which is blank line). check d flat file.and delete 3rd line and save and then uplod and check..

and better to write incode

loop at itab.

IF NOT wa IS INITIAL.

APPEND wa TO itab1.

ENDIF.

endloop.

< itab[3xXX] after this loop itab[2xXX] (blank line r removed)>.

ok

Thanks,

Ramesh.

Read only

Manohar2u
Active Contributor
0 Likes
1,000

Before moving record to internal table check whether it is initial or not like i_tab ne space. before updating to internal table.

Regds

Manohar

Read only

Former Member
0 Likes
1,000

Date and currency fields are taking as '0'.

for date filed its some thing like this 00/00/0000

and currency 0.00 ,but for sometimes iam getting date field as blank so i cannot compare with that.

Read only

Manohar2u
Active Contributor
0 Likes
1,000

In that case you need to compare field wise.

You convert your date format into into YYYYMMDD and compare the same.

Regds

Manohar

Read only

0 Likes
1,000

You can very well use my above syntax.

Have you tried it?

may i know which datatype you are using for date and time fields..

Cheers,

Abdul Hakim

Mark all useful answers..

Read only

Former Member
0 Likes
1,000

Hi Priya

Your File has 2 records with data but also has one more empty record.

If your file is txt file.

1. Open your file

2. Put cursor on the second record, press END key. Cursor will go to end of 2nd record end.

3. Now Press SHIFT key, hold it, Press DOWN AERO key. Cursor will move down if any empty records found.

4. Now press DELETE key. Now your file is free of empty records. If you press DOWN AERO key now cursor will not go down beyond 2nd record.

If XL file make sure that no 3rd empty row is there.

In the program, after populating internal table with these records, check any null records are existing. If existing delete it.

Now your program will work.

Bala

Note: Award points if helpful.

Read only

Former Member
0 Likes
1,000

hi,

try to remove the space after the 2nd record

that means sometimes even though u enter 2 records in to the flatfile after the 2nd record if u press enter or if u create some space then program will count it as the third record with no data so remove the space after 2nd record and try once again

Regards

Naveen

Read only

Former Member
0 Likes
1,000

Open the file in MS excel. Choose the last row delete it,save it as tab delimited and upload it again!! Now you will see two records only!!

Regards,

Amiya Shrivastava

Read only

Former Member
0 Likes
1,000

Hi Priya,

<b>There is a problem with your uploading file.If it is a text file then</b> there is an additional space after 2 records.For this just do as follows.At the end of 2nd record,use SHIFT+END then DEL and then run report once again. You will definitely get 2 records only.

<b>If it a excel file then</b> be cautious with empty lines after 2 records.If it an empty line, just delete the line and rerun report once.This may solve your problem.

Regards,

Vinay