Problem when update distribution rules by "UpdateDistributionRule" method

Dear,
I want to use the "UpdateDistributionRule" method for updating (add new line) the existing distribution rules. I have tried the code from SDK help, but it does not work.
Here is the code from SDK help as below:
oCmpSrv = oCompany.GetCompanyService()
Dim oDLservice As SAPbobsCOM.DistributionRulesService = oCmpSrv.GetBusinessService(SAPbobsCOM.ServiceTypes.DistributionRulesService)
Dim oDL As SAPbobsCOM.DistributionRule
Dim oDLParams As SAPbobsCOM.IDistributionRuleParams
' Get distribution rule
oDLParams = oDLservice.GetDataInterface(SAPbobsCOM.DistributionRulesServiceDataInterfaces.drsDistributionRuleParams)
oDLParams.FactorCode = "1"
Try
    oDL = oDLservice.GetDistributionRule(oDLParams)
Catch ex As Exception
    MsgBox(ex.Message)
End Try
' Update distribution rule
oDL = oDLservice.GetDataInterface(SAPbobsCOM.DistributionRulesServiceDataInterfaces.drsDistributionRule)
oDL.FactorCode = "1"
oDL.FactorDescription = "Desc 1"
oDL.InWhichDimension = 1
oDL.TotalFactor = 40
oDL.DistributionRuleLines.Add()
oDL.DistributionRuleLines.Item(0).CenterCode = "1"
oDL.DistributionRuleLines.Item(0).TotalInCenter = "10"
oDL.DistributionRuleLines.Add()
oDL.DistributionRuleLines.Item(1).CenterCode = "2"
oDL.DistributionRuleLines.Item(1).TotalInCenter = "30"
Try
    oDLservice.UpdateDistributionRule(oDL)
Catch ex As Exception
    MsgBox(ex.Message)
End Try
Regards,
On

HI,
Tried, but not work.
It shows - Invalid row number
Also, I try another like the following, but not work.
It shows - Enter valid amount in "Total"
Dim oCmpSrv As SAPbobsCOM.CompanyService
        oCmpSrv = oCompany.GetCompanyService()
        Dim oDLservice As SAPbobsCOM.DistributionRulesService = oCmpSrv.GetBusinessService(SAPbobsCOM.ServiceTypes.DistributionRulesService)
        Dim oDL As SAPbobsCOM.DistributionRule
        Dim oDLParams As SAPbobsCOM.IDistributionRuleParams
        ' Get distribution rule
        oDLParams = oDLservice.GetDataInterface(SAPbobsCOM.DistributionRulesServiceDataInterfaces.drsDistributionRuleParams)
        oDLParams.FactorCode = "DR001"
        Try
            oDL = oDLservice.GetDistributionRule(oDLParams)
            ' Update distribution rule
            oDL.FactorCode = "DR001"
            oDL.FactorDescription = "Desc 1"
            oDL.InWhichDimension = 1
            oDL.TotalFactor = 60
            oDL.DistributionRuleLines.Item(0).CenterCode = "036" -> exist line
            oDL.DistributionRuleLines.Item(0).TotalInCenter = "20"
            oDL.DistributionRuleLines.Item(1).CenterCode = "049" -> exist line
            oDL.DistributionRuleLines.Item(1).TotalInCenter = "30"
            oDL.DistributionRuleLines.Add()
            oDL.DistributionRuleLines.Item(2).CenterCode = "090" -> new line
            oDL.DistributionRuleLines.Item(2).TotalInCenter = "10"
            Try
                oDLservice.UpdateDistributionRule(oDL)
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
Regards,
On

