2015 May 10 9:37 PM
Hi,
I have an internal table itab1
itab1:
f1
400
200
700
for that entries i am selecting data from another db table using FOR ALL ENTRIES and i am getting data in sorted manner as below:
f1 f2
200 545
400 222
700 845
So how to get my original order back.
2015 May 11 3:33 AM
Hi,
You'll have to sort Table2 the same way you sorted Table1.
The database table doesn't hold rows in any defined order, so you'll never know what you'll get - you have to sort the result yourself.
cheers
Paul
2015 May 11 3:33 AM
Hi,
You'll have to sort Table2 the same way you sorted Table1.
The database table doesn't hold rows in any defined order, so you'll never know what you'll get - you have to sort the result yourself.
cheers
Paul
2015 May 11 4:05 AM
Hi Krishna,
After getting data into second internal table move the data into another (third) internal table and refresh the second table. When you are moving the data into new table, loop the first table and read the second table with key as 'f1'.
LOOP AT TABLE1 INTO WA1.
READ TABLE TABLE2 INTO WA2 WITH KEY F1 = WA1-F1.
IF SY-SUBRC = 0.
APPEND WA2 TO TABLE3.
ENDIF.
ENDLOOP.
REFRESH TABLE2.
Regards,
Vijay