The class ABAPCode offers nearly unlimited possibilities. You can execute ABAP code on the fly and retrieve the result in a string array.
The following sample shows how to create a simple ABAP interpreter that executes a dynamic SQL statement, see screenshot below.
AbapPad

Creating an ABAP Interpreter #

  1. Open a client connection to the R/3 system using the R3Connection class.
  2. Use the method AddCodeLine to add a new line of code to the dynamic report.
  3. Execute the report via Execute.
  4. Read the result set (regarding the ABAP list) by using the method GetResultLine.
private void button1_Click(object sender, System.EventArgs e)
{
	using (R3Connection con = new R3Connection("SAPServer", 00, "SAPUser", "Password", "EN", "800"))
            {
                ERPConnect.LIC.SetLic("LicenseNumber");
                con.Open(false);
				
                ERPConnect.Utils.ABAPCode code = new ERPConnect.Utils.ABAPCode();
                code.Connection = con;
				
                foreach (string s in txtABAPCode.Lines)
                {
                    code.AddCodeLine(s);
                }
                if (code.Execute())
                {
                    for (int i = 0; i < code.ResultLineCount; i++)
                        txtResult.Text += code.GetResultLine(i) + "\r\n";
                }
                else
                {
                    txtResult.Text = "ABAP Error: " + code.LastABAPSyntaxError;
                }
            }
}