1

I'm currently trying to figure out the basics of remote function calls via vb .NET. I feel pretty helpless however, because their just isn't any useful documentation for the most simple of tasks.

What I'm trying to do atm is starting the transaction CO13, write the confirmation number in the appropriate field and cancel the order. Even this simple tasks turned out to be a pain in the ass. I'm still not sure how to access and modify the contents of a specific field. There are some examples with tables for excel in the net, but hat's about it. What I have so far is this (login is working and in another function):

Public Function stornieren() As Boolean

    Dim ordernr As String
    Dim confirmationnr
    Dim confirmation As Object
    Dim R3 As Object
    Dim CO13 As Object
    Dim result

    R3 = CreateObject("SAP.Functions")

    ordernr = TextBox3.Text
    confirmationnr = TextBox4.Text

    CO13 = R3.Add("RFC_CALL_TRANSACTION_USING")
    CO13.exports("TCODE") = "CO13"
    CO13.exports("MODE") = "S"
    confirmation = CO13.exports("RUECK")
    confirmation.value = confirmationnr

    result = CO13.call

End Function

RUECK is the Field Name. I want to write the value of "confirmationnr" into the field RUECK. "confirmation.value = confirmationnr" throws the error message "the object variable could not be determined" and "NullReferenceException" was not handled. Sounds to me like the object is empty.

Thanks in advance.

EDIT: Now trying via BAPIs and particularly BAPI_PRODORDCONF_CANCEL. I have no idea about the syntax though. Any help would be appreciated.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
user2696330
  • 143
  • 11

0 Answers0