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

Hi,

Could you please give some codin to fetch... BUKRS BELNR GJAHR BUDAT from BKPF

for a given company code..

I d given like this

select BUKRS BELNR GJAHR BUDAT from bkpf

into table it_bkpf

where bukrs eq compcode and

budat between s_date-low and s_date-high .

its fetchin data for all the company codes..

please...

Cheers

Nalina

Edited by: Nalina Acharya on Mar 20, 2008 12:02 PM

1 ACCEPTED SOLUTION

graghavendra_sharma
Contributor
0 Kudos

Try out the following code:

select bukrs belnr gjahr budat from bkpf
into table it_bkpf
where bukrs eq compcode and
budat in s_date .

Note: Reward all answers which are helpful to you

6 REPLIES 6

Former Member
0 Kudos

Hi,

use the following query, compcode is parameter and s_date is select-options in selection screen.

select BUKRS BELNR GJAHR BUDAT from bkpf

into table it_bkpf

where bukrs eq compcode and

budat in s_date .

-somesh

  • Pls reward if it is helpful

Former Member
0 Kudos

Hi Nalina,

In this table BUKRS BELNR GJAHR are primary key fields. if u give all these fields in where condition, U ll get accurate value. Other wise some set of values will be fetched which ll satisfy ur condition like date between some dates.

select-options: s_date for bkpf-budat.

start-of-selection.

select belnr bukrs gjahr from bkpf

where bukrs eq companycode

and budat in s_date.

Regards,

Subbu

Former Member
0 Kudos

hi do like this,

tables:bkpf.

data: begin of it_bkpf occurs 0,

BUKRS like bkpf-bukrs,

BELNR like bkpf-belnr,

GJAHR like bkpf-gjahr,

BUDAT like bkpf-budat,

end of it_bkpf.

se;ect-options:s_bukrs for bkpf-bukrs,

s_date for sy-datum.

select BUKRS

BELNR

GJAHR

BUDAT

from bkpf

into table it_bkpf

where bukrs in s_bukrs

and budat in s_date .

sort it_bkpr by bukrs.

loop at it_bukrs.

write:/ it_bukrs-budat,

it_bukrs-belnr,

it_bukrs-gjahr,

it_bukrs-budat.

endloop.

regards,

venkat.

Former Member
0 Kudos

do this way...


 select BUKRS BELNR GJAHR BUDAT from bkpf
into table it_bkpf
where bukrs eq compcode and
          budat in  s_date . 

Former Member
0 Kudos

Hi,

Is your prob solved by the reply from other members who replied u??

if not than explain the prob in detail

bye

graghavendra_sharma
Contributor
0 Kudos

Try out the following code:

select bukrs belnr gjahr budat from bkpf
into table it_bkpf
where bukrs eq compcode and
budat in s_date .

Note: Reward all answers which are helpful to you