cancel
Showing results for 
Search instead for 
Did you mean: 

Vendor ledger

ramco1917
Participant
0 Kudos

Hi

Query to create Vendor Ledger in Sap B1

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

MD1
Active Contributor

okkkkkkk...understand

please use SAP standard report "General Ledger"

MD1
Active Contributor

dear

please try

---current year
SELECT
t0."CreateDate" as "Create Date",
T0."CardCode" AS "Vendor Code",
T0."CardName" AS "Vendor Name",
t1."GroupName" as "Group"
FROM ocrd T0
LEFT OUTER JOIN ocrg T1 ON T0."GroupCode" = T1."GroupCode"
WHERE YEAR(t0."CreateDate") = YEAR(CURDATE())
and T0."CardType"='S'
ORDER BY t0."CreateDate",T0."CardCode"

---last 7 days record
SELECT
t0."CreateDate" as "Create Date",
T0."CardCode" AS "Vendor Code",
T0."CardName" AS "Vendor Name",
t1."GroupName" as "Group"
FROM ocrd T0
LEFT OUTER JOIN ocrg T1 ON T0."GroupCode" = T1."GroupCode"
where DAYS_BETWEEN (t0."CreateDate",CURRENT_DATE) <=7
and T0."CardType"='S'
ORDER BY t0."CreateDate",T0."CardCode"

ramco1917
Participant
0 Kudos

Hi

I need transactions wise detail

Thanks

0 Kudos

This Query is correct because CURDATE() will not work

Please use below query

SELECT
t0."CreateDate" as "Create Date",
T0."CardCode" AS "Vendor Code",
T0."CardName" AS "Vendor Name",
t1."GroupName" as "Group"
FROM ocrd T0
LEFT OUTER JOIN ocrg T1 ON T0."GroupCode" = T1."GroupCode"
WHERE YEAR(t0."CreateDate") = YEAR(GetDATE())
and T0."CardType"='S'
ORDER BY t0."CreateDate",T0."CardCode"