‎2008 Jul 10 1:30 PM
Hi Friends,
I have given the innerjoin between BKPF & BSEG tables,
And i am fetching BUKRS, BELNR,GJAHR, BLART,BLDAT,BUDAT fields from BKPF and BUZEi from BSEG table, but it is showing error as u cannot create inner join for BSEG table,
Kindly help me on this .
Thanks & Regards,
‎2008 Jul 10 1:34 PM
‎2008 Jul 10 1:32 PM
Hi,
Yes. JOINS are not allowed in Cluster tables.
Fetch the values separately.
Cheers
Kothand
‎2008 Jul 10 1:34 PM
‎2008 Jul 10 1:45 PM
Hi Ravi C,
Tyr it like the below example and rewards point if useful to u.
select belnr gjahr bukrs blart bldat budat from bkpf into table itab_bkpf where budat in p_date and bukrs in p_bukrs.
if not itab_bkpf[] is initial.
select belnr buzei from bseg into table itab_bseg for all entries in itab_bkpf where belnr eq itab_bkpf-belnr and gjahr eq itab_bkpf-gjahr.
endif.
Note: using bseg table may affect in performance.
regards
sankar.
‎2008 Jul 11 8:03 AM
Hi,
I using the code like this,
It displaying the output without displaying any data in BUZEI field, Even i have given the field name in the field catalog.
Could u plz help me on this,
Waiting for ur reply.
TYPES : BEGIN OF T_BKPF,
BUKRS TYPE BKPF-BUKRS,
BELNR TYPE BKPF-BELNR,
GJAHR TYPE BKPF-GJAHR,
BLART TYPE BKPF-BLART,
BLDAT TYPE BKPF-BLDAT,
BUDAT TYPE BKPF-BUDAT,
BUZEI TYPE BSEG-BUZEI,
END OF T_BKPF.
types: begin of t_bseg,
BUKRS TYPE BSEG-BUKRS,
BELNR TYPE BSEG-BELNR,
GJAHR TYPE BSEG-GJAHR,
end of t_bseg.
DATA : it_bkpf TYPE STANDARD TABLE OF t_bkpf with header line,
wa_bkpf TYPE t_bkpf,
it_bseg type standard table of t_bseg.
wa_bseg type t_bseg.
select bukrs belnr gjahr from bseg into table it_bseg.
perform data_retrieval_bseg.
perform data_retrieval.
form data_retrieval_bseg .
select buzei from bseg into table it_bkpf.
endform. " data_retrieval_bseg
&----
*& Form DATA_RETRIEVAL
&----
form data_retrieval.
IF it_bseg[] IS NOT INITIAL.
select bukrs belnr gjahr blart bldat budat from bkpf into
table it_bkpf for all entries in it_bseg
where bukrs = it_bseg-bukrs
and belnr = it_bseg-belnr
and gjahr = it_bseg-gjahr.
endif.
endform.
‎2011 Jun 14 12:48 PM
Hi Ravi,
the mistake which was done by you that, in recent version of SAP, BUZEI field is not available in the table BKPF. it is available
from the table BSEG. So, try to fetch BUZEI from BSEG, not from BKPF.
hopefully this will help you to solve you to solve the issue. another thing, try to write the codes as per the event firing.
<points begging removed by moderator>
Regards
Mrinmoy
Edited by: Thomas Zloch on Jun 15, 2011 1:30 PM
‎2011 Jun 14 1:26 PM
Hi,
Why ur wirting one more select query for getting BUZEI from BSEG table. right the code like below
TYPES : BEGIN OF T_BKPF,
BUKRS TYPE BKPF-BUKRS,
BELNR TYPE BKPF-BELNR,
GJAHR TYPE BKPF-GJAHR,
BLART TYPE BKPF-BLART,
BLDAT TYPE BKPF-BLDAT,
BUDAT TYPE BKPF-BUDAT,
*BUZEI TYPE BSEG-BUZEI,"comment the BUZEI here
END OF T_BKPF.
types: begin of t_bseg,
BUKRS TYPE BSEG-BUKRS,
BELNR TYPE BSEG-BELNR,
GJAHR TYPE BSEG-GJAHR,
BUZEI TYPE BSEG-BUZEI," add the field here
end of t_bseg.
DATA : it_bkpf TYPE STANDARD TABLE OF t_bkpf with header line,
* wa_bkpf TYPE t_bkpf,
it_bseg type standard table of t_bseg.
* wa_bseg type t_bseg.
select bukrs belnr gjahr BUZEI "add the BUZEI here
from bseg into table it_bseg.
*perform data_retrieval_bseg."comment the perform
perform data_retrieval.
*form data_retrieval_bseg .
*select buzei from bseg into table it_bkpf."no need to call one more select query
*endform. " data_retrieval_bseg
form data_retrieval.
IF it_bseg[] IS NOT INITIAL.
select bukrs belnr gjahr blart bldat budat from bkpf into
table it_bkpf for all entries in it_bseg
where bukrs = it_bseg-bukrs
and belnr = it_bseg-belnr
and gjahr = it_bseg-gjahr.
endif.
endform.
Regards,
Dhina..
‎2011 Jun 14 2:06 PM
‎2008 Jul 10 1:45 PM
Hi,
Being BSEG a Cluster Table, so you cannot write the JOINS on it, instead of this get BKPF details and fetch the relavent details from the BSEG.
‎2008 Jul 10 2:11 PM
hello,
as BSEG is a cluster table u cannot use join for it , it also affects the performance.
do like this as BSEG data is segregrated to different tables based on customer , vendor and GL.
for customer use tables BSID, BSAD
for vendor use tables BSIK,BSAK
for GL use tables BSIS, BSAS.
Based on ur requirement see from which table u can get that data. and use Join for BKPF and corresponding table.
Rgds.,
subash
‎2008 Jul 11 8:25 AM
Hi,
And i am fetching BUKRS, BELNR,GJAHR, BLART,BLDAT,BUDAT fields from BKPF and BUZEi from BSEG
exactly what they said before. BSEG is the cluster table we cant use JOINS condition when we are fetching the data from cluster table and transparent tables. on that situation we have to use FOR ALL ENTRIES performance wise which is best one
just try this code.
select bukrs belnr gjahr blart bldat budat
into table i_bkpf
from bkpf
where <condition>.
if not i_bkpf[] is initial.
select buzei
into table i_bseg
from bseg for all entries in i_bkpf
where bukrs = i_bkpf-bukrs
and belnr = i_bkpf-belnr
and gjahr = i_bkpf-gjahr..
endif.
regards.
sriram.