09-24-2008 3:06 AM
Hi guru's,
can any body tell me how to join the rbkp, bkpf and bseg tables pls.
Thanks & Best Regards,
Rakhi.
09-24-2008 5:16 AM
Hi,
There is a field named AWKEY in BKPF. It'll contain the value of RBKP-BELNR concatenated with RBKP-GJAHR. Just take another field of type BKPF-AWKEY and concatenate RBKP-BELNR ,RBKP-GJAHR into this field and pass it to BKPF. You'll get the required document from BKPF. Then you can go to BSEG using the document and fiscal year found from BSEG . It worked for me.
09-24-2008 3:12 AM
Hi,
You can join
RBKP-BELNR = BKPF-BELNR
RBKP-GJAHR = BKPF-GJAHR
RBKP-BUKRS = BKPF-BUKRS
You can not join using BSEG table since its a Cluster Table
So you can join RBKP & BKPF and use for all entries to get BSEG data.
Regards
Gopi
09-24-2008 3:13 AM
Hi,
In both the table the common key fields are BELNR and GJAHR.
With this fields specified in 'ON' part of the join statement,
you can do this.
Further conditions can be set.
Regards,
R.Nagarajan.
09-24-2008 5:16 AM
Hi,
There is a field named AWKEY in BKPF. It'll contain the value of RBKP-BELNR concatenated with RBKP-GJAHR. Just take another field of type BKPF-AWKEY and concatenate RBKP-BELNR ,RBKP-GJAHR into this field and pass it to BKPF. You'll get the required document from BKPF. Then you can go to BSEG using the document and fiscal year found from BSEG . It worked for me.
09-24-2008 7:05 AM
hi jayasre,
thanks for ur very help full answer.
i want to get the field belnr from bkpf table when i selected the belnr in the selection screen is from the table rbkp.
can u please give me the idea of this how to concotenate.
Thanks & Best Regards,
Rakhi.
09-24-2008 12:21 PM
data : begin of it_rbkp occurs 0.
include structure rbkp.
data : awkey like bkpf-awkey,
end of it_rbkp.
data : begin of it_bkpf occurs 0.
include structure bkpf.
data : end of it_bkpf.
select * from rbkp into corresponding fields of table it_rbkp
where belnr in belnr and gjahr in gjahr.
loop at it_rbkp.
concatenate it_rbkp-belnr it_rbkp-gjahr into it_rbkp-awkey.
modify it_rbkp transporting awkey.
endloop.
select * from bkpf into corresponding fields of table it_bkpf
for all entries in it_rbkp where awkey = it_rbkp-awkey.
I have tried in this manner. it worked for me.
09-24-2008 1:19 PM
Join are usually not preferred as they impose perfomance issues - Please use for all entries instead, and if you really want to try out use views and retrieve your data at once.