none
How to view the output of SAP table RRS feed

  • Question

  • Hi All,

    I am new to C#.

    I am learning to build an C# application which can read data from SAP Table and store in ms access.

    [I am using SapMicroOrm from Nuget to connect to SAP.]

    I am able to compile and everything is fine. But I need help on - 

                                    1) I do not know how to view the data in console.writeline or message box. Please help

                                               2) Also I need to store the output values to an ms access table.

    Public class MARA

            { 
                 public string MATNR { get; set; } 
                 public string MTART { get; set; } 
                 public string MATKL { get; set; } 
             }

    And using as

     List<MARA> materials = sapConn
                    .From<MARA>()
                    .Select("MATNR, MTART");

    Would you please help to me to get the output in console and message box ?

    Saturday, January 5, 2019 5:22 PM

All replies

  • Hello,

    There are no compatible data type in MS-Access  2007+ for this data, these is what's available. If you were using SQL-Server Express edition there is a data type that may be used to store a binary file and read it back out but you must save the file (with the table in it) to disk prior to using the table.

    Only other options is to store the path to the SAP data in a MS-Access database but that doesn't really make sense.

    Perhaps you can explain why you want to store the table in another database rather than simply use it.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Saturday, January 5, 2019 6:51 PM
    Moderator
  • Hi,

    Let me first learn this part :)

     >>>> I do not know how to view the output data (array, string etc etc...) in console.writeline or message box. Please help.

    List<MARA> materials = sapConn
                    .From<MARA>()
                    .Select("MATNR, MTART");

    Then I will learn on the database part.

    Sunday, January 6, 2019 7:08 AM
  • Looks like what you have is a flavor of lambda that is not standard in the .NET Framework which normally looks like. Since it's non-standard I can give you some guidance but not exact. 

    using (var context = new NorthWindEntities())
    {
        var results = context.Customers.Select(cust => new {Name = cust.CompanyName, Contact = cust.ContactName}).ToList();
        foreach (var customeResult in results)
        {
            Console.WriteLine($"{customeResult.Name}, {customeResult.Contact}");
        }
    }

    In the example above consider context, From is equivalent to Customers.

    So in the example above I get all customer's name and contact name where the entire customer class is as follows.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Sunday, January 6, 2019 11:28 AM
    Moderator