Skip to Content
author's profile photo Former Member
Former Member

Stock Transfer Journal


Iam creating a manual journal for stock transfer between warehouses. I want the transfer details to be updated as it in SBO and the journal entry im adding thru code. i dont want the SBO journal to be created.

Kindly can anyone suggest on how to proceed.

im new to SAP

my mail id is

Thanks & Regards

Amudha M.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Feb 09, 2005 at 07:51 AM


    You must capture the Item Event "et_ITEM_PRESSED" of the Add button corresponding to the form you want to modify its behavior (for example the Stock Transfer form UID = 940 and usually add buton has UID = "1").

    If at the reception of this event you want to do your own treatment you must then set BubbleEvent = False. Then B1 will not do anything and you must do the creation of the Stock Transfer and all the actions you want to link with by code.

    It is a short description, I haven't tested it. Try to develop this idea and do a small sample to confirm everything.

    You can use the tool called EventSpy, it is shipped with the SDK version 2004 into SAP Business One SDK/Samples/Utility Projects. With it you can see all events thrown by B1.

    Hope it helps


    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 10, 2005 at 04:49 AM

    HI trinidad

    Thanks for your reply. I have used the same idea to code. Im capturing the ITEM_PRESSED even tof the add button and have set the BubbleEvent to false. Now i have to add the transaction to Stock transfer and a respective journal is also to be added. i have written this code so let me know where im going notable to add the journal as well as stock transfer.

    *******Stock Trnasfer*******************

    Public Sub StockTransfer()

    Dim oST As SAPbobsCOM.StockTransfer

    Dim ostLines As SAPbobsCOM.StockTransfer_Lines

    Dim oEdit1 As SAPbouiCOM.EditText

    Dim oEdit2 As SAPbouiCOM.EditText

    Dim ostXML As SAPbobsCOM.StockTransfer

    Dim ost1 As SAPbobsCOM.StockTransfer

    Dim docnum As Integer

    Dim strcode As String

    oST = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTransfer)

    ost1 = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTransfer)

    ostLines = oST.Lines

    oItem = frmInvJE.Items.Item("11")

    oEdit1 = oItem.Specific

    docnum = oEdit1.String

    oItem = frmInvJE.Items.Item("16")

    oEdit2 = oItem.Specific

    oST.TaxDate = oEdit2.String

    oItem = frmInvJE.Items.Item("14")

    oEdit2 = oItem.Specific

    oST.DocDate = oEdit2.String

    oItem = frmInvJE.Items.Item("18")

    oEdit1 = oItem.Specific

    oST.FromWarehouse = oEdit1.String

    oST.PriceList = "10"

    oST.Series = 32

    oST.Lines.ItemCode = "A00001"

    oST.Lines.WarehouseCode = "02"

    oST.Lines.Price = "500"

    oST.Lines.Quantity = "1"





    ostXML = oCompany.GetBusinessObjectFromXML("E:\SAP\Sample\07Feb05\InvtJE\InvtJE\bin\st2.xml", 0)

    Catch ex As Exception


    End Try



    If oST.GetByKey(oST.DocNum) <> docnum Then

    ost1.DocDate = ostXML.DocDate

    ost1.TaxDate = ostXML.TaxDate

    ost1.Series = ostXML.Series

    ost1.FromWarehouse = ostXML.FromWarehouse

    ost1.Lines.ItemCode = ostXML.Lines.ItemCode

    ost1.PriceList = ostXML.PriceList

    'oST.Lines.ItemDescription = ostXML.Lines.ItemDescription

    ost1.Lines.Quantity = ostXML.Lines.Quantity

    ost1.Lines.Price = ostXML.Lines.Price

    ost1.Lines.WarehouseCode = ostXML.Lines.WarehouseCode



    End If

    Catch ex As Exception


    End Try



    End Sub



    Public Sub CreateJournal(ByVal WHPriceFrom As Double, ByVal WHPriceTo As Double)

    'Dim oCmpny As SAPbobsCOM.Company

    Dim oJE As SAPbobsCOM.JournalEntries

    Dim oJL As SAPbobsCOM.JournalEntries_Lines

    oJE = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries)

    oJl = oJE.Lines

    oJl.AccountCode = ""

    oJl.Debit = WHPriceTo


    oJl.AccountCode = ""

    oJl.Credit = WHPriceFrom


    If WHPriceFrom < WHPriceTo Then

    oJl.AccountCode = ""

    oJl.Credit = WHPriceTo - WHPriceFrom


    oJl.AccountCode = ""

    oJl.Debit = WHPriceFrom - WHPriceTo

    End If






    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Amudha,

      WHen you run the company with "Continuous Stock", a stock transfer will always cause a journal entry to be posted because this is the process in SAP Business One. Search for "continuous stock" in the SAP Business One help and see and when you can change this.

      In addition, I would like to draw your attention to the "Education" section in the SMB Portal on SAP ServiceMarketplace (!

      There's a lot of information tied to the curricula you should go through to get the full picture of what you are dealing with - though you might think you would just use the SDK... 😉

      E.g. there's an "Online Learning Map" and much more!



  • author's profile photo Former Member
    Former Member
    Posted on Feb 14, 2005 at 07:03 AM

    Thanks Frank.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.