10-17-2007 9:11 AM
sir
i write a report using 2 table but only bkpf table show the data but bseg no show the data why i m send coding
Tables: bkpf, bseg.
parameters: hkont type bseg-hkont.
select-options: budat for bkpf-budat.
Select * from bkpf.
write:/, bkpf-budat,20 bkpf-blart.
endselect.
select * from bseg.
write:/,30 bseg-bschl.
*endselect.
endselect.
10-17-2007 9:14 AM
Hi
BSEG table may not be having the data with the supplied selection dates.
Check the sy-subrc after the select statement.
Regards,
Sree
10-17-2007 9:17 AM
May be teh BSEG is not having any data..
go to trasaction; se16....
give bseg...
click "Number of entries".
You can see whether the table is having data inside or not...
10-17-2007 9:36 AM
Hi
there is data in BSEG table but you data is selected in this
Select * from bkpf.
write:/, bkpf-budat,20 bkpf-blart.
endselect.
is overiten by this select qyery data
select * from bseg.
write:/,30 bseg-bschl.
*endselect.
endselect.
so if you want to get that data from 2 tables then join these two tables you will get total records of the 2 tables
<b>Reward if usefull</b>
10-17-2007 9:41 AM
when you use select option please use event for the same as
<b>START-OF-SELECTION</b>.
and write here your write statement
10-17-2007 11:58 AM
Ritu,
this code is working for me...
Check it out......
Check for the records in table bseg (se11)
*********************************************************************************
TABLES: bkpf, bseg.
PARAMETERS: hkont TYPE bseg-hkont.
SELECT-OPTIONS: budat FOR bkpf-budat.
start-of-selection.
SELECT * FROM bkpf.
WRITE:/, bkpf-budat,20 bkpf-blart.
ENDSELECT.
SELECT * FROM bseg.
WRITE:/,30 bseg-bschl.
ENDSELECT.
**************************************************************************************
reward points if useful.
*********************************************************
by the way there is no use of the parameter or the select options......it is fetching everything....
regards,
Vinod Samuel.
Message was edited by:
Vinod Samuel
10-17-2007 12:21 PM
why r u using the parameters and select option as ur not using it in ur select query.
10-17-2007 12:29 PM
Hi,
Please limit the records fetched from tables you are using with help of where clause in your select query. You are also using parameters and select-options, but you are not making use of it anywhere in your queries.
Please make use of where clause and limit the fetching of records and see if you get some output satisfying where condition.
10-18-2007 7:51 AM
hi ritu,
your code is working fine.
but what u need to do is put joins because the data u r fetching cannot be used.
use joins in the 2 tables to get the data common from the 2 tables.
regards,
sohi