cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_PO_CHANGE using .NET Connector

0 Kudos

I am trying to call the BAPI_PO_CHANGE using the .NET Connector 1.x.

I have been able to connect and bind the BAPI_PO_DETAILS to a datagrid,etc.

Now I want to be able to mark the delv_completed indicator for a PO Item.

The code below executes and the return msg from the BAPI call tells me that "Standard PO 4500117558 changed".

However, the Delivery Complete indicator is not checked.

	Dim proxy As New SAPProxyT3.SAPProxyT3


            'establish conntection to SAP using the SAPLogon Class
            Dim logon As New SAP.Connector.Destination
            logon.Username = "*****"
            logon.Password = "****"
            logon.SystemNumber = "**"
            logon.Client = "***"
            logon.AppServerHost = "******"
            logon.LogonGroup = "*******"

            proxy.Connection = New SAP.Connector.SAPConnection(logon)
            

            'The PO Items ...
            Dim poItem As New SAPProxyT3.BAPIMEPOITEM
            poItem.Deliv_Compl = "X"
            poItem.Po_Item = "10"
            Dim poItemTable As New SAPProxyT3.BAPIMEPOITEMTable
            poItemTable.Add(poItem)

            'The PO Items change...
            Dim poItemChange As New SAPProxyT3.BAPIMEPOITEMX
            poItemChange.Deliv_Compl = "X"
            poItemChange.Po_Item = "10"
            Dim poItemChangeTable As New SAPProxyT3.BAPIMEPOITEMXTable
            poItemChangeTable.Add(poItemChange)

            'The Return Table
            Dim retTable As New BAPIRET2Table

            proxy.Bapi_Po_Change(Nothing, Nothing, Nothing, Nothing, Nothing, _
            Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, "4500117558", Nothing, Nothing, Nothing, _
            Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, _
            Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, _
            Nothing, poItemTable, poItemChangeTable, Nothing, Nothing, Nothing, Nothing, _
            Nothing, Nothing, Nothing, Nothing, Nothing, retTable)

            'This trace returns with "Standard PO 4500117558 changed"
            Trace.Write(retTable(0).Message.ToString)
            Trace.Write(retTable(0).Message_V1.ToString)
            Trace.Write(retTable(0).Message_V2.ToString)
            Trace.Write(retTable(0).Message_V3.ToString)
            Trace.Write(retTable(0).Message_V4.ToString)

            Dim commitReturn As BAPIRET2
            proxy.Bapi_Transaction_Commit("", commitReturn)
            Trace.Write(commitReturn.Message)

            proxy.Connection.Close()

Message was edited by: Kelly Joe

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

I found the problem with this. I was setting the wrong field. It should have been.

           
  poItemChange.No_More_Gr = "X"

Instead of


  poItem.Deliv_Compl = "X"

Answers (1)

Answers (1)

former_member187400
Active Contributor
0 Kudos

Hi Kelly,

I find out that right now u r using .Net connector 1.0,,

why don't you upgrade it into 2.0 version.

It's easier.

And you don't have to get mixed up like that.

Hopefully it can help you

Best regards,

Niel