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

Read table error

Former Member
0 Likes
688

.<b>

Hello every body ,

In my report ,Before populating the fieldcatalog i am first fetching the details of g/l account into my internal table .There are two line items with same posting date .Now wen i use read table to populate my final table looping through the internal table i am getting only one LIne item record .But wen i give my specific line item number in the sel-screen i am getting all the details.if i don't give it tat is to fetch all the data ,then i am able to get only one line item details that is coming first in the order but the second one is not getting displayed.</b>

Wat could be the reason .

is it bcoz of only using the read statement?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
657

Hi Naveen,

Yes. As READ can only read one line from the table.

Regards,

Atish

4 REPLIES 4
Read only

Former Member
0 Likes
657

Hi Naveen,

If you use the Read statment then it will fetch a single record, so you need to use the LOOP statment ot do the FOR ALL ENTRIES

Regards

Sudheer

Read only

Former Member
0 Likes
657

Hi

1st check the tables weather that tables getting correct data or not by going into debugging

if don't get proper data correct there it self

other wise

it will be problem with reading the table

give proper conditions then it will display the data

whenever u got problem like this go through the debugging so u can solve prob very easyly

reward if usefull

Read only

Former Member
0 Likes
658

Hi Naveen,

Yes. As READ can only read one line from the table.

Regards,

Atish

Read only

Former Member
0 Likes
657

My friend :

before looping for read table concept

you have to sort the both tables and the internal table fields should in the same order what ever fields are common in the bot internal table ,.

then the line item table should be the loop and the header table should be the read table .

" example .

sort  bseg by burks belnr  .
sort  bkpf by  burks belnr   .

loop at bseg .
read table bkpf with key  bukrs = bseg-bukrs   belnr  =  bseg-belnr .

you  query   for modify /inserting into  new internal table  .....etc
endloop .

but what you are doing is BKPF is looped and BSEG is used in the read concept so it will take only one line item ..and the remainining line item will be skiped .

and remember to sort also ..

reward points if it is usefulll.....

Girish