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: 

select statment

Former Member
0 Kudos

Hi Guys,

I want to select the latest billing doc date .How do I use the order by clause and select single

in below select statment.Please guide

SELECT a~wadat_ist

INTO billing_dat

FROM likp AS a JOIN lips AS b

ON avbeln EQ bvbeln

WHERE a~kunag = iest0-customer

AND b~matnr = iest1-material.

2 REPLIES 2

Former Member
0 Kudos

Try using this;

SELECT SINGLE a~wadat_ist
INTO billing_dat
FROM likp AS a JOIN lips AS b
ON a~vbeln EQ b~vbeln
WHERE a~kunag = iest0-customer
AND b~matnr = iest1-material 
ORDER BY a~wadat descending.

Check and revert back....

Regards

Karthik D

Former Member
0 Kudos

Hai,

Try to use max keyword. I hope it may be useful to pick the latest record.

SELECT max(wadat_ist) FROM likp WHERE kunag = iest0-customer and matnr = iest1-material.

Regards,

Harish