nunomaia / NwRfcNet

An easy way of making SAP RFC calls from .NET Core
Apache License 2.0
96 stars 28 forks source link

Add SAP XString to Byte #41

Closed InsonusK closed 4 years ago

InsonusK commented 4 years ago

Solve Issue #15 RFC type Xstring

Solve and tested on my project: upload and download zip archive. 1) Upload file to SAP C#:

public class CallUploadImporting
{
  public byte[] File { get; set; }
}
mapper.Parameter<CallUploadImporting>()
            .Property(c => c.File)
            .HasParameterName("I_FILE")
            .HasParameterType(RfcFieldType.Byte);

SAP:

FUNCTION ZLO_****_SET
  IMPORTING
    VALUE(I_FILE) TYPE XSTRING

2) Download to SAP C#:

public class CallDownloadExporting
{
  public byte[] File { get; set; }
}
mapper.Parameter<CallDownloadExporting>()
            .Property(c => c.File)
            .HasParameterName("E_FILE")
            .HasParameterType(RfcFieldType.Byte);

SAP:

FUNCTION ZLO_****_GET
  EXPORTING
    VALUE(E_FILE) TYPE XSTRING
nunomaia commented 4 years ago

good work