Hello,
I have created a user defined field. Now I want integrate this field in my pivot table. But sap gives me the following error message:http://www.dict.cc/englisch-deutsch/message.html
"1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Pivot grouping columns must be comparable. The type of column "U_U_Info" is "ntext", which is not comparable. 2). [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement 'Rahmenvertrag' (OOAT) (s) could not be prepared."
user defined fields
Field Data
Typ: alphanumeric
structure: text
Name: U_U_Info
How can I fix this problem?
SELECT
CardCode, Cardname, Address, ZipCode, City, CntctPrsn, Cellular, Phone1,
"Produkt1",
"Produkt2",
"Produkt3",
"Produkt4",
"Produkt5",
"Produkt6",
"Produkt7",
"Produkt8",
"Produkt9",
"Produkt10",
"Produkt11",
"Produkt12",
"Produkt13",
"Produkt14",
"Produkt15",
"Produkt16",
"Produkt17",
"Produkt18",
"Produkt19",
"Produkt20",
"Produkt21",
"Produkt22"
FROM
(SELECT T0.[CardCode], T0.[CardName], T0.[Address], T0.[ZipCode], T0.[City], T0.[CntctPrsn], T0.[Cellular], T0.[Phone1], T2.[Quantity] as Menge, T2.[Dscription]
as Product FROM OCRD T0 full outer JOIN OINV T1 ON T0.CardCode = T1.CardCode full outer JOIN INV1 T2 ON T1.DocEntry = T2.DocEntry where
T0.[CardType] = 'C'
Union all
SELECT T0.[CardCode], T0.[CardName], T0.[Address], T0.[ZipCode], T0.[City], T0.[CntctPrsn], T0.[Cellular], T0.[Phone1], -T2.[Quantity] as Menge, T2.[Dscription]
as Product FROM OCRD T0 full outer JOIN ORIN T1 ON T0.CardCode = T1.CardCode full outer JOIN RIN1 T2 ON T1.DocEntry = T2.DocEntry where
T0.[CardType] = 'C')
AS Quellabfrage
PIVOT
(
Sum(Menge)
FOR
Product
IN (
"Produkt1",
"Produkt2",
"Produkt3",
"Produkt4",
"Produkt5",
"Produkt6",
"Produkt7",
"Produkt8",
"Produkt9",
"Produkt10",
"Produkt11",
"Produkt12",
"Produkt13",
"Produkt14",
"Produkt15",
"Produkt16",
"Produkt17",
"Produkt18",
"Produkt19",
"Produkt20",
"Produkt21",
"Produkt22"
)
) AS PivotTable