Skip to Content
author's profile photo Former Member
Former Member

Sales Order / Invoice Report

Hello All

I am having troubles creating a sales order and sales invoice. For whatever reason I get duplicate records when adding "Dscription" from RDR1 to the report. The key shared between RDR1 and ORDR is "DocEntry" Unfortunately I do not have access until Friday however I would like to go into work (work experience) with a rough idea of what is going wrong.

Tables used are RDR1, ORDR, OCRD

Report contains fields from ORDR and OCRD such as CardName, DocNum, Date etc field from RDR1 is Dscription which seems to be causing the problem. I have been able to suppress the duplicates using a formula however I cannot figure out a way to sum distinct records there must be a simpler way.

Sorry for the brief question, I do work exp once a week and dont have much time to research on site

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on May 21, 2013 at 06:11 AM

    Hello Adam,

    It would be great and easy if you paste your full query. And you can check is this the following joins in your query ?

    ORDR INNER JOIN RDR1

    ON ORDR.DocEntry = RDR1.DocEntry

    INNER JOIN OCRD

    ON ORDR.CardCode = OCRD.CardCode

    Thanks.

    Regards,

    Rafaee M

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 21, 2013 at 06:22 AM

    Hi Adam,

    Check the Joins between the tables and see if that's causing the issue. Also, drag fields from all the tables to confirm if the records are really duplicate.

    Just like you have suppress records when they're duplicate, there are ways to sum Distinct Records. Look for help on Running Totals in the CR designer.

    -Abhilash

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 28, 2013 at 03:07 AM

    Tried that Rafaee but it still returned duplicates. I think the reason behind this is that the Dscription could have 3 rows for a single DocEntry. I have another issue. I have moved on and am trying to do a basic Sales Order report but something is going wrong.

    SELECT COUNT(DISTINCT T0.[DocNum]) AS 'Total Distinct Records Document Number' FROM [dbo].[ORDR] T0

    ^^ SAP Query showing that total number of distinct docnum within ORDR = 9315

    SELECT "ORDR"."DocNum"

    FROM "ACRODYNELIVE"."dbo"."ORDR" "ORDR"

    ^^ Crystal Query that also shows the total number or docnum being 9315

    SELECT DISTINCT "OCRD"."CardCode", "ORDR"."DocNum", "ORDR"."DocDate", "ORDR"."VatSum", "ORDR"."DocTotal", "ORDR"."TotalExpns", "ORDR"."CardName"

    FROM "GENERIC"."dbo"."OCRD" "OCRD" INNER JOIN "GENERIC"."dbo"."ORDR" "ORDR" ON ("OCRD"."CardCode"="ORDR"."CardCode") AND ("OCRD"."CardName"="ORDR"."CardName")

    Report I generate within Crystal. There must be something filtering records as only 7315 are appearing.

    Any idea what is causing this?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.