Application Development 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: 

Duplicate entries while selecting from Calculation View through ADBC connection

Former Member
0 Kudos

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

5 REPLIES 5

schneidertho
Advisor
Advisor
0 Kudos

Hi Revathi,

have you tried to add the client to the WHERE condition?

Cheers

Thorsten

0 Kudos

Hi Thorsten,

Yes I tried giving the client as well, but no luck.

Instead of Select *, I used Select with field names followed by GROUP BY and i got the correct number of records.

But still wondering why the Select * dint work.

Regards,

Revathi SJ

0 Kudos

Hi,

Does changing the "hold_cursor = abap_false" makes a difference by leaving the export parameter as default?

Also you have not got a reference for the ls_view1 variable?

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

Best regards.

YS

0 Kudos

Hi Yen,

Changing the "hold_cursor = abap_true" makes no difference

Also i have made a reference to ls_view1, but its not shown in the code pasted above.

I have added the code lo_connection->close( ), but no change.

Regards,

Revathi SJ

0 Kudos

Hi Revathi,

You want to paste the modified complete codes here again?

Regards.

YS