

Using the above techniques with the MBS plugin, your Xojo apps can now access information contained in SAP. If you have a field you will get the data with: TextField1.Value = f.StringValue("FieldName") If you have a structure you will get a certain field with: var s As RFCStructureMBS = f.StructureValue("ES_MESSAGE") TextField1.Value = s.StringValue("FieldOne") ListBox1.AddRow(TableContent.StringValue("FieldOne"), TableContent.StringValue("FieldTwo")) Var FieldValue as string = TableData.StringValue("")įor iRow as integer = 1 to TableContent.RowCount To get the content of a returned table you must loop like this: If TableData.RowCount > 0 thenįor iRow as integer = 1 to TableData.RowCount If the TableFields.RowCount = 0 then the returned table contains no data. TableData as RFCTableMBS = f.TableValue("DATA") TableFields as RFCTableMBS = f.TableValue("FIELDS") DATA – contains the data found for the transferred where clauses.FIELDS – contains the SAP data dictionary description of the returned table.The function module RFC_READ_TABLE returns now to tables parameters: The clause must look like this “(MATNR = ‘1234’ AND WERKS = ‘1000’) OR (MATNR = ‘3456’ AND WERKS = ‘1000’)”.Īnd now you can execute the function module into the backend system: f.invoke Receiving data from SAP If the where clause length is greater than 72 you must split the clause to several lines. You must consider that the maximum length of a where clause for the table OPTIONS is 72 digits. Is_OPTIONS.StringValue("TEXT") = "(MATNR = '4711')" // WHERE clause Var it_OPTIONS as RFCTableMBS = f.TableValue("OPTIONS") the select options of the where clause as tables parameter: OPTIONS.the name of the table as import parameter: QUERY_TABLE.The function module RFC_READ_TABLE has two parameters: Var f as RFCFunctionMBS = fd.CreateFunction var fd as RFCFunctionDescriptionMBS = ("RFC_READ_TABLE") Exporting key values to SAPįor exporting the key values to the SAP function module you must load a functions description and create a data container for executing the function module. With this standard RFC module you can get the content of a database table and/or the SAP data dictionary description of this table.

This example calls the SAP function module RFC_READ_TABLE. To understand the import and export parameters you must look out of the SAP function module in the surrounding world. If you are calling a SAP Function Module you will export key values to SAP and you will receive data or i.e. MessageBox r.message Calling an SAP Function Module If the connection fails you will get the reason with: Exception r As RFCErrorExceptionMBS Please note if you have a router string you must build the host name (ashost) with a concatenation of router string and host name like this: loginParams.Value("ashost") = + "/H/" + Var ConnectionToSAP As New RFCConnectionMBS(loginParams) LoginParams.Value("passwd") = "MyPassword" Messagebox RFCModuleMBS.LibraryLoadErrorMessageĪnd if the LibPath is set you can do the logon as second step: var loginParams As New Dictionary If the setting of the LibPath fails then send the error message: If not RFCModuleMBS.LoadLibrary(LibFile) Then I’ve copied the SAP libraries with the Xojo build settings into the application resource folders. Var LibPath As String = Ĭall RFCModuleMBS.SetCurrentWorkingDirectory(libPath) Var LibFile as FolderItem = MacOsFolder.Child("libsapnwrfc.dylib") MessageBox("DYLD_LIBRARY_PATH variable not set") If System.EnvironmentVariable("DYLD_LIBRARY_PATH") = "" Then System.EnvironmentVariable("DYLD_LIBRARY_PATH") = MacOsFolder.NativePath get the actual folder and handle the exception
#Jamf mbs xojo plugins jamf remote windows#
In Windows you have some DLL’s around SAPNWRFC.DLL and on macOS you have some DYLIB’s around LIBSAPNWRFC.DYLIB. host name – a name or an IP address (ashost)Īt first you must set the path to the SAP libraries.If so, you must know some data of your SAP logon to connect to an SAP system, such as: Your SAP user must have the authority for RFC connections. The MBS plugin covers the libraries of the SAP NetWeaver RFC SDK 7.50. I’ve done this to SAP R/3 and SAP S/4 HANA.

With the RFC classes of the MBS Xojo Plugin you can build RFC (Remote Function Call) interfaces so that Xojo apps can communicate with SAP systems.
#Jamf mbs xojo plugins jamf remote software#
If you work with large companies, you’ve most likely heard of SAP, a widely used enterprise software solution.
