11-06-2006 4:30 AM
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?
11-06-2006 4:33 AM
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
11-06-2006 4:31 AM
For TYPE
http://help.sap.com/saphelp_47x200/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm
For LIKE
http://help.sap.com/saphelp_47x200/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm
Regards,
Ravi
Note : Please mark all the helpful answers
11-06-2006 4:33 AM
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
11-06-2006 4:34 AM
11-06-2006 4:34 AM
11-06-2006 4:40 AM
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