The Anatomy of a SQL Statement – The Basics (Part 1)
The Basics
Writing your own query for SAP (or any system) can be very satisfying and cost effective, if you are a user of SBO. Once you understand the basics, you will be able to direct your computer to give you exactly what information you are looking for from the system.
Most systems have some common elements such as Customers, Vendors, Items, and Orders. SBO is no different than any other system in that regard. Each of those elements are stored in tables (or files). If you are familiar with Excel Spreadsheets, then you can grasp the concept of a table. A Table stores information in rows, and for each row, the columns represent different pieces of information that are specific to the row. For example, if we were to look a Customer Master table, the customer numbers would appear in the first column and the corresponding customer name would appear in the second (just like an Excel spreadsheet).
Every system (SAP, MS, etc.) probably has a customer master, but the name of the table is different from one system to another. In SBO, the customer master is called “OCRD”. This is the name that you will use to refer to the customer master in your queries.
Let’s write a query statement in plain English first to get an idea of what information we would like to get out of the system:
“I would like to have a list of all of the customer numbers and names.”
After converting the statement to SQL we will have:
SELECT CardCode, CardName FROM OCRD
Part 2 is HERE.
Thanks to Ed Monk of SBONotes.com
© 2009, Mark Chinsky. All rights reserved. Formed in 2005. the 90 Minds Consulting Group is a collaboration of 100 Sage partners who independently join together online in a 24 x 7 private communication network to solve difficult issues for their customers. The group is not affiliated with Sage and our collaboration provides for unparalleled member access to early warnings of bugs and other issues which members in turn are encouraged to use to provide an exceptional customer experience.
« SAP Business One Need the Current Date to Use Within Your Query? | Home | The Anatomy of a SQL Statement – SQL Statement Breakdown (Part 2) »


Leave a Comment
You must be logged in to post a comment.