Version conflict? Error -5002 when adding a sales order in SDK 2004.

I get the -5002 error without any description when I reference the "SAP Business One Objects Bridge API version 6.2 SP3" and try to add an invoice in SBO 2004. The code is basically:
Set vDOC = vCmp.GetBusinessObject(oInvoices)
vDOC.CardCode = "K99999"
vDOC.CardName = "Nils"
vDOC.Lines.ItemCode = "A00001"
VDOC.Add
The routine works well if I reference the SBO 2004 DI API or if I run it on a 6.5 system.
How can I be sure that my routine can work in both versions?
/Nils.
Message was edited by: Nils Jakob Heyerdahl

I run Windows XP Proffessional with SP2.
1) I had 6.5 SP1 installed. My POS-app works well. I have a procedure that adds an invoice from the POS-app. The VB-project (VB6 SP5) references "SAP Business One Objects Bridge API version 6.2 SP3" (because I want to support all versions of SBO).
2) I uninstall SBO 6.5 and install SBO 2004 (III).
3) I start the POS-app and receives an error when I try to add a document. The message is "-5002,". No text after the errorcode.
4) I then deletes the reference to "SAP Business One Objects Bridge API version 6.2 SP3" and reference the "SAP Business One DI API Version 2004".
5) I then start the POS-app again and no error occurs.
The code I debuged with is as simple as this:
    Set vDOC = vCmp.GetBusinessObject(oInvoices)
    Set vOCRD = vCmp.GetBusinessObject(oBusinessPartners)
    vDOC.CardCode = "K99999"
    vDOC.CardName = "Nils"
    vDOC.Add
    vDOC.Lines.ItemCode = "A00001"
    vDOC.Lines.ProjectCode = "    "
    vDOC.Lines.ItemDescription = "Varetekst"
    vDOC.Lines.Quantity = 1
    vDOC.Lines.PriceAfterVAT = 100
    vDOC.Lines.DiscountPercent = 0
    If (0 <> vDOC.Add()) Then
       Call vDOC.SaveXML("SAP_ERR_" & Trim(Str(DocType)) & "_" & Trim(Str(Bong)) + ".xml")
       isCancelled = True
    End if
    Exit Function
Strange?
/Nils.

