Integration with SAP

I am creating a system for integration with SAP.

The client gave me a function and parameters, according to him, this function was usually performed in SAP, but in my code, when I try to get a parameter, it returns me null.

Here is my code

SAPFunctionsOCX.SAPFunctionsClass func = new SAPFunctionsOCX.SAPFunctionsClass();
func.Connection = connection;
SAPFunctionsOCX.IFunction ifunc = (SAPFunctionsOCX.IFunction)func.Add(functionName);
SAPTableFactoryCtrl.Tables tables = (SAPTableFactoryCtrl.Tables)ifunc.Tables;
SAPTableFactoryCtrl.Table objTable = (SAPTableFactoryCtrl.Table)tables[tableName];

//Paramters (Find one column "MATNR"
SAPTableFactoryCtrl.Columns cols2 = (SAPTableFactoryCtrl.Columns)objTable.Columns;
for (int i = 1; i <= cols2.Count; i++)
{
    SAPTableFactoryCtrl.Column col = (SAPTableFactoryCtrl.Column)cols2[i];
    Console.WriteLine(col.Name);
}

//Error here!  matnr == null
SAPFunctionsOCX.IParameter matnr = (SAPFunctionsOCX.IParameter)ifunc.get_Exports("MATNR");

An Internet search showed several examples similar to mine here , here and here !

Why method. get_Exports ("MATNR"); returns null?

+5
source share
2 answers

, RFC?
, , , - (.. ).


PS: ABAP SAP

+1

, , ,

0

All Articles