Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Use of DocKey@ in Crystal Reports

Hello Experts;

I created a Crystal Report that uses a Command as follows:

SELECTT0.DocNumAS 'Sales Order Number'

-- , T0.DocEntry

-- , T1.DocEntry

-- , T2.BaseEntry

-- , T2.DocEntry

-- , T3.DocEntry

--, T0.CardCode
--, T0.CardName

, T1.ItemCodeAS 'Item Code'

-- , T2.ItemCode

, T1.DscriptionAS 'Description'
, T1.QuantityAS 'Order Quantity'

, T3.ShipToCodeAS 'Customer'
, T3.Address2AS 'Shipment Address'

, T2.ShipDate
, T3.DocNumAS 'Delivery Number'
, T3.TrackNoAS 'Tracking Number'
, T3.U_NPH_ShipmentETAAS 'Shipment ETA'
, T2.QuantityAS 'Shipment Quantity'
FROMORDR T0
LEFTJOINRDR1 T1 ON T1.DocEntry  = T0.DocEntry
LEFTJOINDLN1 T2 ON T2.BaseEntry= T1.DocEntry AND T2.ItemCode = T1.ItemCode
LEFTJOINODLN T3 ON T3.DocEntry= T2.DocEntry

WHERE T0.DocNum = {?DocKey@}

ORDER BY T0.CardCode, T3.Address2

The Crystal Reports version is 2008 and this particular report is imported into SAP Business One v8.82 as a layout with a document type of RDR2 -Order (Items).

When executed in Sales A/R ==>   Sales Order ==> Preview Layouts, the report shows but has no data on it.  Kindly advice what is wrong with this.

Thank you very much in Advance.

Warm Regards,

Noel

Former Member
Former Member replied

You have T0.DocNum = {?DocKey@}, but the DocKey@ token reflects the current document's DocEntry. Change it to T0.DocEntry = {?DocKey@} and it should then work as you're expecting.

2 View this answer in context
Not what you were looking for? View more on this topic or Ask a question