‎2008 Dec 29 9:26 AM
TYPES: BEGIN OF t_bkpf,
include structure bkpf.
bukrs LIKE bkpf-bukrs,
belnr LIKE bkpf-belnr,
gjahr LIKE bkpf-gjahr,
bldat LIKE bkpf-bldat,
monat LIKE bkpf-monat,
budat LIKE bkpf-budat,
xblnr LIKE bkpf-xblnr,
awtyp LIKE bkpf-awtyp,
awkey LIKE bkpf-awkey,
END OF t_bkpf.
Here in this declaration what is the usage of include structure bkpf. where it will and why it will use?
Regards,
chalapathi
‎2008 Dec 29 9:30 AM
Hello,
Using 'include structure <structure name>' in your local structure declaration of the program you are actually getting all the fields defined in the same structure in DDIC in your program too and with in you case you took the fields defined in the structure + the fields that you have defined in the local declaration of the structure. So the new structure will now contains the DDIC structure fields + the fields that you have declared.
Hope I am clear.
Regards,
Jayant
‎2008 Dec 29 9:33 AM
hi,
if you have the following code,
" include structure bkpf ."
then all fields in the structure(database) bkpf are included in the local structure you are defining for programing purpose.you need to mention every field especially.
Regards,
Veeresh
‎2008 Dec 29 9:35 AM
Hi,
It is not allowed to enter both the structure as include and then the field name of structure in the types. Syntax error will come.
‎2008 Dec 29 9:39 AM
then if we use only include structure what is the usage of using this?
thanks
‎2008 Dec 29 9:35 AM
Use F1 first and then search in sdn u'll get a lot of information regarding the question u have asked.
Edited by: kartik tarla on Dec 29, 2008 3:06 PM
‎2008 Dec 29 9:44 AM
hi,
go to transaction ABAPHELP
and write include structure.
it will give you information .
hope it helps you.
thanks
Sachin
‎2008 Dec 29 9:58 AM
> Total Questions: 137 (105 unresolved)
Often one of the symtoms of easily searchable questions, is that they remain unresolved.
Please use the search first, then ask questions later.
‎2008 Dec 29 10:51 AM
Hi
When you define a structure rec (with DATA or TYPES ), this statement copies the components of the structured data type subRec to the structure rec .
Since you can define nested data structures (i.e. structures with sub-structures) starting from Release 3.0, you should use INCLUDE STRUCTURE only if you want to introduce types in a program first and nested structures in a later step.
A data definition
DATA: BEGIN OF rec.
INCLUDE STRUCTURE subRec.
DATA: END OF rec.
is equivalent to
DATA rec LIKE subRec.
Even if the structure rec to be defined contains additional components, instead of
DATA: BEGIN OF rec,
...
INCLUDE STRUCTURE subRec.
DATA: ...
END OF rec.
you should use
DATA: BEGIN OF rec,
...
rec LIKE subRec,
...
END OF rec.
so that subRec can be referenced as a sub-structure of rec .
Regards,
Sathish
‎2008 Dec 30 5:07 AM
Hi,
Include structure <Structure Name> declarationin in local structure means defined as all fields in BKPF same as DDIC. But in your case your are declared and also you included structure. Please follow any one type of declaration based on requrement.
Thanks & Regards
Md.MahaboobKhan
‎2008 Dec 30 11:53 AM
Hi
here is ur code.....
BEGIN OF t_bkpf,
include structure bkpf.
bukrs LIKE bkpf-bukrs,
belnr LIKE bkpf-belnr,
gjahr LIKE bkpf-gjahr,
bldat LIKE bkpf-bldat,
monat LIKE bkpf-monat,
budat LIKE bkpf-budat,
xblnr LIKE bkpf-xblnr,
awtyp LIKE bkpf-awtyp,
awkey LIKE bkpf-awkey,
END OF t_bkpf.
in this way u r declaring the same fields two times one as i make them bold and other that i make underline.
i think now u can understand the use of include (i.e. we can declare the fields in one go)
Edited by: adesh kumar on Dec 30, 2008 12:53 PM
‎2009 Jan 02 3:51 AM
It mean your are creating a struture which contains all the fields of BKPF plus some additional fileds.
‎2009 Jan 05 8:59 AM
Hi ,
The purpose of the Include structure is to include all the fileds of the respective table (BKPF) to the custom data type which you are declaring.
If this is not used then it is too tedious to include all the fields of the table into this data type manually by declaration.
Regards,
Radhika.
‎2009 Jan 28 5:03 AM
‎2009 Jan 28 7:18 AM