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: 

report

Former Member
0 Kudos

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.

8 REPLIES 8

sreeramkumar_madisetty
Active Contributor
0 Kudos

Hi

BSEG table may not be having the data with the supplied selection dates.

Check the sy-subrc after the select statement.

Regards,

Sree

Former Member
0 Kudos

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...

Former Member
0 Kudos

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>

Former Member
0 Kudos

when you use select option please use event for the same as

<b>START-OF-SELECTION</b>.

and write here your write statement

Former Member
0 Kudos

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

Former Member
0 Kudos

why r u using the parameters and select option as ur not using it in ur select query.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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