Monday, August 25, 2014

ABAP SQL execution program

* we can execute sql by using method 'execute_update' of class '‘CL_SQL_STATEMENT’'.

REPORT  zexec_sql.

PARAMETERS : p_sql(255) TYPE c.

DATA: go_sql TYPE REF TO cl_sql_statement.
DATA: gd_sql TYPE string.
DATA: gd_ret TYPE i.

CREATE OBJECT go_sql.

gd_sql = p_sql.

TRANSLATE gd_sql TO UPPER CASE.

CALL METHOD go_sql->execute_update
  EXPORTING
    statement      = gd_sql
  RECEIVING
    rows_processed = gd_ret.



No comments:

Post a Comment