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

Difference bw data, type, tables

Former Member
0 Likes
590

DATA: BEGIN OF wa_spfli,

carrid TYPE spfli-carrid,

END OF wa_spfli.

TYPES: BEGIN OF wa_spfli,

carrid TYPE spfli-carrid,

END OF wa_spfli.

TABELS: BEGIN OF wa_spfli,

carrid TYPE spfli-carrid,

END OF wa_spfli.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
552

Hi,

1)

DATA: BEGIN OF wa_spfli,

carrid TYPE spfli-carrid,

END OF wa_spfli.

Declares a work area where you can have values in the work area in the run time..

2)

TYPES: BEGIN OF wa_spfli,

carrid TYPE spfli-carrid,

END OF wa_spfli.

Declares a type where you can use in a work area..But you cannot have values in the TYPES in the run time.

3)

TABELS: BEGIN OF wa_spfli,

carrid TYPE spfli-carrid,

END OF wa_spfli.

I believe this is not possible.

Thanks,

naren

4 REPLIES 4
Read only

Former Member
0 Likes
553

Hi,

1)

DATA: BEGIN OF wa_spfli,

carrid TYPE spfli-carrid,

END OF wa_spfli.

Declares a work area where you can have values in the work area in the run time..

2)

TYPES: BEGIN OF wa_spfli,

carrid TYPE spfli-carrid,

END OF wa_spfli.

Declares a type where you can use in a work area..But you cannot have values in the TYPES in the run time.

3)

TABELS: BEGIN OF wa_spfli,

carrid TYPE spfli-carrid,

END OF wa_spfli.

I believe this is not possible.

Thanks,

naren

Read only

Former Member
0 Likes
552

Hi,

1)DATA: BEGIN OF wa_spfli,

carrid TYPE spfli-carrid,

END OF wa_spfli.

With DATA you are actually declaring the Variables with or without referencing the TYPES.DATA statements allocate the memory at runtime.

2)TYPES: BEGIN OF wa_spfli,

carrid TYPE spfli-carrid,

END OF wa_spfli.

With TYPES you are defining the data types that can be used by other variables/itabs in the program.TYPES statement defines the structure without allocation of memory.

3)TABELS: BEGIN OF wa_spfli,

carrid TYPE spfli-carrid,

END OF wa_spfli.

U can't use tables for defining a work area.

Regards,

Padmam.

Read only

Former Member
0 Likes
552

Hi,

1. TYPES statement defines the structure without allocation of memory, DATA statements allocate the memory at runtime.

2. Create a structure by using types statement and refer it by using the DATA statement.

3. In order to avoid the internal table declaration without header line, we are declaring a structure by types statemnet and declaring an internal table with reference to the structure.

Table Type is one of the DATA TYPES which we create and reference to this datatype

<b>Reward points</b>

Regards

Read only

Former Member
0 Likes
552

Hi,

DATA: BEGIN OF wa_spfli,

carrid TYPE spfli-carrid,

END OF wa_spfli.

U can now use wa_spfli as a work area.(ie) a structure.

TYPES: BEGIN OF wa_spfli,

carrid TYPE spfli-carrid,

END OF wa_spfli.

Here u have defined a data type.. so u cannot use wa_spfli as it is as a structure..

u can define str n tables using this data type..

eg. data str type wa_spfli ...............(define structure of that type)

data itab type table of wa_spfli .............(define internal table using the tupe defenition)

TABELS: BEGIN OF wa_spfli,

carrid TYPE spfli-carrid,

END OF wa_spfli.

Ucannot use tables like this..

Syntax is ..

Tables <database table>.

This will create a workarea(structure) of the same type as the database table

also it will have the same name at the dbtab.

Regards,

Aparna