Мне нужно искать клиентов в системе SAP из приложения C#. Я использую коннектор С# .NET. Я попытался вызвать BAPI "BAPI_CUSTOMER_FIND", чтобы получить всех клиентов с именем, начинающимся с символа "C", это мой код:
SAPConnectionConfigurator cfg = new SAPConnectionConfigurator();
RfcDestinationManager.RegisterDestinationConfiguration(cfg);
RfcDestination dest = RfcDestinationManager.GetDestination("mySAPdestination");
RfcRepository repo = dest.Repository;
IRfcFunction customerList = repo.CreateFunction("BAPI_CUSTOMER_FIND");
customerList.SetValue("MAX_CNT", "100");
IRfcTable searchFields = customerList.GetTable("SELOPT_TAB");
searchFields.Insert();
searchFields.CurrentRow.SetValue("COMP_CODE", "");
searchFields.CurrentRow.SetValue("TABNAME", "KNA1");
searchFields.CurrentRow.SetValue("FIELDNAME", "NAME1");
searchFields.CurrentRow.SetValue("FIELDVALUE", "C*");
customerList.Invoke(dest);
IRfcTable results = customerList.GetTable("RESULT_TAB");
Вызов работает правильно, но я не знаю, как прочитать результат. Мне нужен список клиентов, но таблица RESULT_TAB имеет странную структуру:
https://www.sapdatasheet.org/abap/tabl/bapikna111.html
Как я могу получить список клиентов? Я вызываю неправильный BAPI?