‎2008 Oct 21 12:43 PM
Hi all,
I am having a Ztable (Zacc) wih the fileds BELNR and BUKRS and we had maitained some DATA manually in the Ztable
Now i need to write an select query to fetch the DATA from BKPF tabele for all the records which are present ZTABLE
BELNR is the primary key in both the tables BKPF and Zacc
Please give me the select query
Thanks in advance
Ajay
‎2008 Oct 21 12:48 PM
Hi ,
Get the Zacc details into one internal table .Then you can use for all entries .
ex :
select bukrs belnr into it_bseg
from bseg
for all entries in zacc
where bseg-bukrs eq zacc-bukrs .
‎2008 Oct 21 12:46 PM
treat Ztable as other standard SAP table.frst fetch data from Ztable than fire for all entries at Ztable while secting data from BKPF table.
‎2008 Oct 21 12:48 PM
Hi ,
Get the Zacc details into one internal table .Then you can use for all entries .
ex :
select bukrs belnr into it_bseg
from bseg
for all entries in zacc
where bseg-bukrs eq zacc-bukrs .
‎2008 Oct 21 12:53 PM
SELECT belnr FROM zacc INTO TABLE it_itab.
SELECT belnr bukrs buzei FROM bseg INTO CORRESPONDING FIELDS TABLE it_bseg FOR ALL ENTRIES IN it_itab WHERE belnr = it_itab-belnr
AND gjahr = p_gjahr.
Regards
Bala Krishna
‎2008 Oct 21 1:12 PM
hi
You can use Query as....
1.) Select BELNR BUKRS into IT_TABLE1
FROM Ztable
(based on Condition).
2.) Select DATA.... into IT_TABLE2
FROM BKPF
FOR ALL ENTIRES in IT_TABLE1
WHERE BELNR = IT_TABLE1-BELNR.
Second Query will fetch all the data based on data present in ztable.
hope this will solve your Problem.
Regards,
Mandeep.