SAP Business One Consultants | IT Support | 0843 886 1449

All posts in SAP Business One Training

SAP Business One – Improving The Speed Of Reports

Along with general consultancy, system implementations, training, interfaces and development of SAP Business One, one of the most requested jobs is to improve the speed of reports. Reports can be written in SQL Queries, Crystal Reports or any other reporting tool. As a rule of thumb, if a report is running slowly, it is due to either the way it was originally written or the data it is reporting on. With some out of the box thinking it is usually possible to massively reduce the way a report runs by approaching it from a different view point.

I have personally managed to reduce report run times from 90 minutes to 30 seconds with a slight rewrite of the report – anyone who has been in a situation where there screen is frozen for 90 minutes will know how frustrating it is and what a massive improvement this is.

Ways to improve your reporting:

  • Is it possible to improve the Joins?
  • Is it possible to reduce the data calls?
  • Will a database View reduce the run time?
  • Can a temporary table(s) be created to reduce the run time?
  • Is the report written in the best possible way?
  • Are there unnecessary joins?
  • Can the data be accessed from ‘better’ sources than already used?
  • Are you able to create a better report from multiple sources rather than a nested, cascading report?

If you still have slow reports after addressing the above points then contact us and we will help you reduce the run time.

This is a short and to the point Crystal Reports post to assist anyone trying to count the number of Groups in a report. If you are using Crystal Reports you will know that the Summary does not work on Groups. We hope you find the following useful!

Crystal Report Group Count

To count the number of Crystal Report group entries in a report, rather than the entries within a Group, use the following process:

1) Create a formula @GroupCountReset and place this formula in the page header and make it suppressed (hidden)


numbervar i:=0;

2) Create another formula @GroupCountEval place this in the group header where you want to count the entries and suppress if required


numbervar i:= i+1;

3) Create another formula @GroupCountDisplay and place this in report footer. Don’t suppress this one! You need to see it!


numbervar i;


You should now have a count of Group entries.

Useful information for Crystal Reports and Crystal Reports for SAP Business One.

Warning: fsockopen(): unable to connect to (Connection timed out) in /homepages/35/d344059352/htdocs/1dash1/wp-content/plugins/sweetcaptcha-revolutionary-free-captcha-service/library/sweetcaptcha.php on line 81

SAP Business One Year End Closing Instructions

SAP kindly provide a 50 page document which provides in depth instructions on the Year End process but most people only need to know how to run the actual Year End process in SAP B1.  Because it is a once yearly procedure, it is forgotten year to year. Here are the instructions for running the Year End process in Business One.

Year End Process in SAP B1

To carry forward the balances of the P&L accounts to the corresponding account in the balance sheet
(or several different balance sheets), you can use the period-end closing function. You can store the
results initially as a report and then post them at a later stage.
If you make postings after entering the balances carried forward, you need to restart the period-end
closing routine to include these subsequent postings.

Administration / Utilities / Period-End Closing

When you execute the report, the Period-End Closing window opens:

In the Period-End Closing – Selection Criteria window, you can specify the same account
in the Retained Earnings Account and the Period-End Closing Account fields.

Once you have executed the period-end closing for the selected expenses and revenue accounts, 2
transactions are created for each account and 2 journal entries are automatically created to reflect
those transactions.
The balances of those P&L accounts are posted to the period-end closing account on the same day
(the last day of the period) and the balances are reduced to zero. The first journal entry reflects this.
On the first day of the subsequent period, the period-end closing account is posted to the
corresponding balance carried forward to the retained earnings account in the balance sheet. The
second journal transaction reflects this.

The balance of the period-end closing account is zero.

This is how to run the SAP Business One Year End Process.


