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

clarification regarding TYPES

Former Member
0 Likes
807

Hi all,

I need clarification regarding below code....

TYPES: BEGIN OF TY_TAB,

VBELN TYPE VBAK-VBELN,

ERDAT TYPE VBAK-ERDAT,

END OF TY_TAB.

TYPES: TAB TYPE TY_TAB OCCURS 1.

From the above code What exactly TAB means whether it is an internal table with header line or else only work area or else is it a structure?

Thanks & Regards.

Laxman.P

B'lore

6 REPLIES 6
Read only

Former Member
0 Likes
758

TYPES: BEGIN OF TY_TAB,

VBELN TYPE VBAK-VBELN,

ERDAT TYPE VBAK-ERDAT,

END OF TY_TAB.

TYPES: TAB TYPE TY_TAB OCCURS 1.

all the above statements are TYPES. The first one is the TYPES definitation for a structure. The second is a table type definitition.

Only WHEN YOU USE DATA statement the memory is allocated.

so you need to have

DATA: IT_TAB TYPE TAB.

ONLY When you have a data statement the definitaiton is complete.

Cheers

VJ

Read only

0 Likes
758

Hi VJ,

Table type definition means that TAB comes under structure or internal table?

Regards.

Laxman.P

Read only

0 Likes
758

Its a table. Coz they have used OCCURS 0 in the types.

Cheers

VJ

Read only

Former Member
0 Likes
758

It is just another TYPE.. An itab/wa/structure has to be declared with the keyword DATA referencing a TYPE.

Arya

Read only

Former Member
0 Likes
758

Hi laxman

The type that you declare is type of internal table. you can create internal table by reference this type.

Example

Data it_tab type ty_tab.

it_tab is internal table , not a structure.

Regards

Wiboon

Read only

Former Member
0 Likes
758

This message was moderated.