ā2012 Nov 12 5:18 PM
Hi All,
Can i read table without deaclaring internal table as a sorted table.
means if we will not declar internal table as a sorted table than can we use read table concept.
Moderator message: please search for available information and documentation before posting.
Message was edited by: Thomas Zloch
ā2012 Nov 12 5:24 PM
Yes you can use it with out sorting an Internal table but the read statement should not be a Binary search addition.
For Binary search the internal table should be sorted for normal read no need to sort.
ā2012 Nov 12 5:39 PM
data : itab type table of crmd_orderadm_h,
stru like line of itab.
read itab with table key guid = '22334' into stru.
This code will execute or not. or we have to declare itab as sorted table.
DATA itab type sorted TABLE OF crmd_orderadm_h WITH UNIQUE KEY col1.
stru like line of itab.
read itab with table key guid = '22334' into stru.
ā2012 Nov 12 5:28 PM
Your question is not much clear.
So, you can create internal table with hashed also. For this method you have to provide unique key whereas for sorted you can also use non-unique key. And you can use read with hashed internal table also.
And if you don't want to use internal tables then you can use SELECT-ENDSELECT command. But this method is not recommended.
ā2012 Nov 12 5:39 PM
data : itab type table of crmd_orderadm_h,
stru like line of itab.
read itab with table key guid = '22334' into stru.
This code will execute or not. or we have to declare itab as sorted table.
DATA itab type sorted TABLE OF crmd_orderadm_h WITH UNIQUE KEY col1.
stru like line of itab.
read itab with table key guid = '22334' into stru.
ā2012 Nov 12 5:59 PM
Yes, this will execute but take more time in searching as this will use linear search whereas if you use sorted or hashed table, search time will be less.
ā2012 Nov 12 6:23 PM