2013 Jan 22 10:40 AM
**************************************************************************************************
REPORT demo_int_tables_read_index_bin.
DATA: BEGIN OF line,
col1 TYPE i,
col2 TYPE i,
END OF line.
DATA itab LIKE STANDARD TABLE OF line.
DO 4 TIMES.
line-col1 = sy-index.
line-col2 = sy-index ** 2.
APPEND line TO itab.
ENDDO.
SORT itab BY col2.
READ TABLE itab WITH KEY col2 = 16 INTO line BINARY SEARCH.
WRITE: 'SY-SUBRC =', sy-subrc.
***************************************************************
for the above program if i change at the line
"DATA itab LIKE STANDARD TABLE OF line."
like as type.
the following error is coming.can any body explain about the error?
2013 Jan 22 10:49 AM
Hi,
Here u already declared line as a structure.
it is not a standard table.
so from structure u can not declare directly by TYPE,but Like will works for that.
Thanks
Gourav.
2013 Jan 22 10:49 AM
Hi,
Here u already declared line as a structure.
it is not a standard table.
so from structure u can not declare directly by TYPE,but Like will works for that.
Thanks
Gourav.
2013 Jan 22 11:24 AM
Line is a keyword. Please use some other name for your structure.