Application Development and Automation 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: 
Read only

Include structure

Former Member
0 Likes
1,860

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

14 REPLIES 14
Read only

Former Member
0 Likes
1,590

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

Read only

former_member673464
Active Contributor
0 Likes
1,590

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

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,590

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.

Read only

0 Likes
1,590

then if we use only include structure what is the usage of using this?

thanks

Read only

Former Member
0 Likes
1,590

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

Read only

Former Member
0 Likes
1,590

hi,

go to transaction ABAPHELP

and write include structure.

it will give you information .

hope it helps you.

thanks

Sachin

Read only

Former Member
0 Likes
1,590

> 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.

Read only

Former Member
0 Likes
1,590

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

Read only

Former Member
0 Likes
1,590

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

Read only

Former Member
0 Likes
1,590

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

Read only

Former Member
0 Likes
1,590

It mean your are creating a struture which contains all the fields of BKPF plus some additional fileds.

Read only

Former Member
0 Likes
1,590

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.

Read only

Former Member
0 Likes
1,590

jj

Read only

0 Likes
1,590

>

> jj

Yep, that together with "asdf" is another symptom.