on 10-08-2019 4:39 AM
i want to create a new template for A/P Invoice, which can show journal entry details in the document. But when i make the link for OPCH, OJDT and JDT1, there will show duplicate rows for AP Invoice, and there is blank for journa entry field. Below is the query:
SELECT "OPCH"."DocNum", "OPCH"."CardCode", "OPCH"."LicTradNum", "OPCH"."U_BP_Name", "OPCH"."TaxDate", "OPCH"."DocDueDate", "OPCH"."DocCur", "OPCH"."NumAtCard", "OPCH"."Address", "NNM1"."BeginStr", "OCRD"."Phone1", "OCTG"."PymntGroup", "PCH1"."TreeType", "PCH1"."ItemCode", "PCH1"."Dscription", "PCH1"."Quantity", "PCH1"."Price", "PCH1"."VatPrcnt", "PCH1"."GTotal", "PCH1"."GTotalFC", "OPCH"."Comments", "JDT1"."ShortName" FROM ((((( "SAP_FANS_Production"."dbo"."OPCH" "OPCH" LEFT OUTER JOIN "SAP_FANS_Production"."dbo"."NNM1" "NNM1" ON "OPCH"."Series" = "NNM1"."Series" ) LEFT OUTER JOIN "SAP_FANS_Production"."dbo"."OCRD" "OCRD" ON "OPCH"."CardCode" = "OCRD"."CardCode" ) LEFT OUTER JOIN "SAP_FANS_Production"."dbo"."OCTG" "OCTG" ON "OPCH"."GroupNum" = "OCTG"."GroupNum" ) INNER JOIN "SAP_FANS_Production"."dbo"."PCH1" "PCH1" ON "OPCH"."DocEntry" = "PCH1"."DocEntry" ) INNER JOIN "SAP_FANS_Production"."dbo"."OJDT" "OJDT" ON "OPCH"."TransId" = "OJDT"."TransId" ) LEFT OUTER JOIN "SAP_FANS_Production"."dbo"."JDT1" "JDT1" ON (((( "OJDT"."TransId" = "JDT1"."TransId" ) AND ( "OJDT"."DueDate" = "JDT1"."DueDate" )) AND ( "OJDT"."TransType" = "JDT1"."TransType" )) AND ( "OJDT"."CreatedBy" = "JDT1"."CreatedBy" )) AND ( "OJDT"."RefDate" = "JDT1"."RefDate" ) WHERE "OPCH"."DocNum" = 1910000054 ORDER BY "OPCH"."DocNum"
Hello,
If my memory serves right you can use the TransType and BaseRef of OJDT to link in the subreport.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.