Search This Blog

Showing posts with label DBCON. Show all posts
Showing posts with label DBCON. Show all posts

Friday, June 15, 2018

ABAP Database Connectivity


Use ABAP Database Connectivity (ADBC) to select data. ADBC is an API for the Native SQL interface of the AS ABAP that is based on ABAP Objects and is recommended over EXEC SQL. Reference: https://help.sap.com/http.svc/rc/abapdocu_750_index_htm/7.50/en-US/abenadbc.htm


 data: go_exc   type ref to cx_sql_exception,  
      go_conn  type ref to cl_sql_connection,
      c_dbs type dbcon-con_name value 'DBNAME'.    
    
 try.  
    go_conn = cl_sql_connection=>get_connection( con_name = c_dbs ).  
   catch cx_sql_exception into go_exc.  
    gv_text = |{ text-e03 } { c_dbs }|.  
    message gv_text type 'S' display like 'E'.  
    leave list-processing.  
 endtry.