Skip to Content
0

SQl Report - Sales Orders closed today

May 26, 2017 at 07:24 AM

39

avatar image
Former Member

Hi All

in our business, it may take multiple deliveries before a Sales Order is completed and closed. I've managed to write the following query (with my limited skills) but it would only appear to pick up a Sales Order that is closed when delivered in full by a single delivery....

SELECT T0.[DocNum], T0.[CardCode], T0.[CardName],T0.[UpdateDate] AS 'Closed On' FROM ORDR T0 WHERE T0.[DocStatus] ='C' AND T0.[UpdateDate] >= GETDATE () - 4

I want to be able to produce a report that is triggered when the Sales Order is closed as a result of the last delivery to close that order.

Could anyone assist please?

Many thanks

Derek

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member May 26, 2017 at 07:46 AM
0

Hi Derek,

It seems you want to know last delivery date against sales order.

You can make join with Delivery (ODLN & DLN1) by baseentry and baseline and find max delivery date by group by and having clause.

Regards,

Zuber Kazi

Share
10 |10000 characters needed characters left characters exceeded
Nagarajan K May 26, 2017 at 01:14 PM
0

Hi,

Please check this thread https://archive.sap.com/discussions/thread/3631338

Regards,

Nagarajan

Share
10 |10000 characters needed characters left characters exceeded