‎2005 Jun 24 10:39 AM
Hi ,
I need to declare a internal table with the combination of two tables(BKPF and BSEG).But the declaration like below has syntax error since
there are some common fields in both the tables .
data:begin of t_bkbs occurs 0.
include structure bkpf.
include structure bseg.
data:end of t_bkbs.
Is there any other way to solve this problem.
Thanks in advance .
Regards,
Raj
‎2005 Jun 24 10:45 AM
Hi,
declare as follows.
data : begin of t_bkbs occurs 0.
include struture bkpf.
data : buzei type bseg-buzei,
...
...like that declare fields in bseg which is not in bkpf
end of t_bkbs.
‎2005 Jun 24 10:46 AM
Hi,
Declare the internal table with common fields from both the tables, for ex,
tab1 & tab2 are 2 dbtables
types: begin of wa_tab,
fld1 like tab1-fld1, " from tab1
fld2 like tab1-fld2,
fld3 like tab2-fld1, " from tab2
end of it_tab.
declare an internal table from the work area defined earlier. Hope this helps,
Rgds,
‎2005 Jun 24 11:08 AM
Hi,
TYPES : BEGIN OF pfra0_pcale,
annee(4) TYPE c.
INCLUDE STRUCTURE pcint.
TYPES : END OF pfra0_pcale.
Try like this.
‎2005 Jun 24 11:09 AM
Hi,
look, if you can use one of the following structures :
BSIK,BSID,BSIS,ACCIT which include the important fields of bkpf and bseg.
regards Andreas
‎2005 Jun 24 11:21 AM
Hi
Try this
DATA: BEGIN OF t_bkbs OCCURS 0.
INCLUDE STRUCTURE bkpf AS k .
INCLUDE STRUCTURE bseg AS s .
DATA: END OF t_bkbs.
*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>
‎2005 Jun 24 11:27 AM
Hi ,
I need all the fields of BKPF and BSEG .
I am looking for the simplest way of declaring internal table .Declaring one table as structure and other as individual fields will be a lengthy declaration(BSEG has 350 fields)
.Is there any other simplest way of declaring this internal table .
Thanks all for your views.
Regards,
Raj
‎2005 Jun 24 11:59 AM
Hi,
Declare a type which is similar to table type, for ex,
types: t_bseg type bseg.
use the type as one of the line types to declare the internal table, for ex,
DATA itab_bseg TYPE STANDARD TABLE OF t_bseg
initial size 0 with header line.
Hope this helps.
Rgds,
‎2005 Jun 24 1:52 PM
Hi Raja
Did you try :
DATA: BEGIN OF t_bkbs OCCURS 0.
INCLUDE STRUCTURE bkpf AS k .
INCLUDE STRUCTURE bseg AS s .
DATA: END OF t_bkbs.This way you can reach a field via, e.g. <b>'t_bkbs-k<i>-<fieldname></i>'</b>.
<u>Alternatively;</u>
DATA: BEGIN OF t_bkbs OCCURS 0.
bkpf_str LIKE bkpf .
bseg_str LIKE bseg .
DATA: END OF t_bkbs.This way you can reach a field via e.g. <b>'t_bkbs-bkpf_str<i>-<fieldname></i>'</b>.
<u>Alternatively;</u>
Create a new structure, e.g. ZBKBS, in DDIC and include bseg and bkpf there. Then, in your program refer to this DDUC structure.
*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>