Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9129

Re: SORT and DELETE ADJACENT

$
0
0

Hi

 

Delete adjacent is a useful command but you need to use it correctly

as you need to know what to compare as well

 

comparing all fields or comparing certain columns and removing them.

 

Sort is used as you can see that it will only check the next record

it cant compare all the records.

 

Code sippet:

 

Data: lt_spfli type standard table of spfli.

FIELD-SYMBOLS: <lfs_spfli> like LINE OF lt_spfli.

 

 

***Test the code here

append initial line to lt_spfli assigning <lfs_spfli>.

<lfs_spfli>-carrid = 'THY'.

<lfs_spfli>-connid = 1111.

 

append initial line to lt_spfli assigning <lfs_spfli>.

<lfs_spfli>-carrid = 'SGP'.

<lfs_spfli>-connid = 3333.

 

append initial line to lt_spfli assigning <lfs_spfli>.

<lfs_spfli>-carrid = 'LFH'.

<lfs_spfli>-connid = 1111.

 

 

append initial line to lt_spfli assigning <lfs_spfli>.

<lfs_spfli>-carrid = 'THY'.

<lfs_spfli>-connid = 4444.

 

 

break sdogan.

 

 

*doesnt work !!

delete ADJACENT DUPLICATES FROM lt_spfli.

 

 

*now try

sort lt_spfli by carrid ASCENDING.

delete ADJACENT DUPLICATES FROM lt_spfli COMPARING carrid.


Viewing all articles
Browse latest Browse all 9129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>