Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the latest value of BELNR from EKBE table if there are multiple value?

walkerist
Participant
0 Kudos
206

Hi, I was trying to get the latest BELNR number from the EKBE table. However, there were multiple BELNR values and I'm getting the first one instead of the latest. In the example below, I was able to get the EBELNR 0001 instead of the 0003.

Example:

EBELNR

0001

0002

0003

Here's my code:

    SELECT ebeln
ebelp
zekkn
vgabe
gjahr
belnr
buzei
bewtp
budat
menge
dmbtr
wrbtr
waers
shkzg
hswae
FROM ekbe
INTO TABLE t_ekbe
1 REPLY 1

FredericGirod
Active Contributor
163

ORDER BY ... DESCENDING ?