2008 Mar 11 7:13 AM
Hi friends,
I am using this sql statement,
SELECT belnr hkont wrbtr bupla matnr FROM bseg
INTO CORRESPONDING FIELDS OF TABLE itab
FOR ALL ENTRIES IN it_bseg1
WHERE belnr = it_bseg1-belnr AND bupla = it_bseg1-bupla AND gjahr = it_bseg1-gjahr.
Here it_bseg1 have only one doc no.
And for that belnr bseg having the content like below
belnr gjahr bschl wrbtr hkont
0090000126 2007 01 53,920.00 0024410000
0090000126 2007 50 1,256.00 0040010000
0090000126 2007 50 1,256.00 0040010000
0090000126 2007 50 410.00 0040010000
0090000126 2007 50 445.00 0040010000
0090000126 2007 50 860.00 0040010000
0090000126 2007 50 410.00 0040010000
0090000126 2007 50 410.00 0040010000
0090000126 2007 50 410.00 0040010000
0090000126 2007 50 410.00 0040010000
0090000126 2007 50 873.00 0040010000
0090000126 2007 50 990.00 0040010000
0090000126 2007 50 873.00 0040010000
0090000126 2007 50 22,000.00 0040010000
0090000126 2007 50 18,000.00 0040010000
0090000126 2007 50 3,432.00 0040010000
0090000126 2007 50 1,885.00 0040010000
now when the sql statement writtent above is run then only 10 lines are fetched into itab.
The lines which are in bold are not fetched y this is happening through forallentries statement.
Please help me in this.
Thanks in advance.
Edited by: Dharmishta Suryavanshi on Mar 11, 2008 12:43 PM
Edited by: Dharmishta Suryavanshi on Mar 11, 2008 12:44 PM
2008 Mar 11 7:18 AM
Sort internal table before select statement
sort it_bseg1 by belnr bupla gja.
2008 Mar 11 7:19 AM
Hi make sure you are sorting the internal table
it_bseg1 by belnr bupla and gjahr before using it in for all entries.
this will surely solve your problem.
2008 Mar 11 7:20 AM
Hello,
as u r using for all entries you have to fetch all the primary key fields of table bseg along with the required fields.
while fetching the data also fetch
BUKRS
BELNR
GJAHR
BUZEI
form the table BSEG.
Regards,
Neelambari
2008 Mar 11 7:23 AM
Hi,
Belnr is unique tht's why it is coming only once when there are also other records.
So you have to select the data from the item table and then display it.
HTH
Regards,
Dhruv Shah
2008 Mar 11 7:56 AM
Hi ,
Please can you check the field BUPLA for the 10 entries that you are not getting and also for the rest entries that are available.
Coz i think that the problem is with the data,
Please check all the fields by which you are selecting and also the fields of the data that is selected,
I guess there is no problem with the query,
Else provide me with the complete internal table data after the select query,may be i can help
Hope this is help full,
Taher
Edited by: taher kanchwala on Mar 11, 2008 1:29 PM