Hallo Wolfgang,
vielen Dank für deine schnelle Antwort.
Ich habe das testweise versucht in VBA in Excel volgendermaßen nachzubauen:
Function Read(Optional EWultb As Object, Optional EEquicat As Object, Optional EKndcat As Object, Optional EMatcat As Object, Optional EStdcat As Object, Optional ETplcat As Object) As Long
Dim objRfc As Object
Dim objDatub As Object
Dim objDatuv As Object
Dim objMaterial As Object
Dim objPTyp As Object
Dim objRetcode As Object
Dim objStlan As Object
Dim objPlant As Object
Dim objMclmt As Object
Dim objMnstl As Object
Dim objMxstl As Object
Dim objStltp As Object
Read = vbCancel
Set objRfc = Conn.Add("CS_WHERE_USED_MAT")
Set objDatub = objRfc.exports("DATUB")
Set objDatuv = objRfc.exports("DATUV")
Set objMaterial = objRfc.exports("MATNR")
Set objPTyp = objRfc.exports("POSTP")
Set objRetcode = objRfc.exports("RETCODE_ONLY")
Set objStlan = objRfc.exports("STLAN")
Set objPlant = objRfc.exports("WERKS")
Set objMclmt = objRfc.exports("MCLMT")
Set objMnstl = objRfc.exports("MNSTL")
Set objMxstl = objRfc.exports("MXSTL")
Set objStltp = objRfc.exports("STLTP")
objDatub = "99991231"
objDatuv = "20111011"
objMaterial.Value = "01.063319"
objPTyp.Value = "L"
objRetcode.Value = " "
objStlan.Value = " "
objPlant.Value = "0001"
objMclmt.Value = " "
objMnstl.Value = " "
objMxstl.Value = " "
objStltp.Value = " "
Set EWultb = objRfc.TABLES("WULTB")
Set EEquicat = objRfc.TABLES("EQUICAT")
Set EKndcat = objRfc.TABLES("KNDCAT")
Set EMatcat = objRfc.TABLES("MATCAT")
Set EStdcat = objRfc.TABLES("STDCAT")
Set ETplcat = objRfc.TABLES("TPLCAT")
EWultb.FreeTable
EEquicat.FreeTable
EKndcat.FreeTable
EMatcat.FreeTable
EStdcat.FreeTable
ETplcat.FreeTable
If objRfc.CALL = False Then Exit Function
Read = vbOK
End Function
Beim objRfc.Call bekomme ich immer False zurück, d. h. keine Daten. Hast du eine Idee was ich falsch mache?
Gruß Robben