‎2007 May 10 6:15 AM
Giving below is my select statement. Plz check it and tel;l is itr right or do i need to add anything else into this.
data: wa_bkpf like bkpf.
select single * from bkpf into wa_bkpf where belnr = p_belnr.
select * from bseg into corresponding fields of table itab
where belnr = wa_bkpf-belnr.
loop at itab where belnr = wa_bkpf-belnr.
endloop.
‎2007 May 10 6:16 AM
Hi,
If you have company code & year then you can give it in the BKPF select..
Thanks,
Naren
‎2007 May 10 6:16 AM
Hi,
If you have company code & year then you can give it in the BKPF select..
Thanks,
Naren
‎2007 May 10 6:17 AM
‎2007 May 10 6:21 AM
Hi,
All your staetment are correct.
But for the 'for loop' , no need to write the condition 'belnr = wa_bkpf-belnr'.
For the table itab you will get the records which will satisfy the condition
belnr = wa_bkpf-belnr only.
Regards,
Balakrishna.N
‎2007 May 10 6:22 AM
hi,
chk this way.
tables : bkpf,bseg.
data: wa_bkpf like bkpf,
p_belnr like bseg-belnr.
data : Begin of itab occurs 0.
include structure bseg.
data : end of itab.
*avoid INTO CORRESPONDING
select * from bseg into table itab where belnr = p_belnr.
if itab[] is not initial.
loop at itab.
endloop.
endif.Regards
Reshma
‎2007 May 10 6:30 AM
HI,
In the BKPF select you have to pass Company code and fiscal year, since you are using select single (full key has to give).
Same will pass in the BSEG also.
No need to use the Where condition in the loop.
Regards
Sabu