Contact Stuart Folley @ 1Dash1 if you have any questions or suggestions.

    Your Name (required)

    Your Email (required)

    Your Telephone

    Your Company


    Your Message



    Warning: fsockopen(): unable to connect to (Connection timed out) in /homepages/35/d344059352/htdocs/1dash1/wp-content/plugins/sweetcaptcha-revolutionary-free-captcha-service/library/sweetcaptcha.php on line 81

    Using variables in SQL queries for SAP Business One is straight forward for simple select statements but what about the more complex variables or if you want to declare a variable for your SQL?

    Answer: You have to get a bit more creative! See the example below.

    To select a from and to date as a variable in a declare statement you have to add a nifty bit of extra code.


    /SELECT FROM [dbo].[VPM1] T0/

    declare  @fromdate as datetime

    /* WHERE */

    set @fromdate = /* T0.DueDate */ ‘[%0]’


    /SELECT FROM [dbo].[VPM1] T1/

    declare  @tilldate as datetime

    /* WHERE */

    set @tilldate = /* T0.DueDate */ ‘[%1]’



    select  OVPM.docnum, VPM1.dueDate,VPM1.CheckNum, VPM1.Branch,

    VPM1.BankCode, VPM1.CheckSum, OVPM.CardName,


    when OPCH.docnum is null then VPM2.docEntry

    else OPCH.docnum

    end as ‘docnum’

    from OVPM INNER join VPM1 on OVPM.docnum = VPM1.docnum

    left join  VPM2 LEFT JOIN OPCH ON VPM2.DocEntry = OPCH.DocEntry

    on OVPM.docnum = VPM2.docnum

    where OVPM.Canceled = ‘N’ AND VPM1.DueDate >=@fromdate AND

    VPM1.DueDate <=@tilldate



    1 Dash 1 can provide you and your SAP Business One users with excellent training of the usage of SQL and Crystal Reports. If you would like to find out more simply enter your details in the boxes below or call us.

      Your Name (required)

      Your Email (required)

      Your Phone


      Training Course Topic

      Your Message

      Warning: fsockopen(): unable to connect to (Connection timed out) in /homepages/35/d344059352/htdocs/1dash1/wp-content/plugins/sweetcaptcha-revolutionary-free-captcha-service/library/sweetcaptcha.php on line 81

      If you are interested in writing your own SQL queries for SAP Business One the following will assist you.

      Basics of SQL Writing for SAP Business One

      SQL query and related terms

      Before going into the details of SQL query, I would like to briefly introduce some basic database concepts because SQL is a database language for managing data in Relational Database Management Systems(RDBMS).


      RDBMS is a Database Management System that is based on the relation model. Relational here is a key word for RDBMS. You will find that data is stored in the form of Tables and the relationship among the data is also stored in the form of tables for RDBMS.


      Table is a key component within a database. One table or a group of tables represent one kind of data. For example, table OSLP within SAP Business One holds all Sales Employee Data. Tables are two-dimensional data storage place holders. You need to be familiar with their usage and their relationships with each other. If you are familiar with Microsoft Excel, the worksheet in Excel is a kind of two-dimensional table.

      Table is also one of the most often used concepts. Relationships between each table may be more important than tables themselves because without relation, nothing could be of any value. One important function within SAP Business One is allowing User Defined Table (UDT). All UDTs start with “@”.

      SAP Business One training


      A field is the lowest unit holding data within a table. A table can have many fields. It is also called acolumn. Field and column are interchangeable. A table is comprised of records, and all records have the same structure with specific fields. One important concept in SAP Business One is User Defined Field(UDF). All UDFs start with U_.


      SQL is often referred to as Structured Query Language. It is pronounced as S-Q-L or as the word “Sequel”. There are many different revisions and extensions of SQL. The current revision is SQL: 2008, and the first major revision is SQL-92. Most of SQL extensions are built on top of SQL-92.


      Since SAP Business One is built on Microsoft SQL Server database, SQL here means Transact-SQL or T-SQL in brief. It is a Microsoft’s/Sybase’s extension of general meaning for SQL.

      Subsets of SQL

      There are three main subsets of the SQL language:

      • Data Control Language (DCL)
      • Data Definition Language (DDL)
      • Data Manipulation Language (DML)

      Each set of the SQL language has a special purpose:

      • DCL is used to control access to data in a database such as to grant or revoke specified users’ rights to perform specified tasks.
      • DDL is used to define data structures such as to create, alter, or drop tables.
      • DML is used to retrieve and manipulate data in the table such as to insert, delete, and update data.Select, however, becomes a special statement belonging to this subset even though it is a read-only command that will not manipulate data at all.


      Query is the most common operation in SQL. It could refer to all three SQL subsets.

      You have to understand the risks of running any Add, Delete, or Update queries that could potentially alter system tables even if they are User Defined Fields. Only SELECT query is legitimate for SAP Business One system table.

      The above extract provides the basics of SQL, to read the full article, read it here.


      SAP Business One table for SQL Report writing


      DunningLetters Dunning levels definition ODUN
      Recipients Message recipient list AOB1
      Messages Messages OALR
      Currencies Currency codes OCRN
      UserPermissionTree User authorizations for add-on forms OUPT
      UserPermissionForms User permission forms UPT1
      Users Users of SAP Business One application OUSR
      UserPermission User authorizations USR3
      AddonChecking(SBO-COMMON Database Only runned this table) Overall Addon Path Defining SARI
      User Queries User Queries OUQR


      Budget Budget management OBGT
      Budget_Lines Budget item details of an account BGT1
      BudgetDistribution Budget distribution methods OBGD
      BudgetScenarios Budget scenarios OBGS
      ChartOfAccounts G/L accounts OACT
      JournalVouchers Journal vouchers OBTD
      JournalEntries_Lines Journal transaction – rows JDT1
      JournalEntries Journal transaction OJDT
      SalesTaxAuthorities Sales tax jurisdictions OSTA
      SalesTaxAuthoritiesTypes Sales tax authority types OSTT
      SalesTaxCodes Inclusive sales tax codes OSTC

      Marketing Documents and Receipts
      (Sales Opportunities, Sales A/R, and Purchasing A/P)

      Document_Lines Delivery note rows DLN1
      Document_LinesAdditionalExpenses Delivery note rows – expenses DLN2
      DocumentsAdditionalExpenses Delivery note – expenses DLN3
      AdditionalExpenses Defines additional expenses OEXD
      Document_Lines Draft – rows DRF1
      Document_LinesAdditionalExpenses Draft rows – expenses DRF2
      DocumentsAdditionalExpenses Draft – expenses DRF3
      Document_Lines Invoice – rows INV1
      Document_LinesAdditionalExpenses Invoice rows – expenses INV2
      DocumentsAdditionalExpenses Invoice – expenses INV3
      Document (oDeliveryNote) Delivery – header ODLN
      Documents Drafts – header ODRF
      Documents (oInvoice) Invoice – header OINV
      Document (oPurchaseInvoices) AP invoice – header OPCH
      Document (oPurchaseDeliveryNotes) Goods receipt purchase order – header OPDN
      Document (oPurchaseOrders) Purchase order – header OPOR
      Document (oQuotation) Quotation – header OQUT
      Document (oReturn) Returns – header ORDN
      Document (oOrder) Order – header ORDR
      Document (oCreditNote) AR credit memo – header ORIN
      Document (oPurchaseCreditNotes) AP credit memo – header ORPC
      Document (oPurchaseReturns) Goods return – header ORPD
      Document_Lines AP invoice – rows PCH1
      Document_LinesAdditionalExpenses AP invoice rows – expenses PCH2
      DocumentsAdditionalExpenses AP invoice – expenses PCH3
      Document_Lines Goods receipt purchase order – row PDN1
      Document_LinesAdditionalExpenses Goods receipt purchase order rows – expenses PDN2
      DocumentsAdditionalExpenses Goods receipt purchase order – expenses PDN3
      Document_Lines Purchase order – rows POR1
      Document_LinesAdditionalExpenses Purchase order rows – expenses POR2
      DocumentsAdditionalExpenses Purchase order – expenses POR3
      Document_Lines Quotation – rows QUT1
      Document_LinesAdditionalExpenses Quotation rows – expenses QUT2
      DocumentsAdditionalExpenses Quotation – expenses QUT3
      Document_Lines Returns – rows RDN1
      Document_LinesAdditionalExpenses Return rows – expenses RDN2
      DocumentsAdditionalExpenses Returns – expenses RDN3
      Document_Lines Order – rows RDR1
      Document_LinesAdditionalExpenses Order rows – expenses RDR2
      DocumentsAdditionalExpenses Order – expenses RDR3
      Document_Lines Credit memo – rows RIN1
      Document_LinesAdditionalExpenses Credit memo rows -Expenses RIN2
      DocumentsAdditionalExpenses Credit memo – expenses RIN3
      Document_Lines AP credit memo – rows RPC1
      Document_LinesAdditionalExpenses AP credit memo rows – expenses RPC2
      DocumentsAdditionalExpenses AP credit memo – expenses RPC3
      Document_Lines Goods return – rows RPD1
      Document_LinesAdditionalExpenses Goods return rows – expenses RPD2
      DocumentsAdditionalExpenses Goods return – expenses RPD3
      BatchNumbers Batch number for item OIBT
      Industries Industries list for sales opportunities OOND
      Relationships Relationships for sales opportunities OORL
      SerialNumbers Serial numbers for items OSRI
      WithholdingTaxData Withholding tax data INV5
      TaxInvoices (botit_Invoice) Master header data of a tax invoice of sales document OTSI
      TaxInvoice_Lines (botit_Invoice) Tax invoice of sales document – rows TSI1
      TaxInvoices (botit_Payment) Master header data of a tax invoice of purchase document OTPI
      TaxInvoice_Lines (botit_Payment) Tax invoice of purchase document – rows TPI1
      TaxInvoices (botit_JournalEntry) Master header data of a tax invoice of journal entry document OTXD
      TaxInvoice_Lines (botit_JournalEntry) Tax invoice of journal entry document – rows TXD1

      Business Partners

      ActivityLocations Business partner activity locations OCLO
      ActivityStatus Statuses for Task type activities OCLA
      ActivityTypes Business partner activity types OCLT
      AlternateCatNum Customer or vendor catalog number OSCN
      BusinessPartners Business partners OCRD
      BPAddresses Business partner addresses CRD1
      BPPaymentMethods Business partner payment methods CRD2
      BPAccountReceivablePayble Business partner account receivable payable CRD3
      BPWithholdingTax Business partner withholding tax CRD4
      BPPaymentDates Business partners payment dates CRD5
      BPBankAccounts Business partners bank accounts OCRB
      Contacts Contact customers and vendors OCLG
      ContactEmployees Contact persons OCPR
      SalesOpportunities Sales opportunities OOPR
      SalesOpportunitiesLines Sales opportunity – rows OPR1
      SalesOpportunitiesPartners Sales opportunity partners OPR2
      SalesOpportunitiesCompetition Sales opportunity competition OPR3
      SalesOpportunitiesInterests Sales opportunity interests range OPR4
      SalesOpportunitiesReasons Sales opportunity failure reasons OPR5
      Territories Territory segmentations OTER

      Inventory and Production

      Document_Lines Goods issue – rows IGE1
      Document_LinesAdditionalExpenses Goods issue rows – expenses IGE2
      DocumentsAdditionalExpenses Goods issue – expenses IGE3
      Document_Lines Goods receipt – rows IGN1
      Document_LinesAdditionalExpenses Goods receipt rows – expenses IGN2
      DocumentsAdditionalExpenses Goods receipt – expenses IGN3
      Document (oInvetoryGenExit) Goods issue OIGE
      Document (oInvetoryGenEntry) Goods receipt OIGN
      StockTransfer Stock transfers OWTR
      StockTransfer_Lines Stock transfers – rows WTR1
      ProductTrees_Lines Product tree – child ITT1
      ProductTrees Product tree OITT
      WorkOrders Work instructions OWKO
      WorkOrder_Lines Work instructions – rows WKO1
      Items_Prices Items – prices ITM1
      Items Items OITM
      ItemWarehouseInfo Items – warehouse OITW
      ItemGroups Item groups definition OITB
      MaterialRevaluation Stock revaluation OMRV
      MaterialRevaluation_Lines Stock revaluation – rows MRV1
      PackagesTypes Package types for deliveries OPKG
      PriceLists Price lists management OPLN
      StockTaking Items – warehouse OITW
      SpecialPrices Special prices OSPP
      SpecialPricesDataAreas Special prices for specified periods SPP1
      SpecialPricesQuantityAreas Special prices for specified quantities SPP2
      Warehouses Warehouses definition OWHS


      SalesForecast Sales forecast OFCT
      SalesForecast_Lines Sales forecast – rows FCT1


      Payments Receipt ORCT
      Payments Vendor payment OVPM
      Payments_Checks Receipt – checks RCT1
      Payments_Invoices Receipt – invoices RCT2
      Payments_CreditCards Receipt – credit vouchers RCT3
      Payments_Accounts Receipt – account list RCT4
      Payments_Checks Payments – check rows VPM1
      Payments_Invoices Payments – invoices VPM2
      Payments_CreditCards Payments – credit memos VPM3
      Payments_Accounts Payments – list of accounts VPM4
      ChecksforPaymentLines Checks for payment – rows CHO1
      BankPages External bank statement OBNK
      ChecksforPayment Check for payment OCHO
      PaymentTermsTypes Payment term types OCTG
      PaymentRunExport Payment results table OPEX
      PaymentRunExport_Lines Payment results table – rows PEX1
      BillOfExchange Bill of exchange table OBOE
      BillOfExchangeTransaction Bill of exchange transactions table OBOT
      BillOfExchangeTransaction_Lines Bill of exchange transactions table – rows BOT1


      ContractTemplates Contract template (CRM) OCTT
      CustomerEquipmentCards Customer equipment card OINS
      KnowledgeBaseSolutions Knowledge base solution OSLT
      Queue Queues list for assigning to a service calls OQUE
      QueueMembers Queue member users QUE1
      ServiceContracts Service contract OCTR
      ServiceContracts_Lines Service contract – rows CTR1
      ServiceCalls Service call OSCL
      ServiceCallActivities Service call activities OCLG
      ServiceCallInventoryExpenses Service call inventory expenses INV1

      Human Resources

      EmployeesInfo Employees information OHEM
      EmployeeAbsenceInfo Employee absence information HEM1
      EmployeeEducationInfo Employee education HEM2
      EmployeeReviewsInfo Employee reviews HEM3
      EmployeePrevEmpoymentInfo Employee previous employment information HEM4
      EmployeeRolesInfo Employee rolls information HEM6
      Teams List of teams OHTM
      TeamMembers Employee membership role in a team HTM1
      If you would like to receive SQL report writing training for SAP Business One, contact 1 Dash 1 by entering your details below or calling us on 0844 858 1080.

        Your Name (required)

        Your Email (required)

        Your Phone


        Training Course Topic

        Your Message

        Warning: fsockopen(): unable to connect to (Connection timed out) in /homepages/35/d344059352/htdocs/1dash1/wp-content/plugins/sweetcaptcha-revolutionary-free-captcha-service/library/sweetcaptcha.php on line 81

        We are currently taking bookings for training courses throughout August 2013. Our training courses can either be on your site for a maximum of 8 people or at an external location suitable for attendees from various companies.

        On site training is excellent for your employees as it will be specific to your system as it will be based on your Test system.

        External multi-company training is more suited for non specific training requirements and usually proves extremely useful for those candidates wishing to network with peers from other industries.

        SAP Business One Training Courses

        Our SAP Business One training courses can be specifically tailored to your system and, dependent on time, our time can be used for consultancy questions. We will listen and work with you to ensure that your users receive the training that will positively impact your business.

        1 Dash 1 also provide Super User 1 week long training courses to enable one of your users to become the main point of contact for any SAP Business One related questions that arise within the business. The week long course will empower your user to answer questions and create SQL Queries for entry and intermediate reporting. The week long course is structured and priced differently to our offer training course offerings so please specify if the course is of interest and we will contact you with the relevant information.

        Simply enter your details below with your training requirements and we will contact you to arrange dates and discover what training style is most suitable for you and your users.

          Your Name (required)

          Your Email (required)

          Your Phone


          Training Course Topic

          Your Message