Similar Messages

  • Validation problem when update a row in OAF

    created a application using OAF. No problem to create a row, when tried to update the row, received the following error message:
    oracle.jbo.RowValException: JBO-27012: Row validation method validation() failed for row with key oracle.jbo.Key
    2) Steps to Reproduce
    select a row from search result page for update, after change the value and apply it, received the following error message:
    oracle.jbo.RowValException: JBO-27012: Row validation method validation() failed for row with key oracle.jbo.Key

    yes. it is the EO based VO page. Create and Update used same VO and no problem to create the row, had problem when update the row.

  • I have a problem when updated the new release of iphoto version(11 jun 2012). After that I cannot open any photo libraries and program is error.

    I have a problem when updated the new release of iphoto version(11 jun 2012). After that I cannot open any photo libraries and program is error. I must to force quit iphoto window. There are any fixed bug update.

    If you have no photos:
    Hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Create Library' and start.
    Regards
    TD

  • I have a problem when updating applications on iOS 7.0.2

    I have a problem when updating apps on iOS 7.0.2 to go to the appstore I get the update but only tells me open, not update, I have to uninstall and reinstall te app and gives me the option to update. Sorry my bad english

    I am in the process of installing 9i on SUSE Linux 7.2. The only Linux that is certified to run 9i. The machine is is a fresh install of SUSE. I am running into the same problem. I ran through the first make problem by going to a shell and invoking a make -f oemagent.mk. Built the library just fine. Got errors when trying to run make -f ins_rdbms.mk. Not sure why the installer or the command line is having problems.
    Not sure if I can just hit Ignore and go on????
    Any help would be appreciated. You would think 9i would spread like butter on their "Certified" platform.

  • I have a question my iphone4s has a problem when updated iOS8 there will be freeze problem i think iOS8 is not supported in 4s!!!!!!!!!

    i have a question my iphone4s has a problem when updated iOS8 there will be freeze problem i think iOS8 is not supported in 4s!!!!!!!!!.
    one more question when i phone5 update with iOS 8.1.2 this iOS supported iphone5???

    Hi Ios 8.1.2 Should work on iPhone 4s / 5 You may have a bug Backup to  cloud over WiFi Then Restore back to Factory  Settings This will make iPhone as new. Use same Apple ID & you will get your Apps & Data back Do Restore over your WiFi. Cheers Brian

  • Hlep.. Problem when updating aspx templates

    Hi there, I-m having a huge problem when updating pages from
    a .asp template, it replaces my 1 line of code
    with <%@ Page Language="VB" ContentType="text/html"
    ResponseEncoding="iso-8859-1" %> and errases the resto of the
    attributes i have on each page, making it unfunctionable.
    Does anyne know why the template when updating does that?
    thanks for your help

    Hi Suman,
    The changes are getting lost when i logout and login back to SAP.
    In Current session i am able to see the changes. But changes are lost as soon as i end up my session,
    but this is happening only in case of template box width. All other changes are retained between my various SAP sessions.
    So wanted to know if any other value is over-writing the template box width values.
    Regards
    Manpreet Singh

  • I have problem when update to belle the folder of ...

    I have problem when update to belle the folder of games disappear??  c7
    I need to solve ??? Plus

    Do you mean that pink folder w/ the controller icon on it?  I lost that too on my N8.  Actually, lost all of the folders that came with Anna like Applications & Music.  Wish I could get them back as now I can only make the generic yellow folder which isn't as aesthetically appeasing.
    However, reading articles on Belle there was a picture of a Belle N8 with the games folder shortcut on the homescreen - so maybe it still exists & I just cannot find it.
    Good luck & I'll let you know if I figure this out.

  • I have problem when updating the latest version of Pro-X, I tried for several times, so I uninstall and re-install it. It is unsuccessful to re-install the Pro-X and it direct me to ask help from CS,also showing this message: Exit Code: 6  Please see spec

    I have problem when updating the latest version of Pro-X, I tried for several times, so I uninstall and re-install it. It is unsuccessful to re-install the Pro-X and it direct me to ask help from CS,also showing this message: Exit Code: 6  Please see specific errors and warnings below for troubleshooting. For example,  ERROR: DW025, DW050 ... WARNING: DW024, DW025 ..., please advice me the step to re-install the Pro-X. Thanks

    Please follow Errors "Exit Code: 6," "Exit Code: 7" | CS5, CS5.5
    Do let us know if it worked.
    Regards
    Rajshree

  • Orange mail software problem when using distribution lists : some lists cannot be used for writing e-mails. The problem does not exist when using Internet Explo

    When writing an e-mail directly on the Orange e-mail service (not on Thunderbird) I am facing the following problem : some distribution lists cannot be used to complete the adressees. The same lists can be used without difficulty if I use Internet Explorer instead of Firefox. The Orange hotline told me that probably my Firefox version was not updated. Unfortunately I checked that, and apparently the automatic updating works. I have also updated the plug ins, without any result.

    Please could you specify which webpage you mean ?
    The process with Orange is the following :
    - 1. click on "Write an e-mail" on the mail webpage
    - 2. click on "To" to reach the Contacts which opens a new window
    - 3. click on "Distribution lists"
    - 4. click on the selected list then click on "add". The list appears ot the box corresponding to the addresses .
    UNTIL THEN EVERYTHING WORKS WELL
    - 5. click on the button "validate", which closes the window previously opened and normally
    - 6. reloads the initial page with the complete list on the line "To". Instead of that I get the last e-mail address I previously used .
    Question : at which step of this process should I try your suggestions ? I tried when the initial page was reloaded with the wrong address, but it did not work to get back the rignt distribution list;
    Note that the whole process functions with OTHER Distribution lists. The only difference is that the problematic one has a larger number of adresses (62) however inferior to the maximum indicated by Orange (100).
    I also remind that there is no problem when using Internet Explorer instead of Firefox.
    Thanks for your help !

  • Problem when creating CAF Entity Service finder Methods

    Guys,
    Can any one please suggest me appropriatly to the below problem.
    I am using NWDS 7.06. I have no problem when creating CAF project, Application Service and Entity Service even.
    But in the Entity Service:
    1. Add a string or longtext attribute.
    2. try to create a custom finder method in operations tab, during that operation i am  not finding the attribute which i have created in step1.
    That means i am not able to create the my own finder methods with parameters.
    I was able to do that in some version long ago but i have forgotten that NWDS version.
    summary of Problem Is: " Cannot create custom methods with custom parameters in Entity Service"
    Can you please suggest me the right version or a solution to this problem on urgent basis please.
    I promise you that i will give you full points to you who ever gives me the right solution.
    Please mail your suggestions to [email protected]

    Guys,
    I have solved the problem successfully. Thanks for your attention.

  • Problem when Updating the Challan (J1INCHLN)

    Dear Expert,
            I am facing problem when i am updating Challan throught 'J1INCHLN'. I  debuged the  'J1INCHLN' and got the problem that TDS line item in BSEG table and TDS line item in WITH_ITEM does not match. 
    Thank you in advance,
    Denish Patel.

    Hi,
    This error also comes if you donot mention Business Place and Section code during the transaction.  Please check whether
    you have defined business place and section code and assigned to your company code and also entered them during
    transaction.
    Regards,
    Sadashivan

  • [HELP] Problem when update 1 unicode form

    hi all,
    I got a problem when I update unicode form :(
    so, I have already tested my web application (Struts-ibatis-velocity-tiles) on my PC (tomcat 5.5.12, mysql 4.1 - utf8 default, JDK 5.0), everything was okie. I could update 1 unicode form (the form which contains unicode characters - firstname, lastname). I use 1 filter for output and input, below is my web.xml:
    <!-- Filter to set character encoding on each request -->
    <filter>
    <filter-name>Set Character Encoding</filter-name>
    <filter-class>filters.SetCharacterEncodingFilter</filter-class>
    <init-param>
    <param-name>encoding</param-name>
    <param-value>UTF-8</param-value>
    </init-param>
    </filter>
    <!-- Define filter mappings for the defined filters -->
    <filter-mapping>
    <filter-name>Set Character Encoding</filter-name>
    <servlet-name>action</servlet-name>
    </filter-mapping>
    <filter-mapping>
    <filter-name>Set Character Encoding</filter-name>
    <servlet-name>velocity</servlet-name>
    </filter-mapping>
    but ... when I deploy and run it on eatj.com, mysql4.1 - utf8, jdk 5.0, I couldn't update unicode form, my last name and first name fields couldn't be saved with unicode characters (utf-8) ...
    what happened :( ... Is this problem of hosting or my web application ??? :(
    help me :(
    thanks in advance,
    bowlkhin

    You need to install the bc package. Apparently the script uses bc to calculate some integer values.
    Brian

  • Problem when updating Management Engine (ME) firmware - photo attached

    Hello All:
    I have encountered a perplexing problem when attempting to update the firmware in the Intel Management Engine.  The firmware update is posted on the W520 driver page (it is package 83rf32ww).  The problem is the error message shown in the photo below.
    The update process starts when the MEUpdate.CMD file is selected within the DOS window, but after a few seconds, the error message at the bottom of the picture appears.
    Any suggestions would be appreciated.
    Thanks,
    Michael
    Solved!
    Go to Solution.

    Yes, except you're running it from C:\Windows\system32 rather than the expected C:\DRIVERS\WIN\ME.
    Basically, you have to navigate to the folder FIRST, then run the file.
    W520: i7-2720QM, Q2000M at 1080/688/1376, 21GB RAM, 500GB + 750GB HDD, FHD screen
    X61T: L7500, 3GB RAM, 500GB HDD, XGA screen, Ultrabase
    Y3P: 5Y70, 8GB RAM, 256GB SSD, QHD+ screen

  • Problema in Add Distribution Rule

    Hi!
    i have a function like tihs:
    Public Function AddDistributionRule(ByVal ProfitCenters(,) As String) As String
            Dim _return As String = "1"
            Dim oCmpSrv As SAPbobsCOM.CompanyService = oCompany.GetCompanyService()
            Dim oDLservice As SAPbobsCOM.DistributionRulesService = oCmpSrv.GetBusinessService(SAPbobsCOM.ServiceTypes.DistributionRulesService)
            Dim oDL As SAPbobsCOM.DistributionRule
            ' Add distribution rule
            oDL = oDLservice.GetDataInterface(SAPbobsCOM.DistributionRulesServiceDataInterfaces.drsDistributionRule)
            oDL.FactorCode = "prova1"
            oDL.FactorDescription = "Desc 1"
            oDL.InWhichDimension = 1
            oDL.TotalFactor = ProfitCenters(0, 1)
            oDL.DistributionRuleLines.Add()
            oDL.DistributionRuleLines.Item(0).CenterCode = ProfitCenters(0, 0)
            oDL.DistributionRuleLines.Item(0).TotalInCenter = ProfitCenters(0, 1)
            Try
                oDLservice.AddDistributionRule(oDL)
            Catch ex As Exception
                oLog.Errore(ex.Message, ex)
                _return = ""
            End Try
            Return _return
        End Function
    The AddDistributionRule method gets the following error: Invalid date input
    I can not understand the cause of this error ... can you help?
    Thanks!

    Hello
    You has to define the Effective date from at lines
    DL.DistributionRuleLines.Item(0). Effectivefrom = 'ENTER DATE HERE
    If you do not know the date, you can enter as early as you can (first date of first period - you can select from OFPR table)
    Regards
    János

  • Problems when updating to mountain lion?

    I am currently at OSX 10.6.8. What kind of problems can I expect when updating to Mountain Lion?

    If your Mac is capable of running Mountain Lion, has at least 4GB of RAM, and a decent amount of available free space, the update should go quite smoothly for the average user.

Maybe you are looking for

  • Need to return data from a query in different ways - Please help

    We are using 10g R2 I have a proc as follows that has a query with over 100 values in the select clause: proc one( input param1, input_param2,.... output_cursor ) as begin open cursor for select ...about 100 values with most of them being calculated

  • Security changes in ADEP

    Maybe someone can give me the proper hint. Seems like with ADEP the security on a turnkey installation is more enhaned than before. When you skipdurcing the configuration Manager the question like what is the hostname and leave the standard 'localhos

  • Save the text as written

    Somebody can helpme, please. I have a text area, where i put some text in multiples lines and when i save it on db, oracle commit all the text in a single line. How i could made to save as wrote? x example, i write the this: "Hello, everybody. Greeti

  • Acrobato Pro 6 fails upgrade to 6.0.1 - PreFlightLib.dll

    Hi everyone, I'm trying to upgrade an Acrobat Pro 6.0.0 to 6.0.1 (manual upgrade). The problem happens during the "Copy new files" operations. I receive the following error: "Error 1334. The file 'PreFlightLib.dll1' cannot be installed because the fi

  • Delete database that's stuck in restoring mode

    Hi, one of the databases got stuck in restoring mode. I want to delete that without stopping sql service. I tried detaching and then deleting the physical files but didn't work. It just came back. I also tried deleting the database and then deleting