Application Development 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: 

Hi

Former Member
0 Kudos

Hi,

In this program what is meant by line type, table type and field string and what its effects when we execute.

Bcoz when iam executing this its not giving any result.

LINE TYPE:

TYPES:

BEGIN OF TY_EMP,

EMPID(4) TYPE N,

ENAME(20) TYPE C,

SALARY TYPE I,

END OF TY_EMP.

DATA:

FS_EMP TYPE TY_EMP,

IT_EMP TYPE TY_EMP OCCURS 0.

*TABLE TYPE:

TYPES:

TAB_EMP TYPE TABLE OF TY_EMP.

FS_EMP-EMPID = 1000.

FS_EMP-ENAME = 'ANIL'.

FS_EMP-SALARY = 10000.*APPEND FS_EMP TO IT_EMP.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi

LINE TYPE: " this is a structure type which is being declared.... this is the structure which the user wants...or in otherwords his line type

TYPES: "definition of the structure

BEGIN OF TY_EMP,

EMPID(4) TYPE N,

ENAME(20) TYPE C,

SALARY TYPE I,

END OF TY_EMP.

DATA:

FS_EMP TYPE TY_EMP, "declaring a work area of ur stucture type

IT_EMP TYPE TY_EMP OCCURS 0. "declaring an internal table of your structure type with an header work area(occurs 0) but syntax is wrong... its type table of... bcz only an internal table can have an header wrk area

*TABLE TYPE:

TYPES:

TAB_EMP TYPE TABLE OF TY_EMP. "defining a table and appending values to it

FS_EMP-EMPID = 1000.

FS_EMP-ENAME = 'ANIL'.

FS_EMP-SALARY = 10000.*APPEND FS_EMP TO IT_EMP.

The meaning of the code is typed next to the code line

<b>please reward points if useful</b>

3 REPLIES 3

Former Member
0 Kudos

hi

LINE TYPE: " this is a structure type which is being declared.... this is the structure which the user wants...or in otherwords his line type

TYPES: "definition of the structure

BEGIN OF TY_EMP,

EMPID(4) TYPE N,

ENAME(20) TYPE C,

SALARY TYPE I,

END OF TY_EMP.

DATA:

FS_EMP TYPE TY_EMP, "declaring a work area of ur stucture type

IT_EMP TYPE TY_EMP OCCURS 0. "declaring an internal table of your structure type with an header work area(occurs 0) but syntax is wrong... its type table of... bcz only an internal table can have an header wrk area

*TABLE TYPE:

TYPES:

TAB_EMP TYPE TABLE OF TY_EMP. "defining a table and appending values to it

FS_EMP-EMPID = 1000.

FS_EMP-ENAME = 'ANIL'.

FS_EMP-SALARY = 10000.*APPEND FS_EMP TO IT_EMP.

The meaning of the code is typed next to the code line

<b>please reward points if useful</b>

Former Member
0 Kudos

Hi,

Line type --> This will create a Line with same as the header line for a table, This will be used as a header for a table

Table Type --> This will create a Structure, here the table type and Line type both will be come a table with the header line, i mean the Line type is the header then the table type is the body

Field String --> It is a notmal declaration of a String.

Regards

Sudheer

Former Member
0 Kudos

hi,

line type creates a workarea for any internal table

table type means creates a internal table similar to standard table . this is similar to occurs n keyword.

if helpful reward some points.

with regards,

Suresh.A