Skip to Content
0
Aug 06, 2015 at 06:50 AM

Problem in using Native Sql with HANA

135 Views

Hi,

I am fetching HANA views data using native sql in abap. I have observed a problem that sap is allowing only 29 execute sql commands statements in a row and gives dump for 30th query. My code is like below


LO_CONN = CL_SQL_CONNECTION=>GET_CONNECTION( CONN1).

LO_SQL_STMT = LO_CONN->CREATE_STATEMENT( ).



LOOP AT T_RANGE2 INTO WA_RANGE2.

CONCATENATE 'INSERT INTO VBELN_TEMP1 VALUES (' ''''WA_RANGE2'''' ')' INTO LV_SQL_INS.

TRY.

LO_RESULT = LO_SQL_STMT->EXECUTE_QUERY( LV_SQL_INS ).

CATCH CX_SQL_EXCEPTION INTO LX_SQL_EXC.

LV_TEXT = LX_SQL_EXC->GET_TEXT( ).

MESSAGE LV_TEXT TYPE 'E'.

ENDTRY.

ENDLOOP.

Here I am passing a value range to VBELN_TEMP1 table of HANA through a loop on T_RANGE2 internal tab.

It works fine till TABX 29 and gives exits the program on 30th iteration.

Please help if anyone has observed same problem and found solution on it.

Thanks,

Shriniwas