Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Duplicate entries while selecting from Calculation View through ADBC connection

Former Member
0 Likes
432

Hello All,

I am trying to select from the calculation view and the select statement passed to the EXECUTE_QUERY is as below.

SELECT * FROM "_SYS_BIC"."20350139.vendoraging/OPEN_FINAL1" WHERE (  LIFNR = '0000009999' ) AND ( UMSKZ = '' ) WITH PARAMETERS ('PLACEHOLDER' = ('$$RB_INPUT$$',' B '))

The code is

TRY.

       lo_connection = cl_sql_connection=>get_connection('021:R:R').

       lo_statement = lo_connection->create_statement( ).

       CALL METHOD lo_statement->execute_query

         EXPORTING

           statement   = lv_statement

           hold_cursor = abap_false

         RECEIVING

           result_set  = lo_result_set1.

       lo_result_set1->set_param_table( ls_view1 ).

       lo_result_set1->NEXT_package( ).

       lo_result_set1->close( ).

     CATCH cx_sql_exception INTO error.

       WRITE:/ 'Message', error->sql_message.

   ENDTRY.

The internal table is populated with 15 records, where the each record is duplicated thrice.

When the same select statement is executed in SAP HANA 5 records are being fetched.

Please advice what could be wrong here.

Regards,

Revathi SJ

1 REPLY 1
Read only

yeushengteo
Product and Topic Expert
Product and Topic Expert
0 Likes
395

Hi,

Do you need to provide the "hold_cursor = abap_false" in the method call?

Also where did you get the reference of the output table?

...

       get reference of lt_result into ls_view1.  >> Missing statement ?? <<

       lo_result_set1->set_param_table( ls_view1 ).

...

Finally, the close connection should be "lo_connection->close( )".

Best regards.

Yeu Sheng