Skip to Content

SAP B1: Sales and Returns in one query

Hello,

I'm a new in SAP B1.

Have a task to show the Sales and Returns for the period by BP in one query and after to create the Crystal Report based on data.

ORDR and RDR1 - Sales

ORDN and RDN1 - Returns.

Can you please advise how can I join them? Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Jul 25, 2020 at 09:57 AM

    Hi,

    Your query should be based on Delivery and Return, not from sales order and Return.

    Try this query,

    SELECT T0.[DocNum], T0.[DocDate], T1.[ItemCode], T1.[Dscription], T1.[Quantity] FROM ODLN T0 INNER JOIN DLN1 T1 ON T0.[DocEntry] = T1.[DocEntry] WHERE T0.[CardCode] = [%0] and T0.[DocDate] between [%1] and [%2]

    UNION ALL

    SELECT T0.[DocNum], T0.[DocDate], T1.[ItemCode], T1.[Dscription], -1* T1.[Quantity] FROM ORDN T0 INNER JOIN RDN1 T1 ON T0.[DocEntry] = T1.[DocEntry] WHERE T0.[CardCode] = [%0] and T0.[DocDate] between [%1] and [%2]

    Regards,

    Nagarajan

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 23, 2020 at 08:54 PM

    Hi Igor,

    Business One has their own Incident Portal, I suggest you log one there. B1 Rep's don't come here and it's an OEM version of standard CR which most people don't know the B1 Databases.

    Don

    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.