How to Add Sales order from one database to another database

Hi All,
I am trying to add sales order with sales order object.
I have completed connectivity from one database to another database.
but i am unable to post sales order with orders object.
My code is
ObjSales = objMain.objUtilities.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
            ObjSales.DocDate = Date.Parse(System.DateTime.Now().ToString("d"))
            ObjSales.DocDueDate = Date.Parse(System.DateTime.Now().ToString("d"))
            ObjSales.TaxDate = Date.Parse(System.DateTime.Now().ToString("d"))
            ObjSales.CardCode = "C0006"
           ObjSales.Series = 92
            ObjSales.PaymentGroupCode = 3
            ObjSales.Comments = "vivek"
           ObjSales.Lines.Add()
           ObjSales.Lines.SetCurrentLine(1)
           ObjSales.Lines.ItemCode = "5127"
           ObjSales.Lines.Quantity = 100
           ObjSales.Lines.UnitPrice = 10
           ObjSales.Lines.WarehouseCode = "01"
            ObjSales.Lines.TaxCode = "0"
            ObjSales.Lines.DiscountPercent = "0.00"
            ObjSales.DocTotal = 1000
             If ObjSales.Add <> 0 Then
               objMain.objApplication.SetStatusBarMessage("Sales or Not Posted", SAPbouiCOM.BoMessageTime.bmt_Short, True)
               Exit Sub
            else
              objMain.objUtilities.ShowSuccessMessage("Sales Order Posted successfully")
            End If
The above code is executing successfully.But the Sales order is not getting added.
Thanks in advance.

Hi Vivek,
If the code you posted is not throwing any errors, then the order really does get created. Apparently just not to both databases, am I correct ?
vivek.Y wrote:
> I have completed connectivity from one database to another database.
That means that apparently you have not gotten this bit right.
Generally speaking if you want to create an order into two databases, you first need to connect to both databases and create separate order objects for each database. So you need to do this bit twice; once for each database. Something like this:
ObjSales1 = objMain.objUtilities1.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
ObjSales2 = objMain.objUtilities2.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
Then at the end you also need to add both objects separately:
If ObjSales1.Add <> 0 Then
etc.
If ObjSales2.Add <> 0 Then
etc
Good luck,
Johan

