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: 

table join

Former Member
0 Kudos

Hi guru's,

can any body tell me how to join the rbkp, bkpf and bseg tables pls.

Thanks & Best Regards,

Rakhi.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

6 REPLIES 6

gopi_narendra
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

0 Kudos

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.

0 Kudos

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.

Former Member
0 Kudos

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.