‎2009 May 08 7:44 AM
hi
i have two table, one standard and the other one is sorted table.
first i move data into in the standard table.
how do i can move data from standard table in sorted table?
types: begin of t_komdat,
kmnrch type zkomnr,
vbeln type vbeln_vl,
end of t_komdat.
data gt_komnr type table of t_komdat. "KommissionierNr.
data gt_komnr_sorted type sorted table of t_komdat with unique key kmnrch.
start-of-selection.
select * from zsd_spediumsetz
into corresponding fields of table
gt_komnr order by kmnrch kmzlch.
break-point.
delete adjacent duplicates from gt_komnr comparing kmnrch.
insert gt_komnr into gt_komnr_sorted.
break-point.
end-of-selection.
‎2009 May 08 7:54 AM
Hi,
sort gt_komnr by kmnrch.
delete adjacent duplicates from gt_komnr comparing kmnrch.
append lines of gt_komnr to gt_komnr_sorted.
‎2009 May 08 7:54 AM
first take data from standard table in to internal table then sort it with sort key and then insert all the data in to sorted table.
‎2009 May 08 8:06 AM
Are both table of same structure if not use.
types: begin of t_komdat,
kmnrch type zkomnr,
vbeln type vbeln_vl,
end of t_komdat.
data gt_komnr type table of t_komdat with header line. "KommissionierNr.
data gt_komnr_sorted type sorted table of t_komdat with unique key kmnrch with header line.
start-of-selection.
select * from zsd_spediumsetz
into corresponding fields of table
gt_komnr.
break-point.
Sort gt_komnr by kmnrch. " Use Sort statement.
delete adjacent duplicates from gt_komnr comparing kmnrch.
*insert gt_komnr into gt_komnr_sorted.
Loop at gt_komnr.
Move :gt_komnr-kmnrch to gt_komnr_sorted-kmnrch,
gt_komnr-vbeln to gt_komnr_sorted-vbeln.
Insert table gt_komnr_sorted[] from gt_komnr_sorted.
clear gt_komnr_sorted.
endloop.Regards,
Gurpreet
‎2009 May 08 8:20 AM