Similar Messages

  • Transfer of sales orders from one plant to another

    Dear all,
    My requirement is as follows:
    I have created some 500 sales orders (open) in one sales org+plant.
    Now due to plant shifting to other area, I want to transfer all the above open sales orders to another sales org+plant.
    One option is to create them manually. But that is time consuming and prone to errors.
    Second option is to upload thru LSMW. That too is very tedious.
    Third option is to extend/assign new plant to the old sales area and change the plant in the orders. But I want in the new sales org + new plant.
    Is there any other option by which I can transfer the above sales orders from one plant to another?
    Regards
    SAPshed

    Hi SAPshed,
    The problem is not the change of plant, which is standard functionality, but the change of sales organization.
    An awful lot of information depends on the Sales Organization: Company code (!!), customers, materials, prices, profit center, etc.
    SAP does not even admit creating a sales order in a Sales Organization A with reference to a sales order with a sales organization B.
    IMHO your best option is to try to maintain the current Sales Orders with the current Sales Organization and change the Sales Order in VA02 (your third option).
    If you are absolutely sure that all materials and customers are created for the new Sales Area in the same way and that prices (discounts) are the same, you might want to do a direct update to VBAK table to change the Sales Organization (nasty!), but be prepared for the consequences (no SAP support in case of problems, you are on your own).
    Therefore if you insist on a different Sales Organization, then option 2) will be your best best.
    Best Regards,
    Franck
    P.S. IMHO it is Best Practice to have a unique Sales Organization / Company Code.

  • Sales orders from one salesorg. to another in same ssystem

    Hi Guys,
               I got a requirement like we need to convert or recreate sales orders from one sales organization to another sales organization in the same system without having any impact on the existing system.
    Any one have idea how to do it and is there any standard program to do this? is there any standard procedure for that>?
    Thanks in advance.
    Ram sri

    Hi Ramgopal,
    I never had this scenario, but the main step would be
    Define 2 logical systems: a sender and a receiver
    Assign one of them to the client
    Set up distribution model
    Generate partner profiles
    Set up converter (not filter!) /Application Link Enabling (ALE)-> Modelling and Implementing Business Processes-> Converting Data Between Sender and Receiver
    Here you can set up conversion rule for your sales org field.
    All of this step could be done in transaction SALE.
    Regards,
    Peter

  • Problem in Creating Sales Order From One DB to another DB

    Hello All,
    I am trying to create a Sales Order in another database from the current database based on the Purchase Order but while creating the sales order system is throwing an error " In "To Whse" enter valid values [ZAPp 0] "
    My Code for Creating Sales Order in another DB are as follows :-
                 '==== Connect To another SAP Company ====='
                '=====================================
                Dim oCompany_DB As New SAPbobsCOM.Company
                oCompany_DB.Server = "OSL_SERVER"
                oCompany_DB.LicenseServer = "OSL_SERVER"
                oCompany_DB.UseTrusted = False
                oCompany_DB.CompanyDB = Database_Name
                oCompany_DB.UserName = SAPUserName
                oCompany_DB.Password = SAPPassword
                oCompany_DB.DbUserName = DBUserName
                oCompany_DB.DbPassword = DBPassword
                oCompany_DB.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2005
                lRetCode = oCompany_DB.Connect()
                If lRetCode <> 0 Then
                    oCompany_DB.GetLastError(lErrCode, sErrMsg)
                    If (lErrCode <> -4006) Then
                        Class_InterCmp_Main.SBO_Application.MessageBox(sErrMsg)
                    End If
                End If
    '===== Creating the Sales Order ====='
    '================================
      Dim oOrder As SAPbobsCOM.Documents = oCompany_DB.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
                Dim DocDueDate As String = oRecord.Fields.Item("DocDueDate").Value
                oOrder.DocDueDate = DocDueDate
                oOrder.CardCode = Customer
      While Not oRecord.EoF
                    Dim ItemCode As String = oRecord.Fields.Item("ItemCode").Value
                    Dim WhsCode As String = oRecord.Fields.Item("WhsCode").Value
                    Dim Quantity As Double = oRecord.Fields.Item("Quantity").Value
                    Dim Price As Double = oRecord.Fields.Item("Price").Value
                    Dim Discnt As Double = oRecord.Fields.Item("DiscPrcnt").Value
                    Dim TaxCode As String = oRecord.Fields.Item("TaxCode").Value
                    oOrder.Lines.ItemCode = ItemCode
                    oOrder.Lines.WarehouseCode = WhsCode
                    oOrder.Lines.Quantity = Quantity
                    oOrder.Lines.Price = Price
                    oOrder.Lines.DiscountPercent = Discnt
                    oOrder.Lines.TaxCode = TaxCode
                    oOrder.Lines.Add()
                    oRecord.MoveNext()
                End While
                lRetCode = oOrder.Add
                '=== Check For Error if any ===='
                If lRetCode <> 0 Then
                    oCompany_DB.GetLastError(lErrCode, sErrMsg)
                    If (lErrCode <> -4006) Then
                        Class_InterCmp_Main.SBO_Application.MessageBox(sErrMsg)
                    End If
                End If
                oCompany_DB.Disconnect()
    When i execute the above code company gets connected but sales order not getting added in another company.
    Thanks,
    Amit

    You can not do it the alternate way Kevin suggests, direct DB inserts are prohibited by SAP and can corrupt your DB, particularly because unlike what most people think, all SAP documents affect more than just their own tables (e.g. the numbering table, the history tables).
    Are you getting any error message, or is it returning 0?
    If it is returning 0, then check is the document actually going to the newly created database or maybe somehow going to old one.
    If it isn't returning 0, what is the error code and message.
    Edit:
    Also I do see an error in your code. As it stands, you are adding an empty line to the end of every order. This can cause problems for SAP.
    Dim counter As Integer = 0
    If counter <> 0 Then 'Not equals 0, forum hides lt & gt symbols.
    oOrder.Lines.Add()
    End If
    counter = counter + 1
    oOrder.Lines.ItemCode = ItemCode
    oOrder.Lines.WarehouseCode = WhsCode
    oOrder.Lines.Quantity = Quantity
    oOrder.Lines.Price = Price
    oOrder.Lines.DiscountPercent = Discnt
    oOrder.Lines.TaxCode = TaxCode
    Edited by: njmog1 on May 9, 2011 10:14 AM

  • Sales Order from one SAP to another SAP system thru ALE

    I am trying to send a Sales order IDOC from one SAP system to another SAP system (basically from DEV to QAS). Will i be able to do this using ALE ? If so, how ? I don't want this Sales order to be posted as PO in QAS. I want it to stay as a sales order.

    hi,
    use BAPI SALESORDERCREATE
    ~linganna

  • How to add drive space from one drive to another drive in Solaris 10

    This is something I have never done in Solaris. I have a mounted drive (UFS) with a dir being used for a samba share. The dir is near full. I have another drive right beside it that is empty.
    1. How can I add the drive space from the empty drive to the dir or drive that is nearly full? I have to access all files on both drives from the samba share.
    2. Can I do this without loosing files?
    3. Can I do this without messing up the samba share?
    4. Can this be done on the fly without re-boot?
    Thanks in advance.

    I would start by getting acquainted with ZFS.
    Make sure you have a recent Solaris 10 version with a stable zfs impl. like u4 and later.
    Make sure you have installed reasonably recent Solaris 10 recommended patches - they make a big difference to ZFS.
    Simple solution :
    * put your new drive in a zpool
    # zpool create smbpool <new_drive_device, fx. c0t1d0>
    * make a zfs
    # zfs create smbpool/smbfs
    * stop your samba server
    # svcadm stop smb ?
    * copy your files to your zfs fssmb_ufs=old samba fs
    # cp -rp <old_samba_fs> /pools/smbpool/smbfs
    * un-mount and say goodbye to your old samba fs - /wave
    # umount <old_samba_fs>
    * expand your zpool with the old samba server fs partition
    # zpool add smbpool <device name for old samba slice, fx. c0t0d0s6>
    * move your zfs fs to be mounted on the same mount points as the old samba server fs
    # zfs set mountpoint=<old_samba_mountpoint> smbpool/smbfs
    * restart your samba server
    # svcadm start smb ?
    It requires downtime for the samba server to copy the files, which could be cut shorter by using rsync, rsyncing while samba server online, stop samba server, rsync again for the changes while the first rsync ran.

  • Transfer sales orders from one compnay code to another

    Hi
    Is it possible to transfer pending sales order from one company code to another? if yes please let me know complete procedure.
    thanks
    Sanjay

    Hi,
    You cannot transfer the sales order like this.If your company is getting closed then you can keep a deadline date before which you can close all the open orders and after that you can start creating the orders in the new company code.
    If your delivery date is beyond the deadline date then you can reject the sales orders and create them with new G/L accounts from the new company code.
    For this,you have to assign your sales organisation to the new company code.
    Reward points if it helps.
    Regards
    Karan

  • How can I Move data from one column to another in my access table?

    I have two columns, one that stores current month’s data and one that stores last month’s data. Every month data from column 2 (this month’s data) needs to be moved to column 1 that holds last month’s data. I then null out column 2 so I can accumulates this month’s data.
    I understand how to drop a column or add a column, how do I transfer data from one column to another.
    Here is my trial code:
    <cfquery name="qQueryChangeColumnName" datasource="#dsn#">
      ALTER TABLE leaderboard
      UPDATE leaderboard SET  points2 = points3
    </cfquery>
    Unfortunately, I get the following error:
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE statement.
    How can I transfer my data with the alter table method?

    I looked up the Access SQL reference (which is probably a
    good place to start when having issues with Access SQL), and
    it suggests you probably need a WHERE clause in there.
    I agree the documentation is a good place to start. But you should not need a WHERE clause here.
    Too few parameters. Expected 1.
    If you run the SQL directly in Access, what are the results? At the very least, it should provide a more informative error message..

  • How can we transfer stock from one vendor to another vendor?

    Dear Gurus,
    How can we transfer stock from one vendor to another vendor?
    pls tell the steps to follow..
    Thanks..

    This is the Normal Third Party Sub Contracting
    Follow these steps
    If components to be provided to a vendor are supplied not by your company but by a third-party, you can order the components from the third-party and specify the subcontractor in the purchase order as the delivery address. At goods receipt the components are posted directly to the stock of the material provided to vendor.
    Entering a Purchase Order for Components
    To order components for a subcontract order from a vendor and have them delivered direct to the subcontractor, enter a standard purchase order with a different delivery address:
    From the Purchasing menu, choose Purchase order ® Create ® Vendor known.
    Maintain the data on the initial screen. Make sure you enter the vendor of the components and the plant concerned.
    Enter the items.
    Then choose Item ® More functions ® Delivery address.
    A dialog box appears in which you enter the delivery address.
    In the field Vendor enter the number of the subcontractor and select the SC vendor box.
    Selecting the box causes the components at goods receipt to be posted directly to the stock of the material provided to vendor when the goods receipt is posted.
    Save the purchase order.
    Posting the Goods Receipt of the Components
    If the subcontractor lets you know that the components have arrived, you can enter the goods receipt for the purchase order. The components are posted directly to the stock of the material provided to vendor.
    Stock Update
    A goods receipt posting has the following results in the system:
    the stock of material provided to vendor at plant level is increased. The stock of material provided to vendor is not managed at storage location level, since the stock is no longer stored at your company.
    Valuated stock at plant level increases.
    Documents
    An accounting document is created for the material document.
    After this normal subcontracting order for finished product.

  • How do i download music from one ipod to another ipod

    how do i download music from one ipod to another ipod ?

    It needs to go through your computer's iTunes library.  If all the songs on the iPods are already in your computer's iTunes library, just sync each iPod as desired from your iTunes library. 
    If the songs on your iPods are not in your iTunes library, the approach here is to first off-load the song files from the iPods to your computer's hard drive.  Then, add the song files to your iTunes library, so that it is "consolidated" with ALL of your music.
    You cannot transfer song files from iPod to computer using iTunes, except for songs purchased from the iTunes Store.  However, there are third-party methods and utilities that can transfer from iPod to computer.  If you do an Internet search on something like "ipod transfer," you should get some links.
    Once you have ALL of your music in one iTunes library on your computer, sync your iPods as desired.

  • HT1329 How do I transfer playlists from one ipod to another?

    How do I transfer playlists from one ipod to another?

    It needs to go through iTunes.  But there is no way to transfer songs from iPod to iTunes library (except for music you purchased from iTunes Store).  However, there are third-party methods and utilities that can transfer from iPod to computer.  If you do a Google search on "ipod transfer," you should get some links.
    Once the song files are on your computer, add them to your iTunes library.  You can then sync your iPhone to the iTunes library.
    Alternately, if you sign up for the iTunes Match service, your iTunes music library on your computer will become available from iCloud.  You can set your new iPhone (assuming you bought a "new" iPhone) to sync from iCloud, instead of from your computer's iTunes.  All of your music will be available wirelessly, wherever you have an Internet connection. 

  • How do you move pictures from one album to another

    how do you move pictures from one album to another?

    Pictures can appear in any number of albums.
    To move from one album to another, add the picture to the new album and then right click on the picture, select Remove from album and then select the album you want to remove it from.
    If you need further help, please let us know which version of Photoshop Elements you are using and which operating system you are running on.
    Brian

  • How to copy OVD configuration from one machine to another?

    We have two machines with OVD servers on them. The configurations should be identical from one machine to the other. We suspect there is a problem with the configuration on one of them. We need to know how to copy OVD configuration from one machine to another.
    Can you tell us how to do that?

    well i have this in mind which may help you.
    You would need to have a public ip address to the machine you have consoled to and on internet.
    Download the tftp software from below link.
    http://tftpd32.jounin.net/
    This software does not only act as the tftp server but also you can select the interface of you ethernet card as tftp server ip address.
    For ex if you are connected to a console and have a wireless card which is connected to internet also you connect you eth lan card to the eth or fast eth of the router.
    you can select which ever interface you want to act as the tftp server.
    you will need to add ip addres for you lan card and also config the router port as same if needed.

  • How to transfer iweb files from one mac to another?

    How to transfer iweb files from one mac to another?
    I have a macbookpro, and I am planing to transfer my iweb data to a new imac, is this possiable and will everything transfer over properly? Will I have problems doing this and how can i do this?

    thank you very much!
    another question,
    if i were to use mobil me to publish my site (at this time i use ftp) will i have the ability to have an outside programer log into my mobil me account and adjust things around in my html codes or add things to my site without iweb? at this time i use ftp and transfer my files from cyberduck to my hosting company. I am new and not very firmilure with the files in my hosting company, so i have help sometimes from a programer that fixes my html codes sometimes for example this page of my site i had someone help me with...
    http://www.sylvartfloraldesigns.com/SylvartFloral_Designs/ScheduleConsultation.html
    will i have the option to do this through mobil me and have someone help me from an outside source, log into my mobil me account and have them adjust things for me?

  • How to transfer the logins from one instance to another instance in sql2008r2

    how to transfer the logins from one instance to another instance in sql2008r2

    Hi Ganesh,
    According to your description, you want to know how to transfer the logins from one instance to another instance for SQL Server 2008 R2. To do this, besides dave’s post, you could also use
    'Copy Database Wizard' in SQL Server Management Studio, or the component
    'transfer Login task' in SQL Server Integration Services.
    Regards,
    Michelle Li

Maybe you are looking for