Similar Messages

  • SDK Error -5002 when adding a sales order

    I'm getting an error -5002 when adding a sales order.
    Source code:
          IDocuments m_so2 = SBOCOMUtil.newDocuments(icmp, SBOCOMConstants.BoObjectTypes_Document_oOrders);
          line = m_so2.getLines();
          m_so2.setCardCode("2173231916");
          m_so2.setCardName("test Sales order");
          SimpleDateFormat formatter = new SimpleDateFormat("dd.MM.yyyy");
          Date today = Calendar.getInstance().getTime();
          m_so2.setDocDueDate(today);
          line.setItemCode("01005");
          line.setDiscountPercent(new Double(10));
          line.setItemDescription("description Testing");
          line.setQuantity(new Double(3));
          line.setTaxCode("0");
          line.add();
          long rc = m_so2.add();
    Question:
    Where can I find a list of error codes that can be easy to understand? PDF, word, etc.
    Thanks.

    Hi Diego,
    Looking at your code I see that you are doing a
    line.add();
    You don’t need to have this here unless you are adding another line to your document.
    Maybe this will help you.
    Also just because java is a bit different from VB get the last error message using
    SBOErrorMessage errMsg= comp.getLastError();
    System.out.println(errMsg.getErrorMessage());
    -Cormac

  • Error -1116 when creating a Sales Order via DI API

    Hi All,
    We have an developed EDI AddOn that creates Sales Orders in SBO 2007 PL13, in one of our clients.
    This AddOn is responsible for the creation up to 100 orders each day on SBO.
    However, sometimes (3 to 4%) during the Sales Order creation, the system return an error -1116 when the Sales Order is created - via oSalesOrder.Add() method.
    The problem is that the order is created anyway, although this error is raised.
    I've searched in the forums and it seems the solution is somehow related with SBO transactions.
    However, the AddOn only created the Sales Order, nothing more.
    Does any body know a solution for this problem?
    Regards,
    Manuel Dias

    Hi,
    see this links,
    Error -1116 when creating delivery note
    Could not commit transaction, ReturnCode:-1116
    Regards,
    siva

  • Error -5002 when adding a UDF, with B1 9.1

    Hello,
    in the past I wrote some addons for SAP B1 9.0 and worked well.
    Now I just upgraded our SAP B1 32-bit client from 9.0 to 9.1.
    If I try to run any of my addons and I get error code -5002, with description "Nessun record dati" ("No data records" in English).
    It occures in this piece of code that creates UDFs, when doing Add() the result is -5002 instead of 0:
    UserFieldsMD md = (UserFieldsMD)Global.oCompany.GetBusinessObject(BoObjectTypes.oUserFields);
    string realFieldName = "U_NS_MYFIELD";
    // Setting the Field's properties
    md.TableName = "RDR1";
    md.Name = "NS_MYFIELD";
    md.Description = "My field";
    md.Type = BoFieldTypes.db_Alpha;
    md.SubType = BoFldSubTypes.st_None;
    md.EditSize = 254;
    md.Mandatory = BoYesNoEnum.tNO;
    // Adding the Field to the Table
    int result = md.Add();
    Global.ReleaseComObject(md);
    This occures both keeping the old 9.0 version of SAPbobsCOM.dll and changing it to the new 9.1 version...
    Maybe the mechanism for creating UDFs has been changed? The reference (REFDI.chm) doesn't tell it.
    Kind regards

    This function is how I create UDF. I'm using it since SAP 8.8
    Function CreateUDF(ByVal TableName As String, ByVal FieldName As String, ByVal FieldDescription As String, Optional ByVal UDFLength As Integer = 10, Optional ByVal FieldType As SAPbobsCOM.BoFieldTypes = SAPbobsCOM.BoFieldTypes.db_Alpha, Optional ByVal DefaultValue As Object = "", Optional ByVal ShowMessage As Boolean = False, Optional ByVal dtValidValues As Data.DataTable = Nothing, Optional ByVal LinkedTable As String = "", Optional ByVal FieldSubType As SAPbobsCOM.BoFldSubTypes = Nothing, Optional ByVal isMandatory As SAPbobsCOM.BoYesNoEnum = SAPbobsCOM.BoYesNoEnum.tNO, Optional ByVal isUpdateExisting As Boolean = False) As Boolean
            Try
                Dim FieldID As Integer = GetUDFId(TableName, FieldName)
                oRecset = oDICompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                If Not IsNothing(oRecset) Then
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(oRecset)
                    oRecset = Nothing
                    GC.Collect()
                End If
                Dim oUserFields As SAPbobsCOM.UserFieldsMD
                oUserFields = oDICompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)
                Dim isExists As Boolean = False
                'LSC 10/20/2013
                If Not FieldID = -1 Then 'oUserFields.GetByKey(TableName, FieldID) Then
                    '  oUserFields.Remove()
                    ' If Not isUpdateExisting Then Return True
                    Return True
                    'oUserFields.Remove()
                End If
                With oUserFields
                    If Not isExists Then
                        .TableName = TableName
                        .Name = FieldName
                        .Description = FieldDescription
                        .Type = FieldType
                    End If
                    .EditSize = UDFLength
                    .Mandatory = isMandatory
                    Select Case oUserFields.Type
                        Case 4
                            .SubType = FieldSubType
                    End Select
                    If FieldType = SAPbobsCOM.BoFieldTypes.db_Alpha Or FieldType = SAPbobsCOM.BoFieldTypes.db_Float Or FieldType = SAPbobsCOM.BoFieldTypes.db_Numeric Or FieldType = SAPbobsCOM.BoFieldTypes.db_Date Then
                        If Not DefaultValue = "" Then .DefaultValue = DefaultValue
                    End If
                    If Not LinkedTable = "" Then .LinkedTable = LinkedTable
                    If Not IsNothing(dtValidValues) Then
                        For Loops As Integer = 0 To dtValidValues.Rows.Count - 1
                            .ValidValues.Value = dtValidValues.Rows(Loops).Item("Value")
                            .ValidValues.Description = dtValidValues.Rows(Loops).Item("Description")
                            If Loops <= dtValidValues.Rows.Count - 1 Then .ValidValues.Add()
                        Next
                    End If
                    If isExists Then
                        If Not .Update = 0 Then
                            If ShowMessage Then SetMessage(oDICompany.GetLastErrorDescription)
                            Return False
                        End If
                    Else
                        If Not .Add = 0 Then
                            If ShowMessage Then SetMessage(oDICompany.GetLastErrorDescription)
                            Return False
                        End If
                    End If
                End With
                System.Runtime.InteropServices.Marshal.ReleaseComObject(oUserFields)
                oUserFields = Nothing
                GC.Collect()
                Return True
            Catch ex As Exception
                SetMessage(ex)
                Return False
            End Try
        End Function

  • Error -5002 when adding linked user defined field using DI API

    Hello,
    When I try to add a linked user defined field using DI API I get the error number -5002 with description:
    "The field 'Related Table' should consist of 8 alphanumeric characters with no valid or default values"
    I Get the error when I use the Add method.
    What is the solution for this problem? I use SBO 2005 A SP1 Patch 18
    The code I use is (.NET C# 2.0):
    SAPbobsCOM.IUserFieldsMD uf = (SAPbobsCOM.IUserFieldsMD)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields);
    uf.Name = "S_BUCO";
    uf.TableName = "OPOR";
    uf.Type = SAPbobsCOM.BoFieldTypes.db_Memo;
    uf.SubType = SAPbobsCOM.BoFldSubTypes.st_Link;
    uf.LinkedTable = "S_BU";
    uf.Description = "Description";
    uf.Add()
    Regards,
    Jeffrey

    Hi Jeffrey,
    Your code above does not match the settings you are using in the UI. In particular, the type and subtype you are setting in code are not correct.
    To create the UDF via code, set the field types as follows:
    SAPbobsCOM.IUserFieldsMD uf = (SAPbobsCOM.IUserFieldsMD)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields);
    uf.Name = "S_BUCO";
    uf.TableName = "OPOR";
    uf.Type = SAPbobsCOM.BoFieldTypes.db_Alpha;
    uf.EditSize = 8;
    uf.LinkedTable = "S_BU";
    uf.Description = "Description";
    uf.Add()
    There's no need to set the SubType property as you require a regular alphanumeric field.
    Kind Regards,
    Owen

  • Error Message when adding a Purchase Order

    Hi,
    When i enter a new Purchase Order and click on Add, it gives the message as "No Matching records found ‘G/L Accounts’ (OACT) (ODBC – 2028) [Message – 131-183]”

    Hi Manzoor,
    This is because in the purchase order there is one or more items that have no set G/L account. I suggest you allow to visualize the "G/L account" Column in the Form Settings/TableFormat in the purchase order, and then go to the G/L account and set a VALID G/L account.
    It is not very logical to put that information in an order, but however you must do that way.
    Hope it helps.

  • Error on ATP check when Creating a Sales Order

    Hello,
    I encounter error  on ATP check while creating a Sales Order.
    The error is when I create Sales Order using material A, with or with out indicating the Plant and Storage Location, the Purchase Order quantity is returned on ATP check, but when I create an SO with out indicating the Plant and Storage Location, no PO quantity was returned. Note that we applied SAP Note # 387482 to automatically determine the Storage Location. I have also checked material maintenance in MM03 of Materials A and Material B and nothing was different, they have the same Availabity check condition.
    Is it possible that the SAP note that I applied causes the error?
    By the way I have noticed that when I create Material B and manually populate the Plant and Storage Location there is a pricing error(but it returns the PO during ATP check).
    Thanks.
    Noreen

    Hello,
    I encounter error  on ATP check while creating a Sales Order.
    The error is when I create Sales Order using material A, with or with out indicating the Plant and Storage Location, the Purchase Order quantity is returned on ATP check, but when I create an SO with out indicating the Plant and Storage Location, no PO quantity was returned. Note that we applied SAP Note # 387482 to automatically determine the Storage Location. I have also checked material maintenance in MM03 of Materials A and Material B and nothing was different, they have the same Availabity check condition.
    Is it possible that the SAP note that I applied causes the error?
    By the way I have noticed that when I create Material B and manually populate the Plant and Storage Location there is a pricing error(but it returns the PO during ATP check).
    Thanks.
    Noreen

  • Error in GTS when creating a sales order

    Hello All:
    Let me first say that I have researched the forums and web for my answer to no avail...there is not a lot of information out there for GTS issues. 
    When creating a sales order in ECC 600; I am receiving errors...I have looked at SLG1 in order to get more information on these errors.  I have validated my config in GQ0 and it appears to be correct.  Here is my errors I am receiving:
    Legal Control: Item Type Mapping not Maintained
    Item Category: ZTAE
    Item Category: ZTAQ
    Legal Control: Partn. Function Mapping not Maintained
    Partner Function: AG
    Partner Function: AP
    Partner Function: CI
    Partner Function: EN
    Partner Function: RE
    Partner Function: RG
    Partner Function: SP
    Partner Function: WE
    Legal Control: Mapping of Org. Units not Maintained For Fore
    Company Code: 1000
    Legal Control: Mapping of Org. Units not Maintained For Lega
    Plant: 1000
    I have looked under the Org Structure for these errors and think my configuration is correct.  I have checked under the following:
    In SPRO I have done the following Config under Org Structure:
    Define Foreign Trade Organizations
    Assign Company Code At Feeder System
    Define Legal Units
    Assign Legal Unit to Foreigne Trade
    Assigned Plant at Feeder System
    In Spro I have done the following Config under Partner Structure:
    Define Partner Functions
    Define Groups of Partner Functions
    Assign Partner Functions at Feeder system
    In SpRO under Compliance Management I have done the following Config under document structure:
    Define Doc Types
    Assign Doc types at feeder system
    Define item categories
    Assign item categories at feeder system
    It is obvious I am missing something....Please help...it would be greatly appreciated....

    Hi Dave
    Thanks for replying. 
    For Business Partners the error I am getting in SLG1 is the follwoing:
    Sub Object text
    Mapping of API to Customs Shipment - Arrival
    Program
    /SAPSLL/SAPLCORE_APPLOG_SERV
    @5C\QError@     
    The system was unable to determine an FT organiz. for company code 1000
    The system was unable to determine a legal unit for plant 1000
    No mapping information exists for partner function AG
    Another error for Business Partner:
    sub object text
    Business Partner Distribution
    Program
    /SAPSLL/SAPLCORE_APPLOG_SERV
    @5C\QError@     
    Please use another function to maintain the SPACE version of the address
    For Item Categories
    SubObect TextMapping of API to Customs Shipment - Arrival
    Program
    /SAPSLL/SAPLCORE_APPLOG_SERV
    @5C\QError@     
    No mapping information exists for item type ZTAQ
    The system was unable to determine a legal unit for plant 1000
    No mapping information exists for partner function AG
    Also we are using GTS 7.2 but upgrading to GTS 10 and I am trying to create our testing client for a to test after upgrade
    Edited by: Kim Blair on Sep 9, 2011 4:57 PM
    Edited by: Kim Blair on Sep 9, 2011 4:58 PM

  • I get error 5002 when trying to redeem gift cards , what do I need to do to fix this.

    I get error 5002 when trying to redeem gift cards, what can I do to fix this?

    http://store.apple.com/us
    I have been trying to fix this myself and just found a way tonight. This started happening after I downloaded a new version. I tried several other approaches and was unsuccessful until I was directed to the support website.  I searched for 5002 error.  I chose specific conditions and alert message.  Then chose "Error 5002" which gave a little detail. 
    Basically I had to go to the above site and change my password and some other account information.  It didn't work when I tried in my actual ITUNES application.  I think because my account was so old and they upgraded some security items like stronger passwords etc., so the old stuff was no longer good enough.  I have now redeemed two gift cards.  I hope it helps.

  • Why am i getting error 5002 when trying to redeem a UV movie purchase?

    Why am i getting error 5002 when trying to redeem a UV movie purchase?

    Sharonc21 wrote:
    If one is downloading directly to the iPhone via WiFi, it doesn't matter what version of iTunes is on the computer.
    I decided to sync my phone to Outlook via iTunes.  First thing, iTunes discovered that 7.0.3 was not on my phone.  It asked if i wanted to install it.  I said, "yes", and VOILA!! 7.0.3 is now installed on my iPhone.
    So therein is the answer.  Have no idea what bug is in there to keep it from loading to some phones directly via WiFi, but obviously, it is something!!
    There is no bug.  While you can update your iOS via wi-fi, it's recommended to do so via USB & iTunes.  Depending on your wi-fi connection & singal strength, you can get errors.  That's not a function specifically of the device.

  • I have a Macbook Pro that I have just renewed and transferred over my old hard drive (also from a Macbook Pro). Now when I turn on the computer and ITunes opens I get error (-50) and then error 5002 when I try to sign in to ITunes Store - Help!

    I have a Macbook Pro that I have just renewed and transferred over my old hard drive (also from a Macbook Pro). Now when I turn on the computer and ITunes opens I get error (-50) and then error 5002 when I try to sign in to ITunes Store - Help!
    My dealer has tried and failed (twice) to correct this and I have tried deleting the two items in the Itunes folder but no luck!

    were you able to get help on this?  I need help on error 5002 as well.  thank you

  • I get error 5002 when trying to buy 3.1 software for iPod touch 1st gen

    I get error 5002 when trying to buy 3.1 software for iPod touch 1st gen. 

    That is a paid update you get here:
    Purchasing iOS 3.1 Software Update for iPod touch (1st generation)

  • I keep getting "Error 5002" When I try to buy an album. What do I do?

    I keep getting "Error 5002" When I try to buy an album. What do I do? I already reinstalled iTunes... not sure what this error means or how to be able to buy this album.

    There's some info on your error message number in the Specific Conditions and Alert Messages: (Mac OS X / Windows) section of the following document:
    iTunes: Advanced iTunes Store troubleshooting

  • Configuration Validation error when booking an Sales Order.

    Hi,
    Getting an error when booking an sales order ie; "Configuration Validation error".
    We are upgrading from 11.5.8 to 12.1.1 and this issue is critical. Please provide your valuable suggestion and advice.
    Thanks in advance,
    Asif

    It seems you use configurator. Is this happening in production or in some test instance?
    If it is a test instance, when was it cloned from prod? Did you clone the configurator instance at the same time?
    1) You should publish the configurator model from the configurator developer to this new instance.
    2) Also, it is possible that the selections made during order entry earlier are not valid anymore due to ECO/BOM changes or due to configurator rule changes. Open the configuration, make any selections if necessary and then click ok.
    This will repopulate the order lines then you should be able to book the order.
    Hope this helps
    Sandeep Gandhi
    Independent Techno-functional Consultant

  • Error 5 when adding to PSA

    Hi All,
    I faced an error 'Error 5 when adding to PSA'  (going into short dump ABAP runtime erro : Message Type X Erro). I am trying to load the data from ODS to another ODS with full upadte through PSA . I am facing this error. Can anybody help me in this issue. Please this is very urgent, all the dependant loads are stopped in production.
    Thanks in Advance
    Narendra

    Thanks, This is solved by myself. I deleted all the failed requests in the PSA.

