Skip to Content
0
Jan 03, 2019 at 10:47 AM

Yellow arrow - SQL Query in SAP business One

1797 Views

Hello,

Is it possible to get yellow arrow in the query manager in SAP Business One?

I have query report and I need to get yellow arrow for Business Partner, Account Code and DocNum. On this moment I've got only in BP Code.

I tried to make connections using different JOIN but without result.

My query is:

SELECT T0.[CardCode], T0.[CardName], T1.[AcctCode], T0.[DocDate], T0.[TaxDate],
T0.[DocDueDate], T0.[VatDate], 'FZ' [Typ dokumentu], T0.[DocNum], T0.[NumAtCard],
T1.[ItemCode], T1.[Dscription], T1.[U_Opis], T1.[Quantity], T1.[Price],
T1.[Currency], T0.[DocTotal]
FROM OPCH T0
INNER JOIN PCH1 T1 ON T0.[DocEntry] = T1.[DocEntry]
UNION ALL
SELECT T0.[CardCode], T0.[CardName], T1.[AcctCode], T0.[DocDate], T0.[TaxDate],
T0.[DocDueDate], T0.[VatDate], 'FKZ' [Typ dokumentu], T0.[DocNum], T0.[NumAtCard],
T1.[ItemCode], T1.[Dscription], T1.[U_Opis], T1.[Quantity], T1.[Price],
T1.[Currency], T0.[DocTotal]
FROM OCPI T0
INNER JOIN CPI1 T1 ON T0.[DocEntry] = T1.[DocEntry]
UNION ALL
SELECT T0.[CardCode], T0.[CardName], T1.[AcctCode], T0.[DocDate], T0.[TaxDate],
T0.[DocDueDate], T0.[VatDate], 'AFZ' [Typ dokumentu], T0.[DocNum], T0.[NumAtCard],
T1.[ItemCode], T1.[Dscription], T1.[U_Opis], T1.[Quantity], T1.[Price],
T1.[Currency], T0.[DocTotal]
FROM ORPC T0
INNER JOIN RPC1 T1 ON T0.[DocEntry] = T1.[DocEntry]
UNION ALL
SELECT T0.[CardCode], T0.[CardName], T1.[AcctCode], T0.[DocDate], T0.[TaxDate],
T0.[DocDueDate], T0.[VatDate], 'SFKZ' [Typ dokumentu], T0.[DocNum], T0.[NumAtCard],
T1.[ItemCode], T1.[Dscription], T1.[U_Opis], T1.[Quantity], T1.[Price],
T1.[Currency], T0.[DocTotal]
FROM OCPV T0
INNER JOIN CPV1 T1 ON T0.[DocEntry] = T1.[DocEntry]
UNION ALL
SELECT T0.[CardCode], T0.[CardName], T1.[AcctCode], T0.[DocDate], T0.[TaxDate],
T0.[DocDueDate], T0.[VatDate], 'FS' [Typ dokumentu], T0.[DocNum], T0.[NumAtCard],
T1.[ItemCode], T1.[Dscription], T1.[U_Opis], T1.[Quantity], T1.[Price],
T1.[Currency], T0.[DocTotal]
FROM OINV T0
INNER JOIN INV1 T1 ON T0.[DocEntry] = T1.[DocEntry]
UNION ALL
SELECT T0.[CardCode], T0.[CardName], T1.[AcctCode], T0.[DocDate], T0.[TaxDate],
T0.[DocDueDate], T0.[VatDate], 'FKS' [Typ dokumentu], T0.[DocNum], T0.[NumAtCard],
T1.[ItemCode], T1.[Dscription], T1.[U_Opis], T1.[Quantity], T1.[Price],
T1.[Currency], T0.[DocTotal]
FROM OCSI T0
INNER JOIN CSI1 T1 ON T0.[DocEntry] = T1.[DocEntry]
UNION ALL
SELECT T0.[CardCode], T0.[CardName], T1.[AcctCode], T0.[DocDate], T0.[TaxDate],
T0.[DocDueDate], T0.[VatDate], 'AFS' [Typ dokumentu], T0.[DocNum], T0.[NumAtCard],
T1.[ItemCode], T1.[Dscription], T1.[U_Opis], T1.[Quantity], T1.[Price],
T1.[Currency], T0.[DocTotal]
FROM ORIN T0
INNER JOIN RIN1 T1 ON T0.[DocEntry] = T1.[DocEntry]
UNION ALL
SELECT T0.[CardCode], T0.[CardName], T1.[AcctCode], T0.[DocDate], T0.[TaxDate],
T0.[DocDueDate], T0.[VatDate], 'SFKS' [Typ dokumentu], T0.[DocNum], T0.[NumAtCard],
T1.[ItemCode], T1.[Dscription], T1.[U_Opis], T1.[Quantity], T1.[Price],
T1.[Currency], T0.[DocTotal]
FROM OCSV T0
INNER JOIN CSV1 T1 ON T0.[DocEntry] = T1.[DocEntry]

I need yellow arrow here:

Best Regards

Kamila

Attachments

fy0yw.png (48.5 kB)