Cannot Add a new Accounting Entries - SDK

Dear Sir,
I need to add an accounting entry into SAP BO via SDK.
I am using the following code:
For iColCount = 1 To lFactorColl.Count
                    '//Search  Accounting information
                    oTable = oDataSet.Tables("DocList")
                    Dim oSRows() As DataRow = oTable.Select("FactorCode = '" & lFactorColl.Item(iColCount).ToString & "'")
                    oJE = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries)
                    Try
                        iIndex = 0
                        oJE.TaxDate = CDate(Right(oDate, 2) & "/" & Mid(oDate, 5, 2) & "/" & Left(oDate, 4))
                        oJE.DueDate = CDate(Right(oDate, 2) & "/" & Mid(oDate, 5, 2) & "/" & Left(oDate, 4))
                        oJE.ReferenceDate = CDate(Right(oDate, 2) & "/" & Mid(oDate, 5, 2) & "/" & Left(oDate, 4))
                        oJE.Memo = "test"
                        '// Set the first lines for the clients invoices - credit side
                        For iRowCount = 0 To oSRows.GetUpperBound(0)
                            iIndex = iRowCount
                            oJE.Lines.SetCurrentLine(iIndex)
                            'sAccountKey = GetAccountKey(oSRows(iRowCount)("CardCode"))
                            oJE.Lines.ShortName = oSRows(iRowCount)("CardCode")
                            'oJE.Lines.AccountCode = oSRows(iRowCount)("CardCode")
                            'sAccountKey = GetAccountKey(oSRows(iRowCount)("FactorCode"))
                            'oJE.Lines.ContraAccount = sAccountKey
                            sFactor = lFactorColl.Item(iColCount + 1).ToString
                            oJE.Lines.Credit = CDbl(Replace(oSRows(iRowCount)("Amount"), ".", ","))
                            sTotalAmt = sTotalAmt + CDbl(Replace(oSRows(iRowCount)("Amount"), ".", ","))
                            oJE.Lines.Add()
                        Next iRowCount
                        'Set the factor line - debit side
                        iIndex = iIndex + 1
                        oJE.Lines.SetCurrentLine(iIndex)
                        'sAccountKey = GetAccountKey(sFactor)
                        'oJE.Lines.AccountCode = sFactor
                        oJE.Lines.ShortName = "02"
                        oJE.Lines.Debit = sTotalAmt
                        oJE.Lines.Add()
                        If oJE.Add = 0 Then
                            Dim num As Integer
                            oCompany.GetLastError(num, sStr2)
                            SBO_Application.MessageBox(sStr2)
                        Else
                            SBO_Application.MessageBox("Import was successful!")
                            oJE.SaveXML("c:\JournalEntries" + Str(oJE.Number) + ".xml")
                        End If
                    Catch exception1 As Exception
                    End Try
                Next
this code does not generate any error but no accouting entry are entered although if i try to enter it manually, it is saved in the database.
please advise what it is wrong in my code making it not working properly.
PS: both credit and Debit side in my entry is using the BP code and not G/L account.
Best Regards

There are a couple of things that I noticed, if I'm reading your code right.  First, it appears you are
issuing the oJE.Lines.Add()  command at the end of your loop (which would be in preparation for filling that line with data after reading the next row back at the top of the loop).  If that's the case then when you fill your last good line item with data, you're going to add a blank line into the object, and I think that would fail.
Also, it appears that when you try to add the Journal entry with the code I've copied below,
you are only checking for error messages when the Add succeeds:
If oJE.Add = 0 Then
Dim num As Integer
oCompany.GetLastError(num, sStr2)
SBO_Application.MessageBox(sStr2)
Else
SBO_Application.MessageBox("Import was successful!")
oJE.SaveXML("c:\JournalEntries" + Str(oJE.Number) + ".xml")
End If
I think that the first line of code, above, should be if oJE.Add <> 0 then....
Are you getting your message that says "Import was successful!")?

Similar Messages

  • HT2513 I cannot add a new account to my iCal. All the support documents make it sound so easy but it's not working and I am so frustrated.

    I cannot add a new account to my iCal. Why is this so difficult? I am not stupid. I've tried everything. Any help would be appreciated!
    I try to add a new account and it doesn't work no matter what I try. Thanks.

    Is it your own domain?
    Have you tried setting up as Exchange?

  • I cannot add a new pop email account in my "iphone 6"

    I cannot add a new pop email account in my iphone, when i confirmed "saving account" it is automatically being closed and kick-out me from?
    It is iPhone 6 and the system is iOS 8.1
    I am going to select "Others" and then my user name, password and "next".
    Then IMAP and POP settings screen is coming. I am going to select "POP" with my incoming and outgoing server details.
    And finally I am going to proceed with "save".... So... pupff........ it is going, closing, kicking me out. Maybe 20-25 times since yesterday I try it but no win.
    What should I do for these my friends. This is my business email... It was working before in iPhone 5s and afte iPhone 6 I make reset for 5s.
    I try later on for 5s again. It make me the same thing also. They are not allowing me to add a new pop email address.

    Is it your own domain?
    Have you tried setting up as Exchange?

  • Cannot add a new email account, and hence icloud account. When i go into Settings - Mail, accounts, calendars,  the option to add a new account cannot be clicked (ghosted). I also have iCloud Settings ghosted (unclickable). Cannot change in itunes also.

    Cannot add a new email account, and hence i have no way of creating an iCloud account (very frustrating). I had the same problem with iOS 4.3 but i had no email account to create as i set both up when i bought the iPhone 4. After adding a company email and a gmail account (both wok perfectly) i noticed that the option to create more email accounts had been ghosted (unclickable). This didn't worry me at the time. However, iCloud needs me to create one in here so i can access the cloud which i desperately want the ability to do. When i go into Settings -> Mail, accounts, calendars,  the option to add a new account cannot be clicked (ghosted). I also have iCloud in the iPhone Settings ghosted (unclickable). I have same problem in itunes on Mac OSX. Surely restoring isn't the solution as i restored my iphone when changing from iOS 4.3 -> 5. Please help?

    Go to
    Settings,
    General,
    Restrictions, type in your Restriction Password,
    Accounts, tick Allow Changes.
    Press the back key a few times till you're back in Settings, you should see iCloud is now highlight able, now go to Mail Contacts and Calenders and add your email account as per norm.
    Hope this helps.

  • I have changed settings on my email account with my provider, but in order to activate the address they instructed me to delete my account and add a new account with the same email address. Will this delete my all my email history? Any advise please?

    I have an OS X 10.6.8 and have had problems with my mail. I have changed my account settings with my mail provider, but they suggest I now delete my account and add a new account with the same email address. Will this delete my email history? Can anyone please advise?

    I have the same problem as the emails go to my iCloud account that I cannot access!!! I cannot answer the security questions as someone else must have set up my iCloud account. Nothing seems to work. It would be great if someone has some ideas as what can be done to recover the situation?

  • Cannot add Second Exchange Account to Outlook 2013

    Cannot add second exchange account to same profile on Outlook 2013. I went through control panel, mail and tried to add the second exchange account there but I keep getting rundll32 has stopped working error. Using Windows 8.1. Any suggestions on what
    I should do?

    Hi,
    I have some suggestions to troubleshoot this problem.
    Run Windows on Clean Boot mode. Here is the link.
    http://support.microsoft.com/kb/929135
    Reinstall Office
    Following are the steps for configuring multiple-account in Outlook.
    Click File in Outlook then click Account Settings.
    Choose E-mail Accounts.
    Click New and input your Second Exchange Account information, then click
    Next.
    If the issue persists, please post your issue in Outlook forum. Here is the link.
    http://social.technet.microsoft.com/Forums/office/en-US/home?forum=outlook
    Thanks.

  • The calendar events on  iPhone 4 have been deleted and cannot add any new events

    iphone 4 calendar-- all events erased and cannot add any new events-- + is grayed out!

    Hi all,
    I work for an Enterprise with around 30 devices so far, 5 of them have been upgraded to iOS 5.01 and we are having this issue, the steps below are appearing, these are both on iphone and ipad 2's with exchange 2003:-
    - Exchange Calendars not sync'ing, but Yahoo account working fine.
    - Create an appointment on the ipad / iphone and this sync's with Exchange.
    - Close the Calendar and re-open the appointment disappears, but stay's within Exchange.
    - Meetings created within the Exchange Calendar do not synch with the iphone / ipad.
    This is starting to cause a lot of issues.
    Thanks
    Keith

  • HT5312 How can I reset my security question and I cannot create a new account because I have £18 on the account that I can't remember the security questions to

    How can I reset my security question and I cannot create a new account because I have £18 on the account that I can't remember the security questions to

    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then steps 1 to 5 on the page that you posted from should let you reset them : go to https://appleid.apple.com/ and click 'Manage your Apple ID' on the right-hand side of that page and log into your account, then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you should see an option to send security question reset info to your rescue email address.
    If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then you won't get the reset option - you will need to contact iTunes Support or Apple to get the questions reset.
    e.g. you can try contacting iTunes Support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Account Management , and then 'Forgotten Apple ID security questions'
    or try ringing Apple in your country and ask to talk to the Accounts Security Team : http://support.apple.com/kb/HE57
    When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down the page that you posted from to add a rescue email address for potential future use, or if it's available in your country you could change to 2-step verification : http://support.apple.com/kb/HT5570

  • "Mission Control" does not show space row and I cannot add a new space (27 inch screen)

    Firstly, "Mission Control" does not show upper row with spaces. I have configured Dashboard as space, but it is not showed either.
    Second, I cannot add a new space because the upper right corner wont show an empty space.
    In system I have configured (Mission Control) the upper right corner as "mission control".
    I do run a 27-inch screen

    I'm having the exact same problem. I have a Macbook Pro that I connect to a 27inch iMac through the mini display port. Whenever I attempt to launch Mission control to move a program to a different space, the "Spaces" dont appear at the top of the screen. Is anyone have an answer for this?
    Also, does anyone know of a 3rd party program to bring "Spaces" back? That was my #1 favorite thing of Snow Leopard, and I need to get that functionality back.
    Thanks

  • Cannot add a new playlist to my iphone - Help!!!

    I am not able to add a new playlist to my iphone.  I recently changed my computer, and when I choose the option to manually manage my music, I get a message that my phone is synced to a different itunes library, and if I sync to this library my content will be erased.  Obviously I did not continue.  I authorized this computer (which I had not done before), but I still cannot add a new playlist.  What can I do?

    I found this solution on a gogle discussion site, and it works.
    "In iTunes, right click the playlist on your iPhone then select "export" to export the playlist as a .txt file (I have 3GS with iOS5). 
    Then still in iTunes, select "File, Library, Import Playlist", navigate to and open the .txt file, and it will appear in the iTunes sidebar.
    I've tried to do this numerous times before.  Sorry if this is old news but I was so pleased I wanted to share it."
    After creating the playlists in your itunes library, sync your phone with the settings to manually manage your music (which will delete all the music from your phone), then drag the playlists back to your iphone.  You can then start manually managing music on your phone.

  • Cannot add a new reminider.  I am using and Iphone5, version 6.0.2.  When I press the reminder app on the phone there is no  "+" sign to input a reminder.  When I use Siri it says "sorry I wasnt able to create reminder".

    Cannot add a new reminider.  I am using and Iphone5, version 6.0.2.  When I press the reminder app on the phone there is no  "+" sign to input a reminder.  When I use Siri it says "sorry I wasnt able to create reminder".

    Many thanks.
    With those symptoms, I'd try the following document:
    Apple software on Windows: May see performance issues and blank iTunes Store
    (If there's a SpeedBit LSP showing up in Autoruns, it's usually best to just uninstall your SpeedBit Video Accelerator.)

  • TS1347 I don't have the + displayed on my iPad mini contacts screen and cannot add a new contact

    I don't have the + displayed on my contacts on my iPad mini and cannot add a new contact

    Have you tried restarting or resetting your iPad?
    Restart: Press On/Off button until the Slide to Power Off slider appears, select Slide to Power Off and, after the iPad shuts down, then press the On/Off button until the Apple logo appears.
    Reset: Press the Home and On/Off buttons at the same time and hold them until the Apple logo appears (about 10 seconds).

  • ORABPEL-02052 and cannot add a new domain

    Hi, I develope a very simple BPEL processes and ant it. But it shows error ORABPEL-02052. I add
    <property id="optSoapShortcut">
    <name>Make Calls Via Soap Stack</name>
    <value>true</value>
    <comment><![CDATA[
    Make Calls Via Soap Stack.
    <p/>
    The default value is true.
    ]]></comment>
    </property>
    in domain.xml file. Then, I stop and re start application server. But I still cannot ant the bpel process. However, in the BPEL control, I cannot add a new domain. And it shows err:
    Oracle BPEL Server 10.1.3.4.0
    0
    Fri Jul 18 07:32:24 PDT 2008
    release
    PCBPEL_10.1.3.4.0_GENERIC_080718.0645
    javax.servlet.ServletException
    I use XP and install patch of 10.1.3.4

    I reinstall DB and application server this weekend. I do not install the patch this time.
    This error has not appeared.
    I can add a new domain and delete it in the BPEL control. However, after I add a new domain. I cannot login to the BPEL control from Start->soaInstance->Oracle BPEL processes Manager->BPEL control.
    If I need to login to the default domain, I should key in the default after the address. Why I should do this?
    Edited by: [email protected] on 2009-3-8 下午8:20

  • If I add a new account user,can I sync my iPhone and iPad to that account without effecting the other user?

    If I add a new account user,can I sync my iPhone and iPad to that account without effecting the other user? I'm trying to sync my iPhone and iPad  to a new account on a computer I am now sharing after my computer died.

    Don't create a new iTunes account.
    Just update everything with new info/change password/ security questions.
    -> https://appleid.apple.com/

  • I have iphone 4 and upgraded to IOS 5 software, now I cannot add any new contacts.  Please help

    I have an iphone 4 and have updated to IOS 5 software a couple of days ago.  I cannot add any new contacts or add anything to the calander.  Can anyone help?

    Have you tried a Reset...
    Some Users have reported that a Restore has Resolved Issues after the Upgrade...
    If a Restart and a Reset do not help... Try a Restore from Backup... if the issue persists Restore as New...
    iPhone Reset
    http://support.apple.com/kb/ht1430
    Backing up, Updating and Restoring
    http://support.apple.com/kb/HT1414
    Backup and Set Up as New Device
    http://support.apple.com/kb/HT4137

Maybe you are looking for

  • Bootcamp has frozen my MBP

    errr i've had my MBP for more than a week now and i thought it was about time to install XP and play some great games on my shiney new macbook pro.. got boot camp.. installed.. got cd burnt.. yay.. "please restart" ok.. restarts.. and after an age of

  • When is it mandatory to create a taskflow under WEB-INF folder?

    Hi, Today, I accidentally created a taskflow with a folder structure which is not under WEB-INF. To my surprise it is working. :) 1) Is it safe practice to create a taskflow not under WEB-INF folder? 2) When is it mandatory to create a taskflow under

  • I'm having problems installing lion on my mac

    When I try to install Lion on my iMac I get - This disk is not formatted as Mac OS Extended (Journaled). Use Disk Utility to enable journaling or reformat the desk

  • MIDI freezes Mavericks on MBP13 mid2010

    Greetings! Ok, so this started after installing Mavericks on my MBP13" mid-10, any attempt of cofiguring MIDI(either Audio/MIDIconfig. or by starting any DAW of choice) results in "the spinning beachball of death" followed by a necessary forced quit

  • Iphone in Dominican Republic

    Anyone been to the Dominican Republic with their iphone? Does the phone work there?