10-25-2007 6:45 AM
hello sir/medam.
i hane two pooled table BSEG and BSAK then i want joint the field together ..how use get command for that ....nd u have another solution plz tel me..
thanks
10-25-2007 6:53 AM
if u r doin sumthin like fb60 then...
use this.....
<b>TABLES: bsik, bsak, bseg.
SELECT-OPTIONS: s_bukrs FOR bsik-bukrs OBLIGATORY,
s_lifnr FOR bsik-lifnr OBLIGATORY.
DATA: BEGIN OF bsik_int OCCURS 0.
INCLUDE STRUCTURE bsik.
DATA: END OF bsik_int.
DATA: BEGIN OF bseg_int OCCURS 0.
INCLUDE STRUCTURE bseg.
DATA: END OF bseg_int.
SELECT * FROM bsik
INTO TABLE bsik_int
WHERE bukrs IN s_bukrs
AND lifnr IN s_lifnr.
SELECT * FROM bsak
APPENDING TABLE bsik_int
WHERE bukrs IN s_bukrs
AND lifnr IN s_lifnr.
SELECT * FROM bseg
INTO TABLE bseg_int
FOR ALL ENTRIES IN bsik_int
WHERE bukrs = bsik_int-bukrs
AND belnr = bsik_int-belnr
AND gjahr = bsik_int-gjahr
AND ebeln = space.</b>
10-25-2007 6:46 AM
You can not join BSEG on BSAK.
Since BSEG being a cluster table type.
Instead you can use FOR ALL ENTRIES for the internal table IT_BSAK.
select <FIELDS> from BSAK into table IT_BSAK.
if not it_bsak[] is initial.
select <FIELDS> from BSEG
for all entries in IT_BSAK
into table IT_BSEG
where BELNR = IT_BSAK-BELNR. " Match the common fields together
endif.
Regards
Gopi
10-25-2007 6:50 AM
1)It is recommended that
first select entries from only one table(say, BKPF), After that, using the internal table,
FOR ALL ENTRIES, and BSEG table,select the relevant entries from BSEG table.
Performance wise, this will be very fast.
2)you can't directly join on BSEG but depending on which data you want to access you might be able to use an alternative table. eg, BSID or BSAD for open or cleared customer items or BSIK/BSAK for open or cleared vendor items.
10-31-2007 8:49 AM
hello sir
select <FIELDS> from BSAK into table IT_BSAK.
if not it_bsak[] is initial.
select <FIELDS> from BSEG
for all entries in IT_BSAK
into table IT_BSEG
where BELNR = IT_BSAK-BELNR. " Match the common fields together
endif.
in this code, what purpose of if command...plz say detail
regard
mukesh
10-25-2007 6:53 AM
if u r doin sumthin like fb60 then...
use this.....
<b>TABLES: bsik, bsak, bseg.
SELECT-OPTIONS: s_bukrs FOR bsik-bukrs OBLIGATORY,
s_lifnr FOR bsik-lifnr OBLIGATORY.
DATA: BEGIN OF bsik_int OCCURS 0.
INCLUDE STRUCTURE bsik.
DATA: END OF bsik_int.
DATA: BEGIN OF bseg_int OCCURS 0.
INCLUDE STRUCTURE bseg.
DATA: END OF bseg_int.
SELECT * FROM bsik
INTO TABLE bsik_int
WHERE bukrs IN s_bukrs
AND lifnr IN s_lifnr.
SELECT * FROM bsak
APPENDING TABLE bsik_int
WHERE bukrs IN s_bukrs
AND lifnr IN s_lifnr.
SELECT * FROM bseg
INTO TABLE bseg_int
FOR ALL ENTRIES IN bsik_int
WHERE bukrs = bsik_int-bukrs
AND belnr = bsik_int-belnr
AND gjahr = bsik_int-gjahr
AND ebeln = space.</b>
10-25-2007 7:49 AM