Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

To get a set of values just before a 'selected' row in a table

$
0
0

Hello all,

 

Apologies if my question/ title sounds kind of vague.

 

But, let me go ahead and explain my proposed logic.

 

  • I have a table( in an FM ), from which I have to find whether there is a particular row with a  value 123.
  • I do a "READ TABLE sthg WITH KEY colname = '123' and zero in on that row.
  • And, if sy-subrc = 0, I would like to find out copy all 5 rows in this column which are "just" above this 123.
  • If I do a MOVE ... TO...... ( How will it know that I need to move just 5 rows? )

 

Example:

100

200

300

400

500

600

123

700

800.

 

Now, I have found "123" using READ table. I would want the values of 200 to 600, so I can copy this into another internal table. (NOT "100" value, just 200 to 600" ).

 

Is there some sort of logic I could use here so it moves only "5" values just above the key?

 

Many thanks.


Viewing all articles
Browse latest Browse all 8332

Trending Articles



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