Maybe you are looking for

  • Problem in BOM explosion for a operation Sub Contract.

    Hi All, Please advise how to explode a BOM or Assign component in a Purchase order with Item category (L) for a Operation SubContract External Processing  oriented material for which no material code is created from a Series Operation production orde

  • HT1461 I have installed the Windows 8 on my MacBook using BootCamp, but I cannot install drivers for Windows now

    I have installed the Windows 8 on my MacBook using BootCamp already, but I cannot install drivers for Windows now: I've got only BootCamp 3 disk and it doesn't goo even if I start it using compatibility options. And my BootCamp on Mac didn't offer me

  • J2me run time error in developer 9052

    I follow the obe http://www.oracle.com/technology/obe/obe_as_10g/wireless/webservice/j2me.htm After developped the application, I failed in running it. when Click the Launch button on the phone simulator, I got below error message in MIDlet Run windo

  • Why does to_date gives yyyy as 0006

    Hi , this is from my nls_session paramete         PARAMETER     VALUE 10     NLS_TIME_FORMAT     HH.MI.SSXFF AM 11     NLS_TIMESTAMP_FORMAT     DD-MON-RR HH.MI.SSXFF AMIf i execute the followings : select TO_DATE(SYSDATE, 'DD-MM-YYYY') from dual resu

  • Best way to save an InDesign file for fast/highest res. web viewing

    Help... I've got a 118 page InDesign file created in InDesign CS 3.0.1 that I need to prepare for viewing in a web page flipper program.  I've saved as jpgs straight from InDesign and also as pdfs from Adobe Acrobat 7.0 Professional.  Either works, b