Using JournalEntries and JournalVouchers Objects in SAP Business One 6.5

Similar documents
Duet Enterprise: Tracing Reports in SAP, SCL, and SharePoint

Single Sign-on For SAP NetWeaver Mobile PDA Client

SAP AddOn Quantity Distribution. by Oliver Köhler, SAP Germany

SAP NetWeaver Identity Management Identity Center Minimum System Requirements

Visual Composer Modeling: Data Validation in the UI

Visual Composer for SAP NetWeaver Composition Environment - Connectors

Configuring relay server in Sybase Control Center

How to Find Suitable Enhancements in SAP Standard Applications

EWM125. Labor Management in SAP EWM COURSE OUTLINE. Course Version: 16 Course Duration: 4 Hours

BIT460. SAP Process Integration Message Mapping COURSE OUTLINE. Course Version: 15 Course Duration: 3 Day(s)

Quick View Insider Microblog: Why Is There No Inbox?

How to Enable Single Sign-On for Mobile Devices?

How to Handle the System Message in SAP NetWeaver Mobile 7.1

Enterprise Search Extension for SAP Master Data Governance

BC100. Introduction to Programming with ABAP COURSE OUTLINE. Course Version: 15 Course Duration: 2 Day(s)

PLM210. Master Data Configuration in SAP Project System COURSE OUTLINE. Course Version: 15 Course Duration: 2 Day(s)

SAP BusinessObjects Predictive Analysis 1.0 Supported Platforms

Quick View Insider: Understanding Quick View Configuration

Crystal Reports 2008 FixPack 2.4 Known Issues and Limitations

Duplicate Check and Fuzzy Search for Accounts and Contacts. Configuration with SAP NetWeaver Search and Classification (TREX) in SAP CRM WebClient UI

Working with Data Sources in the SAP Business One UI API

ADM950. Secure SAP System Management COURSE OUTLINE. Course Version: 10 Course Duration: 2 Day(s)

AC507. Additional Functions of Product Cost Planning COURSE OUTLINE. Course Version: 15 Course Duration: 2 Day(s)

Visual Composer Modeling: Migrating Models from 7.1.X to 7.2.0

DEV523 Customizing and Extending PowerDesigner

DS50. Managing Data Quality with SAP Information Steward COURSE OUTLINE. Course Version: 10 Course Duration: 2 Day(s)

How to Download Software and Address Directories in SAP Service Marketplace

Installing SAP NetWeaver Mobile Client (eswt) on a Storage Card

BOCE20. SAP Crystal Reports for Enterprise: Advanced Report Design COURSE OUTLINE. Course Version: 15 Course Duration: 3 Day(s)

MDG100 Master Data Governance

NET311. Advanced Web Dynpro for ABAP COURSE OUTLINE. Course Version: 10 Course Duration: 4 Day(s)

BC430 ABAP Dictionary

BOC320. SAP Crystal Reports - Business Reporting and Report Processing Strategies COURSE OUTLINE. Course Version: 15 Course Duration: 3 Day(s)

ADM900 SAP System Security Fundamentals

How to reuse BRFplus Functions Similar to R/3 Function Modules using BRF+ Expression Type Function Call

ADM950. Secure SAP System Management COURSE OUTLINE. Course Version: 15 Course Duration: 2 Day(s)

BC410. Programming User Dialogs with Classical Screens (Dynpros) COURSE OUTLINE. Course Version: 10 Course Duration: 3 Day(s)

Testing Your New Generated SAP NetWeaver Gateway Service

BC405 Programming ABAP Reports

Quick View Insider: How Can I Change the Colors? (SNC 7.0)

Visual Composer s Control Types

BW Text Variables of Type Replacement Path

BOC310. SAP Crystal Reports: Fundamentals of Report Design COURSE OUTLINE. Course Version: 15 Course Duration: 2 Day(s)

Manual Activities of SAP Note Globalization Services, 2012/06/05

HA150 SQL Basics for SAP HANA

Quick View Insider: How Do I Set Quick View as SNC s Entry Screen?

SAP Afaria Post- Installation Part 1

BC480 PDF-Based Print Forms

EDB358. System and Database Administration: Adaptive Server Enterprise COURSE OUTLINE. Course Version: 10 Course Duration: 5 Day(s)

TBIT44 PI Mapping and ccbpm

Using Default Values in Backend Adapter

How to Set Up Data Sources for Crystal Reports Layouts in SAP Business One, Version for SAP HANA

Message Alerting for SAP NetWeaver PI Advanced Adapter Engine Extended

EDB785 SAP IQ Administration

ADM100 AS ABAP - Administration

BC400 Introduction to the ABAP Workbench

AFA461 SAP Afaria 7.0 System Administration (SP03)

