Adding Journal Vouchers
Hello there,
I am having a problem adding Journal Vouchers to SAP using the DIAPI. I have gotten everything from an "Unbalanced Transaction Error" to a "Date deviates from permissible range Error". Here is my code in VB. Please if anyone can help it would be much appreciated
(I am reading a recordSet object to populate the fields of the journal voucher)
''set up the header of the journal voucher
oJV.JournalEntries.ReferenceDate = FormatDateTime(oRecord.Fields.Item("PosDate").Value, vbShortDate)
oJV.JournalEntries.Reference = oRecord.Fields.Item("Descr").ValidValue
''set up the lines of the journal entries
syscode = oRecord.Fields.Item("SysCode").Value
oJV.JournalEntries.Lines.SetCurrentLine(lineCount)
oJV.JournalEntries.Lines.DueDate = FormatDateTime(oRecord.Fields.Item("PosDate").Value, vbShortDate)
oJV.JournalEntries.Lines.ReferenceDate1 = FormatDateTime(oRecord.Fields.Item("PosDate").Value, vbShortDate)
oJV.JournalEntries.Lines.ReferenceDate2 = FormatDateTime(oRecord.Fields.Item("PosDate").Value, vbShortDate)
oJV.JournalEntries.Lines.VatDate = FormatDateTime(oRecord.Fields.Item("PosDate").Value, vbShortDate)
oJV.JournalEntries.Lines.TaxDate = FormatDateTime(oRecord.Fields.Item("PosDate").Value, vbShortDate)
oJV.JournalEntries.Lines.AccountCode = oRecord.Fields.Item("SysCode").Value
oJV.JournalEntries.Lines.ShortName = oRecord.Fields.Item("SysCode").Value
oJV.JournalEntries.Lines.Reference1 = oRecord.Fields.Item("Descr").Value
If oRecord.Fields.Item("Debit").Value = 0 Then
oJV.JournalEntries.Lines.Credit = oRecord.Fields.Item("Credit").Value
oJV.JournalEntries.Lines.Debit = 0
End If
If oRecord.Fields.Item("Credit").Value = 0 Then
oJV.JournalEntries.Lines.Debit = oRecord.Fields.Item("Debit").Value
oJV.JournalEntries.Lines.Credit = 0
End If
'if need be, add a line to the journal entry
If lineCount <> 1 Then
oJV.JournalEntries.Lines.Add()
End If
'every two lines in my record set it a journal entry
'so check if a journal is ready to be added
If lineCount Mod 2 <> 0 Then
'add a journal entry to the voucher
If oJV.JournalEntries.Add() <> 0 Then
MessageBox.Show(oCompany.GetLastErrorDescription)
End If
lineCount = 0
addedJE = True
End If
oRecord.MoveNext()
If addedJE = False Then
lineCount += 1
End If
End While
''add the journal voucher
If oJV.Add() <> 0 Then
MessageBox.Show(oCompany.GetLastErrorDescription)
End If
End Sub
Hi guys!
Thanks for your help.I have checked my debits and credits and I have simplified my code alot. I am able to now add a journal voucher with one journal with multiple lines. The problem seems to have been when i tried to call oJV.JournalEntries.Add(). It seems you just have to add the JournalLines and then the actual Journal Voucher.
That is all fine but now i am having a problem setting different Posting Date (ReferenceDate on the Object), DueDate(DueDate on the Object) and Document Date (TaxDate on the Object).
The Journal Voucher is added to SAP but all three dates are the same when in my code, i have set the Document Date to be different from the Posting Date. Could this be because I am using a Document Date of 19/12/07 and a Posting Date of 23/11/07 ( in another period)??? i dont knw. Please help if you can. My code is below :
''set up the lines
syscode = oRecord.Fields.Item("SysCode").Value
oJV.JournalEntries.Lines.SetCurrentLine(lineCount)
''Set Dates on lines
oJV.JournalEntries.Lines.ReferenceDate1 = FormatDateTime(oRecord.Fields.Item("PosDate").Value, vbShortDate)
oJV.JournalEntries.Lines.DueDate = FormatDateTime(oRecord.Fields.Item("PosDate").Value, vbShortDate)
oJV.JournalEntries.Lines.TaxDate = FormatDateTime(oRecord.Fields.Item("DocDate").Value, vbShortDate) ''Doc Date*******
oJV.JournalEntries.Lines.AccountCode = oRecord.Fields.Item("SysCode").Value
oJV.JournalEntries.Lines.Reference1 = oRecord.Fields.Item("Descr").Value
If oRecord.Fields.Item("Debit").Value = 0 Then
oJV.JournalEntries.Lines.Credit = oRecord.Fields.Item("Credit").Value
oJV.JournalEntries.Lines.Debit = 0
End If
If oRecord.Fields.Item("Credit").Value = 0
oJV.JournalEntries.Lines.Debit = oRecord.Fields.Item("Debit").Value
oJV.JournalEntries.Lines.Credit = 0
End If
oJV.JournalEntries.Lines.Add()
oRecord.MoveNext()
If addedJE = False Then
lineCount += 1
End If
pbStatus.Value += 1
End While
If oJV.Add() <> 0 Then
MessageBox.Show( oCompany.GetLastErrorDescription)
squery = squery.Replace("'", "")
End If
Kind regards,
Greeshma
Similar Messages
-
Hi All
can anybody tell me while adding journal vouchers how to capture debit entries , credit entries and contra entries (i.e how to distinguished between debit entries , credit entries and contra entries )
waiting for your response
rgs
anandHi Anand
You can use transaction codes for the same, since you required to know the particular transaction falling under which category before posting to JE .
You can create transaction codes
Administration - Setup - Financials - Transaction Codes.
regards
Rashid -
Error getting the Journal Vouchers Object
Hi Experts,
I am trying to get the object for Journal Vouchers. I did as always using "B1iSN - B1 Object Help", I found it with "Name JournalVouchers LocalID 28 B1iSN_ObjectType B1.8.8_JV" but when I try to Retrieve the Object I got this error message:
SAP B1iP detected an error:
Emitted HTTP-Code
500 - Internal Server Error
Internal Reason
No get method availabe for SBO object type : 28
(I copied the message, incluiding the misspelled word "available")
I have done this with other objects like journal entries and it works Ok , but I cannot do it with Journal Vouchers.
any help?
thanks in advance,
DavidHi David,
the problems seems to be that B1 creates an event for Journal Voucher (oject Id=28) with following key parameters:
- BatchNum
- TransId
the XML DI Schema of journal Voucher does only have one key parameter:
- BatchNum
The difference between the SQL Definition (by the B1-Event, SBO-COMMON table SEVT) and the DI API Definition causes your problem with the standard Data Retrieval of B1iSN via DI API object.
Actually there is a way to change the data retrieval within B1iSN (details in B1iSN Guide - 03 Extensibility, chapter 2.6 Object Type: change B1 Data Retrieval, page 12).
Please goto "B1iSN Tools -> Development Tools -> Graphical scenario design" select your BizPackage, BIU and BIUMETA.
In the opened window "B1iSN Design Time -Diagram" select the segment B1 Inbound and press button "New" and change the B1 Inbound Method for Object Type B1.8.8_JV to:
- SQL Data Retrieval via DI-API
- SQL Statement:
select * from OBTD where BatchNum={key}
Keep in mind that this is only an easy example and you now need to take explicitly care of the mapping into the DI API XML structure again (<xsl:copy-of select="./*"/> will just copy the result of the SQL-statement above, now)
You can also check out to use "Multiple Data Retrieval" as documented in the B1ISN Guide.
Best regards
Bastian -
Dear all
With F.13 how credit Journal Vouchers and balances be adjusted against unpaid invoices
using FIFO method.
What critera IN FB74 we need to write for automatic clearing of transactions.
Thnax - Viru.unsolved
-
Hi,
I try to print out from Journal Vouchers, and i need to print some UDF on Journal Vouchers, but can't choose any UDF in Print Layout Desinger.
Any Comments?Hi Gordon,
Thanks for your reply.
I make the 2 UDF on Journal Vouchers (row level), this setup both in Journal Entry.
1. BP Code (format search)
2. BP Name (format search)
In Journal Entry PLD, i can select BP Code & BP Name in database field, but in Journal Vouchers PLD can't select this in database field.
Journal Vouchers PLD can't support UDF print out right?
Thanks!
Ricky -
Hi everybody.
We've developed an addon for B1 2007A PL 42 and we are facing some concurrency issues.
Some background information:
The add-on has to create a Journal Entry every time an Incoming Payment is made for an Invoice that is in foreign currency and the exchange rate of the day the document is paid is different of that of the Invoice.
This is acheived by catching a successful Incoming Payment using the following code:
if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED && pVal.FormTypeEx == "170"
&& pVal.ItemUID == "1" && pVal.Action_Success && !pVal.BeforeAction)
//some calculations
oJEntry.Add();
This works fine except when 2 (or more) users simultaneously add an Incoming Payment (i.e They click the ADD button (almost) at the same time)
When this happens only the last Journal Entry gets added.
Any idea how to solve this?
Thankstry to use transactions in je adding as
If Not SAP.Connection.oCompany.InTransaction Then
SAP.Connection.oCompany.StartTransaction()
End If
create je
if its added ok, use¨
If SAP.Connection.oCompany.InTransaction Then
SAP.Connection.oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_Commit)
End If
otherwise
If SAP.Connection.oCompany.InTransaction Then
SAP.Connection.oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack)
End If -
Adding Journal Entry throgh Incoming Payments,
Hi Friend,
I need Help ....
I need to create a journal entry using incoming payment. I have different types of deduction Accounts. All deductions need to display in journal entry and also its reflect in Invoice.Then only invoice going to close.
Dim junEntry As SAPbobsCOM.JournalEntries
Ex :-
:::::Journal Entry::::::
*Account Code/BpName* *AccountName* *DR* *CR*
620005 Deduction1 10
620006 Deduction2 100
620007 Deduction3 100
620008 Deduction4 115
620009 Deduction5 10
6200010 Deduction6 10
6200011 Cash Recived 655 1000
1000 1000
Dim decDebi As Decimal = 0
Dim dtCount As Integer = dtDataTable.Rows.Count - 1
junEntry = objAddOnCentral.objCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries)
junEntry.Memo = strBpCode
junEntry.ReferenceDate = Now.Date
For intLoop = 0 To dtDataTable.Rows.Count - 1
junEntry.Lines.AccountCode = dtDataTable.Rows(intLoop)("Account").ToString()
junEntry.Lines.Debit = dtDataTable.Rows(intLoop)("Amount").ToString()
decDebi += CDec(dtDataTable.Rows(intLoop)("Amount").ToString())
junEntry.Lines.Add()
Next
junEntry.Lines.ShortName = strBpCode.Replace("Incoming Payments", "")
junEntry.Lines.Credit = decDebi
junEntry.Lines.Add()
intErrCode = junEntry.Add()
If intErrCode <> 0 Then
objAddOnCentral.objApplication.StatusBar.SetText("" & objAddOnCentral.objCompany.GetLastErrorCode & " " & objAddOnCentral.objCompany.GetLastErrorDescription & "", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
Return False
End IfHi,
I thing no need addon once u add incoming payment automatically invoice will close and JE also will pass.
Regards,
Siva -
How to increase the length of Remarks in Journal Vouchers
Hi SAP Guru,
I am new in SAP Business One. Normally our Narration which we feed in Details of Journal Voucher is longer than the space provided. Is there any way to increase the length of Details field in Journal Voucher or Some other way we can cater this requirement.
Thanks for answers in advance
J.S.RanaHi Rana,
In this case, you have to create a user defined field of required length under Journal Transactions Header to fill the data.
Regards,
Vijay Kumar
SAP Business One Forums Team -
Adding journal entry to bussiness partner
Hello There
I am trying to create a journal entry for a business partner.
the issue is because the business partner doesn't appear officially/directly in the chart of account- I get an error for that.
(the property is : jr.Lines.AccountCode )
(when I use an account that appears in the chart of account, everything works fine)
any suggestions?
rgds
HAGAI
jr.Lines.SetCurrentLine(0)
jr.TaxDate = TAX_DATE
jr.Lines.AccountCode = cardId
jr.Lines.Debit = SUM
jr.Lines.DueDate = DUE_DATE
' vje.Lines.Line_ID = 0
jr.Lines.ReferenceDate1 = Date.Today
jr.Lines.ShortName = cardName
jr.Lines.TaxDate = TAX_DATE
jr.Lines.Add()
'MsgBox(vje.Lines.Line_ID)
jr.Lines.SetCurrentLine(1)
jr.Lines.AccountCode = BANKCODE
jr.Lines.Credit = SUM
jr.Lines.DueDate = DUE_DATE
jr.Lines.ReferenceDate1 = Date.Today
jr.Lines.ShortName = BANKCODE
jr.Lines.TaxDate = TAX_DATE
If lRetCode <> jr.Add() Then
oCompany.GetLastError(lErrCode, sErrMsg)
writeToLog(lErrCode, sErrMsg, Date.Today, False)
Return
End IfHi Hagai!
hope that thread helps you to solve your problem:
JournalEntries -
Importing Journal Vouchers using DTW
Hellow to all,
I want to import one Journal Voucher with few transactions. each transaction having few lines.
How can i link the filles:JournalEntries_Lines,JournalEntries,JournalVouchers
enyone????Hi
below is JournalEntries record
RecordKey JdtNum AutoVAT DueDate Indicator Memo ProjectCode Reference Reference2 ReferenceDate Series StampTax StornoDate TaxDate TransactionCode UseAutoStorno VatDate
RecordKey JdtNum AutoVAT DueDate Indicator Memo ProjectCode Reference Reference2 ReferenceDate Series StampTax StornoDate TaxDate TransactionCode UseAutoStorno VatDate
1 tNO 20050104 1 2 20050104 23 tNO 20050104 20050104 tNO 20050104
2 tNO 20050104 1 2 20050104 23 tNO 20050104 20050104 tNO 20050104
3 tNO 20050104 1 2 20050104 23 tNO 20050104 20050104 tNO 20050104
below is JournalEntries_lines record
RecordKey LineNum AccountCode AdditionalReference BaseSum ContraAccount CostingCode Credit Debit DueDate FCCredit FCCurrency FCDebit GrossValue LineMemo ProjectCode Reference1 Reference2 ReferenceDate1 ReferenceDate2 ShortName SystemBaseAmount SystemVatAmount TaxDate TaxGroup VatAmount VatDate VatLine
RecordKey LineNum AccountCode AdditionalReference BaseSum ContraAccount CostingCode Credit Debit DueDate FCCredit FCCurrency FCDebit GrossValue LineMemo ProjectCode Reference1 Reference2 ReferenceDate1 ReferenceDate2 ShortName SystemBaseAmount SystemVatAmount TaxDate TaxGroup VatAmount VatDate VatLine
1 0 _SYS00000000050 100 _SYS00000000050 100 0 20050104 0 0 1 2 20050104 20050104 _SYS00000000050 20050104 10 20050104 tNO
1 1 _SYS00000000050 100 _SYS00000000050 0 100 20050104 0 0 1 2 20050104 20050104 _SYS00000000050 20050104 10 20050104 tNO
2 0 _SYS00000000050 100 _SYS00000000050 100 0 20050104 0 0 1 2 20050104 20050104 _SYS00000000050 20050104 10 20050104 tNO
2 1 _SYS00000000050 100 _SYS00000000050 0 100 20050104 0 0 1 2 20050104 20050104 _SYS00000000050 20050104 10 20050104 tNO
3 0 _SYS00000000050 100 _SYS00000000050 100 0 20050104 0 0 1 2 20050104 20050104 _SYS00000000050 20050104 10 20050104 tNO
3 1 _SYS00000000050 100 _SYS00000000050 0 100 20050104 0 0 1 2 20050104 20050104 _SYS00000000050 20050104 10 20050104 tNO
Basic thing u want to link is RecordKey of JournalEntries with RecordKey JournalEntries_lines.
Please also refer Sample data
Thanks
Kevin -
Outputs - Cash/Bank/Journal Vouchers Debit/Credit Note
Hi Gurus,
Please tell me, how to get outputs or print layouts of above mentioned Vouchers?
Do i need to configure in the system?
Kindly revert asap
Thank Youyeah, you need to configure in the system if you want from system
Through Correspondence.
Please check correspondence
Thanks -
Hi all,
At the end of the day, we have some journals in HFM set as "approved". Is there any way to post these journals automatically (using the Taskflow Manager, etc)?
Thanks!Doesn't seem to work for me. I put a % sign in the label box, but I get the following error when I look at the Taskflow status page:
The journal no longer exists in the system. The Journal you are trying to load has been deleted and cannot be processed.
Any ideas? Thanks -
JOURNAL VOUCHER APPROVAL PROCESS
Dear Experts,
I want to create an approval procedure for Journal Vouchers.
I did the following:-
I created a UDF - MD-Approval on accounting - Journal transactions header with valid values of Pending, Declined and Approved. Pending is the default value. The field is a mandatory field.
I made the MD the only user who can edit this field by creating a category in Settings- Fields - setup that is relevant to him only
I created a stored procedure to block posting of journal Vouchers unless the UDF status reads "approved"
--------- Block unapproved Journal Voucher-----
if @object_type = '30' and @transaction_type IN ('A', 'U')
BEGIN
IF Exists (Select T0.TransID from dbo.OBTF T0
WHERE T0.TransId=@list_of_cols_val_tab_del and U_MD_APPROVAL <> 'Approved')
select @error = 101, @error_message = 'This Journal Voucher requires MD Approval'
End
The stored procedure above is not working and journal voucher are processed irrespective of the udf field status. Kindly review and let me know what is wrong with it.
Regards
George NjugunaHi
U have to amend it like this :
if @object_type = '30' and @transaction_type IN ('A', 'U')
BEGIN
IF Exists (Select T0.TransID from dbo.OJDT T0
WHERE T0.TransId =@list_of_cols_val_tab_del and t0. U_MD_APPROVAL <> 'Approved' and Transtype='30')
select @error = 101, @error_message = 'This Journal Voucher requires MD Approval'
if @object_type = '30' and @transaction_type IN ('A', 'U')
BEGIN
Set @Transtype =(Select Transtype from OJDT WHERE T0.TransId =@list_of_cols_val_tab_del )
declare @Transtype as int
If Transtype='30'
Begin
IF Exists (Select T0.TransID from dbo.OJDT T0
WHERE T0.TransId =@list_of_cols_val_tab_del and t0. U_MD_APPROVAL <> 'Approved' )
select @error = 101, @error_message = 'This Journal Voucher requires MD Approval'
End
END
Thanks
TAruna -
Adding JornalEntries from GetObjectFromXml
Hi everybody,
i'm receving this message when Adding journal entries loaded by GetObjectFromXml: "You cannot edit totals in system currency JDT1.SYSCred line 1". Seems to be the same error in this thread....
Re: GetBusinessObjectFromXML doesn't work with JournalEntries in 2005A SP1 , some solution or idea?!!
Thanks,
Leo Azevedo
PS: My SAPbosCOM version 2007.0.0.0Hi Leonardo,
I attached an example of a valid journal entry. You will notice this xml has two lines. This is the minimum, a journal entry must always be balanced, and therefore will always have two lines for a minimum containing a credit amount and a debit amount. I couldn't find the counter amount in the example you attached. If you edit this sample it will probably work.
Kind regards,
Winfried Tiemessen
<?xml version="1.0" encoding="UTF-16"?><BOM><BO><AdmInfo><Object>30</Object><Version>2</Version></AdmInfo><JournalEntries><row><ReferenceDate>20100507</ReferenceDate><Memo>Leveringen - C1001</Memo><Reference>42</Reference><Reference2></Reference2><TaxDate>20100507</TaxDate><UseAutoStorno>tNO</UseAutoStorno><Series>23</Series><StampTax>tNO</StampTax><DueDate>20100507</DueDate><AutoVAT>tNO</AutoVAT><ReportEU>tNO</ReportEU><Report347>tNO</Report347><BlockDunningLetter>tNO</BlockDunningLetter><AutomaticWT>tNO</AutomaticWT></row></JournalEntries><JournalEntries_Lines><row><Line_ID>0</Line_ID><AccountCode>7000</AccountCode><Debit>2.490000</Debit><Credit>0.000000</Credit><FCDebit>0.000000</FCDebit><FCCredit>0.000000</FCCredit><DueDate>20100507</DueDate><ShortName>7000</ShortName><ContraAccount>3000</ContraAccount><LineMemo>Leveringen - C1001</LineMemo><ReferenceDate1>20100507</ReferenceDate1><Reference1>42</Reference1><Reference2></Reference2><ProjectCode></ProjectCode><CostingCode></CostingCode><TaxDate>20100507</TaxDate><BaseSum>0.000000</BaseSum><DebitSys>2.490000</DebitSys><CreditSys>0.000000</CreditSys><VatLine>tNO</VatLine><SystemBaseAmount>0.000000</SystemBaseAmount><VatAmount>0.000000</VatAmount><SystemVatAmount>0.000000</SystemVatAmount><GrossValue>0.000000</GrossValue><AdditionalReference></AdditionalReference><TaxPostAccount>tpa_Default</TaxPostAccount><WTLiable>tNO</WTLiable><WTRow>tNO</WTRow></row><row><Line_ID>1</Line_ID><AccountCode>3000</AccountCode><Debit>0.000000</Debit><Credit>2.490000</Credit><FCDebit>0.000000</FCDebit><FCCredit>0.000000</FCCredit><DueDate>20100507</DueDate><ShortName>3000</ShortName><ContraAccount>7000</ContraAccount><LineMemo>Leveringen - C1001</LineMemo><ReferenceDate1>20100507</ReferenceDate1><Reference1>42</Reference1><Reference2></Reference2><ProjectCode></ProjectCode><CostingCode></CostingCode><TaxDate>20100507</TaxDate><BaseSum>0.000000</BaseSum><DebitSys>0.000000</DebitSys><CreditSys>2.490000</CreditSys><VatLine>tNO</VatLine><SystemBaseAmount>0.000000</SystemBaseAmount><VatAmount>0.000000</VatAmount><SystemVatAmount>0.000000</SystemVatAmount><GrossValue>0.000000</GrossValue><AdditionalReference></AdditionalReference><TaxPostAccount>tpa_Default</TaxPostAccount><WTLiable>tNO</WTLiable><WTRow>tNO</WTRow></row></JournalEntries_Lines></BO></BOM> -
Is it possible that Manual Journal Entry go for approval
Hi All,
If it is possible to Journal Entry go for approval. I see in Approval Template there is no Document like check box Journal entry, so please any one can help in this.
Regards,
Arbaaz.Hi,
Use Journal Vouchers instead of journal Entry.
For Ex :
1.User Enter Journal Vouchers.
2. Finance manager or Accts manager open the
Journal vouchers and convert it to Journal Entry.
*Close the thread if issue solved.
Regards
Jambulingam.P
Maybe you are looking for
-
SET PARAMETER AND GET PARAMETER
What is the difference between Set parameter and Get parameter?
-
My trackpad is not working properly already. Is it eligible for replacement?
My trackpad is not working properly sometimes and it takes too long for my macbook to open
-
Hi all, we would like to create interface between SAP(data source contain all views) to Essbase. Currently we are using Oracle Financials for mappping data into Essbase. Kindly let us know your views and suggestions on the same. Regards Rajesh
-
Unity Connection on BE6K. 10 messages per user????
I must be misreading this surely! The BE6K Data Sheet quotes "Voicemail Capacity: 10 voicemail messages per user." http://www.cisco.com/en/US/partner/prod/collateral/voicesw/ps6788/vcallcon/ps11370/data_sheet_c78-718398_ps11369_Products_Partner_Resou
-
Remove all records in table OSPP
Hi all, I have a customer that is wondering if there is a quick and easy way to delete all records in table OSPP. He is in the implementing stage and has made a mistake. If anyone has any advice that will not break the support contract with SAP that