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

I get an error when I try to call BAPI_HU_PACK from a application. I can call RM_RS_Upload without any trouble so I know I have my connection correct. When I call BAPI_HU_PACK, the application jumps out with "Object referece not set to an instance of an object."

I have ran the same function inside the GUI with SE37 and it ran correctly with exactly the same data as I am trying to pass from the application. I don't actually get an SAP error returned, but rather an application run time error. My SAP system log states "Communication Error, CPIC return code 020, SAP return code 223" My code is below:

Dim proxyme As SAPProxyPack.SAPProxy1

Dim bapItem As New SAPProxyPack.BAPIHUITEM

Dim bapret2 As New SAPProxyPack.BAPIRET2Table

Dim baphuprop As New SAPProxyPack.BAPIHUITMPROPOSAL

Dim baphuhead As New SAPProxyPack.BAPIHUHEADER

Dim bapserial As New SAPProxyPack.BAPIHUITMSERIALTable

Dim bapseritem As New SAPProxyPack.BAPIHUITMSERIAL

With baphuprop

.Hu_Item_Type = "1"

.Material = "01B209AB"

.Pack_Qty = 1

.Plant = "1862"

.Base_Unit_Qty_Iso = ""

.Base_Unit_Qty = "PC"

.Stge_Loc = "0001"

.No_Of_Serial_Numbers = 0

.Number_Pack_Mat = 0

'.Flag_Suplmt_Item = "0"

End With


proxyme = New SAPProxyPack.SAPProxy1

proxyme.Connection = New SAP.Connector.SAPConnection(SAPDestination)



Call proxyme.Bapi_Hu_Pack("12345", baphuprop, baphuhead, bapItem, bapret2, bapserial)

'Me.DataGrid1.DataSource = bapret2.ToADODataTable



Catch ex As Exception


End Try

Please help.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Feb 22, 2005 at 04:40 PM


    When you enter an example in SE37, some field conversion exits are active.

    In your example base_unit_qty will be translated from english PC to database format ST (german :-).

    Try to use ..._iso and PCE (or something like that), than you are language independent.

    Same is valid for material number, if you have values without character -> use CONVERSION_EXIT_ALPHA_INPUT for translation.



    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.