How to Guide to create Sample Application in IOS using SUP ODP 2.2

BC404. ABAP Programming in Eclipse COURSE OUTLINE. Course Version: 15 Course Duration: 3 Day(s)

BC490 ABAP Performance Tuning

GRC100. GRC Principles and Harmonization COURSE OUTLINE. Course Version: 10 Course Duration: 2 Day(s)

Building a Real-time Dashboard using Xcelsius and Data Integrator

BC400. ABAP Workbench Foundations COURSE OUTLINE. Course Version: 15 Course Duration: 5 Day(s)

How to Check or Derive an Attribute Value in MDG using BRFPlus

EP350. Innovated Content Management and Collaboration COURSE OUTLINE. Course Version: 10 Course Duration: 5 Day(s)

EDB116. Fast Track to SAP Adaptive Server Enterprise COURSE OUTLINE. Course Version: 15 Course Duration: 5 Day(s)

TBW30 SAP BW Modeling & Implementation

EDB367. Powering Up with SAP Adaptative Server Enterprise 15.7 COURSE OUTLINE. Course Version: 10 Course Duration: 2 Day(s)

LO Extraction - Part 6 Implementation Methodology

ADM960. SAP NetWeaver Application Server Security COURSE OUTLINE. Course Version: 10 Course Duration: 5 Day(s)

SAP BusinessObjects Dashboards 4.0 SAP Crystal Dashboard Design 2011 SAP Crystal Presentation Design 2011

BW310. BW - Enterprise Data Warehousing COURSE OUTLINE. Course Version: 10 Course Duration: 5 Day(s)

ADM960. SAP NetWeaver Application Server Security COURSE OUTLINE. Course Version: 15 Course Duration: 5 Day

Web Dynpro: Column Coloring in ALV

ADM920 SAP Identity Management

SMP541. SAP Mobile Platform 3.0 Native and Hybrid Application Development COURSE OUTLINE. Course Version: 15 Course Duration: 5 Day(s)

How to Integrate Google Maps into a Web Dynpro ABAP Application Using the Page Builder

SMP521. SAP Mobile Platform - Native and Hybrid Application Development COURSE OUTLINE. Course Version: 10 Course Duration: 5 Day(s)

Upgrade MS SQL 2005 to MS SQL 2008 (R2) for Non-High-Availability NW Mobile ABAP System

Extending DME Transfer Files According to Spanish Banking Control Council to Support Non- Euro Payments

How to Work with Analytical Portal

Remote Monitoring User for IBM DB2 for LUW

BC401. ABAP Objects COURSE OUTLINE. Course Version: 15 Course Duration: 5 Day(s)

EDB377. Fast Track to SAP Replication Server Administration COURSE OUTLINE. Course Version: 15 Course Duration: 5 Day(s)

How to Integrate Microsoft Bing Maps into SAP EHS Management

What s New / Release Notes SAP Strategy Management 10.1

Personalizing SAP BusinessObjects Explorer Information Spaces

How to do a Manual Kernel Upgrade of an SAP Server

EP200. SAP NetWeaver Portal: System Administration COURSE OUTLINE. Course Version: 10 Course Duration: 5 Day(s)

How to Access Images of SAP Netweaver Demo Model JAVA

Architecture of the SAP NetWeaver Application Server

Overview of Caffeine ABAP to Go

The Dbmlsync API. A whitepaper from Sybase ianywhere Author: Joshua Savill, Product Manager Date: October 30 th, 2008

TBIT40 SAP NetWeaver Process Integration

Business Objects Integration Scenario 2

NET312. UI Development with Web Dynpro for ABAP COURSE OUTLINE. Course Version: 10 Course Duration: 4 Day(s)

SAP ME Build Tool 6.1

Automatic Deletion of Similar/Identical Requests from InfoCube after Update

TBW60. BW: Operations and Performance COURSE OUTLINE. Course Version: 10 Course Duration: 5 Day(s)

How can a Reference Query Be used?

Transcription:

Using JournalEntries and JournalVouchers Objects in SAP Business One 6.5 Applies to: Business One. For more information, visit the Business One homepage. Summary This article explains how to use the JournalEntries and JournalVouchers objects to import data into SAP Business One from a tab-delimited text file. You can also download a sample application. Author: James Kofalt Company: SAP Created on: 13 May 2009 Author Bio As Program Manager for SAP Business One Software Solution Partners, Jim Kofalt is responsible for the industry solutions program and other initiatives that drive new business for SAP and its channel partners. Jim has 20 years experience in the software industry, including roles in product management and strategy, business development, and systems implementation. 2009 SAP AG 1

Table of Contents Using the JournalEntries Object...4 Related Contents...6 Copyright...7 2009 SAP AG 2

Introduction If you have been working with the Data Interface API (DI-API), chances are you have used the JournalEntries object to bring general ledger transactions into SAP Business One. Version 6.5 of the DI-API now includes a JournalVouchers object. In this article we will look at how to use the JournalEntries and JournalVouchers objects to import data into SAP Business One from a tab-delimited text file. As you know, most transactions in SAP Business One are not batched. That is, they are committed to the system right away rather than being stored in a batch which can later be posted. Although most documents can be stored as drafts, there is no process for adding a large number of draft documents to the system at one time. The exception to this rule is to use the journal vouchers. While journal entries are familiar to anyone who has worked with financial systems, the term "journal voucher" may be a new term for many people. A journal voucher is essentially a collection of draft journal entries that can be reviewed and saved to the permanent file as a group. In other words, for practical purposes, a journal voucher acts like a batch of journal entries. The following discusses how to add journal entries directly (without using the JournalVouchers object), and then describes how to add them with the JournalVouchers object. Our sample application reads data from a tab-delimited text file and populates a grid with data from that file. The Journal Entry button creates a separate journal entry in SAP Business One for each unique reference number. In the example shown here, two journal entries are created, one for the lines containing Reference # 123, and another for the lines containing Reference #124. The Journal Voucher button creates one journal voucher in SAP Business One. Within the journal voucher, a separate journal entry is created for each unique "Reference #". In the example shown here, two journal entries are created within a single journal voucher. 2009 SAP AG 3

Using the JournalEntries Object Using the JournalEntries object is pretty straightforward. You need to create an instance of the JournalEntries object and a corresponding JournalEntries_Lines object. Then loop through the lines one at a time, set properties on each line and add it to the collection. When you are finished, call the Add method on the JournalEntries object. The following example shows a simplified process for adding a journal entry containing two lines: Set oje = vcompany.getbusinessobject(ojournalentries) Set olines = oje.lines oje.memo = "My Journal Entry" 'Add Lines to Journal Entry olines.accountcode = GetAccountCode("11210000-01-001-01") olines.debit = 500 olines.add olines.accountcode = GetAccountCode("12510000-01-001-01") olines.credit = 500 olines.add lretcode = oje.add The AccountCode property of the JournalEntries_Lines object can be a bit confusing. Many people assume that the AccountCode corresponds to the General Ledger Account Number that the user sees. In fact, the AccountCode specifies a value from the AcctCode field of the OACT table. The sample application includes a function called GetAccountCode that takes the General Ledger Account Number as an input parameter and returns the corresponding value from the OACT table. Using the JournalVouchers Object The JournalVouchers object is very simple insofar as it contains only two members: 1. The Add method creates a new journal voucher. 2. The JournalEntries property is an object representing a collection of journal entries within the journal voucher. Start by creating a new JournalVouchers object. This will automatically create a JournalEntries collection - you do not need to create one manually. After you have created a JournalVouchers object, you can start adding journal entry lines. Here is a simplified example in which we are adding a journal voucher consisting of two journal entries. Each journal entry in this example contains two lines of detail: Set ojv = vcompany.getbusinessobject(ojournalvouchers) ojv.journalentries.lines.accountcode = GetAccountCode("11210000-01-001-01") ojv.journalentries.lines.debit = 500 ojv.journalentries.lines.accountcode = GetAccountCode("12510000-01-001-01") ojv.journalentries.lines.credit = 500 ojv.journalentries.add ojv.journalentries.lines.accountcode = GetAccountCode("12400000-01-001-01") ojv.journalentries.lines.debit = 1000 2009 SAP AG 4

ojv.journalentries.lines.accountcode = GetAccountCode("62100000-01-001-01") ojv.journalentries.lines.credit = 1000 ojv.add Note that we do not call ojv.journalentries.add until after the first journal entry has been created, and we do not call this method again after the second journal entry has been created. This is because the JournalVouchers.JournalEntries collection contains one empty journal entry when it is created. By calling JournalVouchers.JournalEntries.Add, you are creating a new (empty) journal entry. If you do this just before you call the JournalVouchers.Add method, you will be trying to add a journal voucher that contains a new (empty) journal entry. This will return an error stating that the journal entry date does not fall within the correct parameters. 2009 SAP AG 5

Related Contents Download the sample application (7KB ZIP file) and try to import some data by editing the text file. We recommend that you begin by clicking on the "Instructions" button, which will provide additional details on how to use the sample application. For more information, visit the Business One homepage. 2009 SAP AG 6

Copyright Copyright 2009 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9, iseries, pseries, xseries, zseries, eserver, z/vm, z/os, i5/os, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server, PowerVM, Power Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes, BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX, Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects S.A. in the United States and in other countries. Business Objects is an SAP company. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. 2009 SAP AG 7