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: 

type and like -----tell me the different

former_member192022
Participant
0 Kudos

data:begin of line,

col1 type i,

col2 type i,

end of line.

data:itab <b>like</b> table of line,

jtab <b>type</b> table of line.

what is the different between itab and jtab?

where can i find the help file?

1 ACCEPTED SOLUTION

anversha_s
Active Contributor
0 Kudos

hi,

chk this link.

http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb367a358411d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/frameset.htm

LIKE means the datatype of the variable is similar to the referenced variable.

TYPE means it is a predefined data type.

Eg:

DATA int TYPE i.

Here int is of integer data type.

DATA var LIKE int.

var IS a variable having same data type of int. which in turn is integer.

You can find these helpful when you reference database table variables... You need not know what is the datatype defined.

Also it adds to FLEXIBILITY.

Whenever you make changes to your database tables and fields,

that change is REFLECTED back to your program that is,

You need not change all your program code when you change your table fields...

Hope you understand and appreciate the flexibility that SAP provides to the programmers...

rgds

anver

Message was edited by: Anversha s

5 REPLIES 5

anversha_s
Active Contributor
0 Kudos

hi,

chk this link.

http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb367a358411d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/frameset.htm

LIKE means the datatype of the variable is similar to the referenced variable.

TYPE means it is a predefined data type.

Eg:

DATA int TYPE i.

Here int is of integer data type.

DATA var LIKE int.

var IS a variable having same data type of int. which in turn is integer.

You can find these helpful when you reference database table variables... You need not know what is the datatype defined.

Also it adds to FLEXIBILITY.

Whenever you make changes to your database tables and fields,

that change is REFLECTED back to your program that is,

You need not change all your program code when you change your table fields...

Hope you understand and appreciate the flexibility that SAP provides to the programmers...

rgds

anver

Message was edited by: Anversha s

0 Kudos

refer this same thread.

0 Kudos

refer this same thread.

Former Member
0 Kudos

If you use the addition TYPE, you can either reference to an inbuilt ABAP type, a predefined elementary type in the local program, or to a data element defined in the ABAP Dictionary. If you use a LIKE reference, dobj can be an existing data object with an elementary data type. If you do not use the TYPE or LIKE addition, the system uses the default predefined type c.

DATA counts TYPE i.

TYPES: company TYPE spfli-carrid,

no_flights LIKE counts.

This example shows how you can use the TYPE addition to refer to a column (CARRID) of a database table (SPFLI). The LIKE addition refers to an existing data object.

I hope it helps.

Best Regards,

Vibha

*Please mark all the helpful answers