public async Task <TOutput> GetStructAsync <TOutput>(List <string> options, bool includeUnsafeFields = false, string delimiter = "|", string noData = "") where TOutput : class, ISapTable { using IRfcConnection rfcConnection = GetConnection(); using IRfcFunction rfcFunction = rfcConnection.CreateFunction(READ_TABLE_FUNCTION_NAME); List <string> fieldNames = GetRfcEntityFieldNames(typeof(TOutput), includeUnsafeFields); var inputParameters = new TableInputParameter { Query = GetRfcTableName <TOutput>(), Delimiter = delimiter, NoData = noData, RowCount = 1, RowSkips = 0, Fields = fieldNames?.Select(f => new TableField { FieldName = f }).ToArray(), Options = options?.Select(o => new TableOption { Text = o }).ToArray() }; TableOutputParameter result = await rfcFunction.InvokeAsync <TableOutputParameter>(inputParameters); return(ConvertToStruct <TOutput>(result, delimiter, fieldNames)); }
public TOutput ExecuteBapi <TOutput>(string name) where TOutput : class, IBapiOutput { using IRfcConnection rfcConnection = GetConnection(); using IRfcFunction rfcFunction = rfcConnection.CreateFunction(name); TOutput result = rfcFunction.Invoke <TOutput>(); result.BapiReturn.ThrowOnError(); return(result); }
public async Task <TOutput> ExecuteBapiAsync <TInput, TOutput>(string name, TInput input) where TInput : class, IBapiInput where TOutput : class, IBapiOutput { using IRfcConnection rfcConnection = GetConnection(); using IRfcFunction rfcFunction = rfcConnection.CreateFunction(name); TOutput result = await rfcFunction.InvokeAsync <TOutput>(input); result.BapiReturn.ThrowOnError(); return(result); }
public async Task <TOutput> ExecuteRfcAsync <TInput, TOutput>(string name, TInput input) where TInput : class, IRfcInput where TOutput : class, IRfcOutput { using IRfcConnection rfcConnection = GetConnection(); using IRfcFunction rfcFunction = rfcConnection.CreateFunction(name); return(await rfcFunction.InvokeAsync <TOutput>(input)); }
public TOutput ExecuteRfc <TInput, TOutput>(string name, TInput input) where TInput : class, IRfcInput where TOutput : class, IRfcOutput { using IRfcConnection rfcConnection = GetConnection(); using IRfcFunction rfcFunction = rfcConnection.CreateFunction(name); return(rfcFunction.Invoke <TOutput>(input)); }
public void ExecuteRfc <TInput>(string name, TInput input) where TInput : class, IRfcInput { using IRfcConnection rfcConnection = GetConnection(); using IRfcFunction rfcFunction = rfcConnection.CreateFunction(name); rfcFunction.Invoke(input); }
public async Task <bool> ExecuteRfcAsync(string name) { using IRfcConnection rfcConnection = GetConnection(); using IRfcFunction rfcFunction = rfcConnection.CreateFunction(name); return(await rfcFunction.InvokeAsync()); }
public void ExecuteRfc(string name) { using IRfcConnection rfcConnection = GetConnection(); using IRfcFunction rfcFunction = rfcConnection.CreateFunction(name); rfcFunction.Invoke(); }