05-20-2009 1:43 PM
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.
05-20-2009 1:52 PM
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
05-20-2009 2:27 PM
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