Hallo Steff,
ein bisschen weiter sind wir schon.
Der BAPI-Aufruf funktioniert aber wohl noch nicht richtig.
Wir füllen zuerst die Übergabeparameter und rufen dann den BAPI auf:
- Code: [Select all] [Expand/Collapse] [Download] (Untitled.txt)
' Kontraktart
Call FillInterface(theFunc, Sammler, "SALES_HEADER_IN", i)
' Auftraggeber
Call FillInterface(theFunc, Auftraggeber, "SALES_PARTNERS", i)
'Positionen
Call FillInterface(theFunc, Pos, "SALES_ITEMS_IN", i)
' Aufruf der BAPI-Funktion und Auswerten aufgetretener Fehler
iStartPos = 11
Call BAPIFunction(theFunc, i, iStartPos)
- GeSHi ©
- Code: [Select all] [Expand/Collapse] [Download] (Untitled.txt)
Sub BAPIFunction(ByRef theFunc As Object, iRow As Integer, iStartPos As Integer)
Dim RetTable As Object
Dim sMessage As String
Dim sTypeMsg As String
returnFunc = False
'Aufruf des Bapi
returnFunc = theFunc.Call
...
- GeSHi ©
- Code: [Select all] [Expand/Collapse] [Download] (Untitled.txt)
Sub FillInterface(ByRef theFunc As Object, ByRef ObjectName As Object, sParamName As String, iRow As Integer)
Set ObjectName = theFunc.exports(sParamName)
ObjectName.Value("DOC_TYPE") = Cells(iRow, 1)
ObjectName.Value("SALES_ORG") = Cells(iRow, 2)
ObjectName.Value("DISTR_CHAN") = Cells(iRow, 3)
ObjectName.Value("DIVISION") = Cells(iRow, 4)
ObjectName.Value("DATE_TYPE") = Cells(iRow, 5)
Set ObjectName
= theFunc
.tables.Item
&#
40;sParamName
&#
41;
ObjectName.AppendRow
For Each ObjectName In ObjectName.Rows
ObjectName("PARTN_ROLE") = Cells(iRow, 6)
ObjectName("PARTN_NUMB") = Cells(iRow, 7)
Next
Set ObjectName
= theFunc
.tables.Item
&#
40;sParamName
&#
41;
ObjectName.AppendRow
For Each ObjectName In ObjectName.Rows
ObjectName("MATERIAL") = Cells(iRow, 8)
ObjectName("TARGET_QTY") = Cells(iRow, 9)
Next
Set ObjectName = theFunc.exports(sParamName)
MsgBox sParamName
End Sub
- GeSHi ©
nach
- Code: [Select all] [Expand/Collapse] [Download] (Untitled.txt)
returnFunc = theFunc.Call
- GeSHi ©
ist returnFunc immer = False.
Hilft dir das Coding, oder brauchst du mehr?
Danke im voraus.
Gruß
Mrs. Hilflos