SAP Jobsuche bei DV-Treff


Suchen
iDope?
  • iDope?
  • SAP Forum - Neuling Thema Starter
vor 9 Jahre
Hallo,

ich habe eine SAP Tabelle welche ich teilweise nach Excel importieren möchte. Wenn ich beispielsweise alle Werte mit dem Anfangsbuchstaben "I" in meine Tabelle importieren möchte, wie muss dann die Where-Bedingung aussehen?

Hier ist mein Versuch, der nicht funktioniert:

Private Function LoadTableDataFCT() As Boolean

 'Trennzeichen für Werte
 Set RFC_READ_TABLE = SAPFunctions.Add("RFC_READ_TABLE")
Set strExport1 = RFC_READ_TABLE.Exports("QUERY_TABLE")
Set strExport2 = RFC_READ_TABLE.Exports("DELIMITER")
Set tblOptions = RFC_READ_TABLE.Tables("OPTIONS")
Set tblData = RFC_READ_TABLE.Tables("DATA")
Set tblFields = RFC_READ_TABLE.Tables("FIELDS")
                      
strExport1.Value = "TABELLE"
strExport2.Value = "|"
                
'Feldreihenfolge
tblFields.AppendRow
tblFields(1, "FIELDNAME") = "BNAME"
tblFields.AppendRow
tblFields(2, "FIELDNAME") = "EXTID"
                    
  'WHERE-Bedingung
  tblOptions.AppendRow
  tblOptions(1, "TEXT") = "BNAME = 'I&'"
         

  If RFC_READ_TABLE.Call = True Then

   If tblData.RowCount > 0 Then
     For i = 1 To tblData.RowCount
     Cells(i, 1) = tblData(i, 1)
     Next i
   End If
     Else
     LoadTableDataFCT = False
  End If

End Function
Alpmann
vor 9 Jahre
Hallo Idope,

anstelle

tblOptions(1, "TEXT") = "BNAME = 'I&'"

benutze

tblOptions(1, "TEXT") = "BNAME LIKE 'I%'"

dann sollte es funktionieren.

Mit freundlichen Grüßen

Matthias Alpmann

iDope?
  • iDope?
  • SAP Forum - Neuling Thema Starter
vor 9 Jahre
Vielen Dank.

Jetzt funktioniert es (: