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

Please explain the following declaration

Former Member
0 Likes
2,227

Hi,

The declaration is :

DATA: BEGIN OF BDCDATA OCCURS 0.

INCLUDE STRUCTURE BDCDATA.

DATA: END OF BDCDATA.

I don't know the meaning about the above the declaration,especially, at "INCLUDE STRUCTURE".

Please,explain it.

Thanks very much.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,856

Hi

The declaration is :

DATA: BEGIN OF BDCDATA OCCURS 0.

INCLUDE STRUCTURE BDCDATA.

DATA: END OF BDCDATA.

1. In the declaration,

Data : begin of bdcdata occurs0

An internal table ''bdcdata'' is getting created .

2. include structure bdcdata

it includes structure BDCDATA in the internal table that is created above ie bdcdata

It means all fields (names , datatypes and length )that are in standard structure BDCDATA are included in the internal table.

the other way of writing it is :

data : begin of itab occurs 0.

include structure BDCDATA.

data : end of itab.

Another form,

data : begin of itab occurs 0,

f1 type BDCDATA-PROGRAM,

f2 type BDCDATA-DYNPRO,

f3 type BDCDATA-DYNBEGIN,

f4 tyoe BDCDATA-FNAM,

f5 type BDCDATA-FVAL,

end of itab.

hope its helpful.

Reward points if useful.

Regards

Megha Sharma

It will include all the elements/fields declared in structure BDCDATA.

Generally we use this statement when we dont want to write Types and Data statement.

If we dont write the statement above then we need to write like this :



Data : Begin of IT_DATA occurs 0,
          program type bdcdata-program,
          dynpro   type bdcdata-dynpro,
          .
          .
          End of IT_DATA.

reward If found Helpfull.

12 REPLIES 12
Read only

Former Member
0 Likes
1,856

HI

It means you include all fields of BDCDATA in your ITAB.

Otherwise you have to do like this

data: begin of itab

f1 like bdcdata-f1,

f2 like bdcdata-f2

-


end of itab.

Regards

Aditya

Read only

Former Member
0 Likes
1,856

It will include all the elements/fields declared in structure BDCDATA.

Generally we use this statement when we dont want to write Types and Data statement.

If we dont write the statement above then we need to write like this :



Data : Begin of IT_DATA occurs 0,
          program type bdcdata-program,
          dynpro   type bdcdata-dynpro,
          .
          .
          End of IT_DATA.

reward If found Helpfull.

Read only

Former Member
0 Likes
1,856

Hi Chen,

This declaration creates an internal table BDCDATA. The line type for the internal table is the standard structure BDCDATA.

Double click on BDCDATA (include structure BDCDATA line) and you will see the structure details.

Regards,

Aravinda Sarma M.

Read only

Former Member
0 Likes
1,856

Hi,

1.You are declaring a Internal table with the structure field of BDCDATA like program,dynpro,dynbegin,fnam,fvalue.

2.we are using it in the BDC .

Regards,

Shiva Kumar

Read only

Former Member
0 Likes
1,856

Hi,

BDCDATA is the standard structure and where in the declaration you are including the whole structure for internal table rather than assigning each and every fields of the structure.

Hope this clears your doubt.

Regards,

Ramkumar.K

Read only

Former Member
0 Likes
1,856

Hi

it creates BDCDATA internal table structure of BDCDATA.

when double click on BDCDATA , it goes to stucture BDCDATA, there we can see fields of BDCDATA

EX:

data: begin of t_zregion occurs 20.

include structure zregion.

data: end of t_zregion.

thanks

sitaram

Read only

Former Member
0 Likes
1,856

HI

THE INCLUDE STATEMENT INCLUDES ALL THE FIELDS OF THE STANDARD STRUCTURE BDCDATA IN YOUR INTERNAL TABLE.

KINDLY CLOSE THE QUESTION.

AND REWARD IF HELPFUL.

REGARDS

NIHARIKA

Read only

Former Member
0 Likes
1,856

hi

first,

bdcdata is a structure in ddic. whenever u declare internal table u declare it based on some structure rite.

bdcdata has five components in its structure which makes the bdc run (ie). wen u do recording for bdc's u are capturin some screens and fields. these five components constitute of screen no. field name that u r capuring on the screen etc..

so to include a structre for ur internal table use u have used include structure in the progarm.. now ur internal table bdcdata is having the structure of bdcdata 0f ddic.

hope this clears ur doubt

reward points if helpful

regards

mano

Read only

Former Member
0 Likes
1,857

Hi

The declaration is :

DATA: BEGIN OF BDCDATA OCCURS 0.

INCLUDE STRUCTURE BDCDATA.

DATA: END OF BDCDATA.

1. In the declaration,

Data : begin of bdcdata occurs0

An internal table ''bdcdata'' is getting created .

2. include structure bdcdata

it includes structure BDCDATA in the internal table that is created above ie bdcdata

It means all fields (names , datatypes and length )that are in standard structure BDCDATA are included in the internal table.

the other way of writing it is :

data : begin of itab occurs 0.

include structure BDCDATA.

data : end of itab.

Another form,

data : begin of itab occurs 0,

f1 type BDCDATA-PROGRAM,

f2 type BDCDATA-DYNPRO,

f3 type BDCDATA-DYNBEGIN,

f4 tyoe BDCDATA-FNAM,

f5 type BDCDATA-FVAL,

end of itab.

hope its helpful.

Reward points if useful.

Regards

Megha Sharma

Read only

Former Member
0 Likes
1,856

Thanks.

May I write as the following style?

DATA: BEGIN OF BDCDATA OCCURS 0,

INCLUDE STRUCTURE BDCDATA,

END OF BDCDATA.

Read only

matt
Active Contributor
0 Likes
1,856

yes

Read only

0 Likes
1,856

nah, it has to be

DATA: BEGIN OF BDCDATA OCCURS 0.

INCLUDE STRUCTURE BDCDATA.

DATA: END OF BDCDATA.

or syntax error.