2008 Aug 28 2:15 PM
Hi,
i have 2 tables itab1 and itab2
and i wont to sort itab1 like itab2 but i dont have the field that i sort by him (NODE_ID ).
there is a way to do it without add field nodid to iatb1 ?
Regards
ITAB 1
NODE_NAME
1 10OLDS-1000
2 10HEADQTR
3 10PST
4 10AS
5 10ZY03
6 10VENTITAB2
NODE_ID NODE_NAME
1 00000096 10ZY03
2 00000097 10AS
3 00000154 10HEADQTR
4 00000328 10PST
5 00000684 10VENT
6 00000712 10OLDS-1000
2008 Aug 28 2:23 PM
Code ur own logic to sort the table it cud be like
loop at itab2
loop at itab1.
then search for node_name in itab1 when found swap it then it ll come at same position as in itab2.
this is a rough logic if u've understood it u can refine it to get a better performing code.
regards,
kartik
Code ur own logic to sort the table it cud be like
loop at itab2
loop at itab1.
then search for node_name in itab1 when found swap it then it ll come at same position as in itab2.
this is a rough logic if u've understood it u can refine it to get a better performing code.
regards,
kartik
2008 Aug 28 2:19 PM
if both the tables consists of the same number of records then Scrap the ITAB1.
what is the need of Another internal table...?
2008 Aug 28 2:37 PM
hI Vijay Babu Dudla ,
Thanks but in itab1 i have a lot data (more columns ) i just put the relevant ,
the 2 table have different data i put just the data that is relevant.
Regards
2008 Aug 28 2:43 PM
Hi
you can introduce the column node_id in to the itab1 if it is feasible
Else you need to go for the third table to avoid the complex logic...
2008 Aug 28 2:22 PM
Hi,
Take a new table say itab3 with the two fields node_id and node_name...
You need to fetch the corresponding node_id's to this tab and use this table furter in your program..
Loop at itab1.
Read itab2 where node_name =itab1-node_name.
wa_itab3-node_name = itab1-node_name.
wa_itab3-node_id = itab2-node_id
append wa_itab3 to itab3.
endloop.
Now you can
sort itab3 by node_id.
Thank you
2008 Aug 28 2:23 PM
Code ur own logic to sort the table it cud be like
loop at itab2
loop at itab1.
then search for node_name in itab1 when found swap it then it ll come at same position as in itab2.
this is a rough logic if u've understood it u can refine it to get a better performing code.
regards,
kartik
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |