cancel
Showing results for 
Search instead for 
Did you mean: 

Journel entry through the program...

Former Member
0 Kudos

Hi.. See the image..

one edit box value is there and one button is there

my requirement is if any body press the button  that particualr value should be added to the particular account.

i had all ready added one account in journal entry.

but it wont work.. is there any reason

I had used this code..

Try

            If (pVal.BeforeAction = True And pVal.FormUID = "TT" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Then

                If (pVal.ItemUID = "53") Then

                    oform = sbo_app.Forms.Item("TT")

                    Dim ojv As SAPbobsCOM.JournalVouchers

                    ojv = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalVouchers)

                    'ojv.JournalEntries.Lines.SetCurrentLine(0)

                    If (oform.Items.Item("25").Specific.value > 0) Then

                        ojv.JournalEntries.Lines.AccountCode = "1134"

                        Dim d As Integer = oform.Items.Item("25").Specific.value

                        ojv.JournalEntries.Lines.Debit = d

                        ojv.JournalEntries.Lines.Add()

                    End If

                    ojv.JournalEntries.Add()

  End If

            End If

        Catch ex As Exception

            sbo_app.MessageBox(ex.Message)

        End Try

Accepted Solutions (1)

Accepted Solutions (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Seenu,

Try this

Oje.Lines.AccountCode = "LH0000ALL";

                            Oje.Lines.Debit = Amount;

                            Oje.Lines.Add();

                            Oje.Lines.AccountCode = "LP0000ALL";

                            Oje.Lines.Credit = Amount;

                            Oje.Lines.Add();

                            int ith = 0;

                            try

                            {

                                ith = Oje.Add();

                                if (ith != 0)

                                {

                                    int irrcode;

                                    string errmsg;

                                    SBO_Company.GetLastError(out irrcode, out errmsg);

                                    Program.oMainSAPDI.ShowMessage(errmsg, BoStatusBarMessageType.smt_Error);

                                }

                            }

                            catch(Exception ex)

                            {

                                Program.oMainSAPDI.ShowMessage(ex.Message, BoStatusBarMessageType.smt_Error);

                            }

Hope it helps

Thanks

Former Member
0 Kudos

Thank u I got the answer...

Answers (1)

Answers (1)

Johan_H
Active Contributor
0 Kudos

You are not checking the return code of the add function.

Do that and you can find out what the problem is.