What does this SAP B1 select means?

80 Views Asked by At

I need help understanding the following query. I found it while using the SAP API. What does it do?

SELECT 
  T0."CardName", 
  T1."Address", 
  T0."Phone1", 
  T0."E_Mail", 
  T3."GroupName", 
  T6."PymntGroup", 
  T5."Name" AS "StateName", 
  T1."GSTRegnNo", 
  T0."DflBranch", 
  T0."DflAccount", 
  T4."AcctName" 

FROM 
  OCRD T0 
  LEFT JOIN CRD1 T1 ON T0."CardCode" = T1."CardCode" 
  LEFT JOIN CRD7 T2 ON T0."CardCode" = T2."CardCode" AND T2."Address" = '' 
  LEFT JOIN OCRG T3 ON T0."GroupCode" = T3."GroupCode" 
  LEFT JOIN OCRB T4 ON T0."CardCode" = T4."CardCode" 
  LEFT JOIN OCST T5 ON T1."State" = T5."Code" 
  LEFT JOIN OCTG T6 ON T0."GroupNum" = T6."GroupNum"
1

There are 1 best solutions below

0
William Brochensque junior On

This query returns basic details for every Business Partner in the database, details below:

SELECT 
  T0."CardName", --Name of the Business Partner
  T1."Address", --Adress of the Business Partner
  T0."Phone1", --PhoneNumber of the Business Partner
  T0."E_Mail", --E-mail of the Business Partner
  T3."GroupName", --Card group of the Business Partner
  T6."PymntGroup", --Payment terms of the Business Partner
  T5."Name" AS "StateName", --Name of the state the Business Partner resides in
  T1."GSTRegnNo", --GSTIN of the Business Partner
  T0."DflBranch", --Default branch of the Business Partner
  T0."DflAccount", --Default account of the Business Partner
  T4."AcctName"  --Name of the bank account of the Business Partner

FROM 
  OCRD T0 
  LEFT JOIN CRD1 T1 ON T0."CardCode" = T1."CardCode" 
  LEFT JOIN CRD7 T2 ON T0."CardCode" = T2."CardCode" AND T2."Address" = '' 
  LEFT JOIN OCRG T3 ON T0."GroupCode" = T3."GroupCode" 
  LEFT JOIN OCRB T4 ON T0."CardCode" = T4."CardCode" 
  LEFT JOIN OCST T5 ON T1."State" = T5."Code" 
  LEFT JOIN OCTG T6 ON T0."GroupNum" = T6."GroupNum"

You can find more informations about the SAP B1 tables on sap.erpref.com.