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

report

Former Member
0 Likes
540

sir

i correct my query but it is not give correct answer.

ables: bkpf, bseg.

select-options: budat for bkpf-budat.

select * from bkpf into bkpf where budat between '20070820' and '20071020'.

select * from bseg.

write:/, bkpf-budat,20 bkpf-blart,30 bseg-bschl,40 bseg-hkont.

endselect.

endselect.

ritu

4 REPLIES 4
Read only

Former Member
0 Likes
523

Hi,

I got a list. Try to optimize your selection.

tables: bkpf, bseg.

select-options: budat for bkpf-budat.

select * from bkpf where budat in budat.

select * from bseg where belnr eq bfkp-belnr.

write:/, bkpf-budat,20 bkpf-blart,30 bseg-bschl,40 bseg-hkont.

endselect.

endselect.

Regards

Nicole

Read only

varma_narayana
Active Contributor
0 Likes
523

Hi Reetu..

Why are u using the Nested SELECT statments.. It will give worst performance .

Better convert these queries using FOR ALL ENTRIES

Sample code:

select-options: budat for bkpf-budat.

select * from bkpf into TABLE IT_bkpf where budat between '20070820' and '20071020'.

If it_bkpf IS not initial.

select * from bseg into table IT_BSEG

FOR ALL ENTRIES IN IT_BKPF

WHERE <CONDITION OF COMMON FIELDS>.

Endif.

Reward if Helpful.

Read only

Former Member
0 Likes
523

Hi ritu,

try it like this:

tables: bkpf, bseg.

select-options: budat for bkpf-budat.

select * from bkpf where budat between '20070820' and '20071020'.

select * from bseg where belnr = bkpf-belnr.

write:/ bkpf-belnr, bkpf-budat,20 bkpf-blart,30 bseg-bschl,40 bseg-hkont.

endselect.

endselect.

Regards, Dieter

Read only

Former Member
0 Likes
523

Hi Ritu,

Try this.

select-options: budat for bkpf-budat.

select * from bkpf into TABLE IT_bkpf where budat between '20070820' and '20071020'.

If not it_bkpf IS initial.

select * from bseg into table IT_BSEG

FOR ALL ENTRIES IN IT_BKPF

WHERE <CONDITION >.

Endif.

Incase if u want to include these '20070820' and '20071020' dates also in the check then between will not work.

use this :

select * from bkpf into TABLE IT_bkpf where budat GE '20070820' and budat LE '20071020'.

Reward if Useful.

Regards,

Chitra