2013 Mar 09 12:51 PM
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
Hi Revathi,
You want to paste the modified complete codes here again?
Regards.
YS
2013 Mar 10 8:30 PM
Hi Revathi,
have you tried to add the client to the WHERE condition?
Cheers
Thorsten
2013 Mar 11 6:35 PM
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
2013 Mar 12 4:46 AM
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
2013 Mar 12 8:29 AM
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
2013 Mar 12 8:42 AM
Hi Revathi,
You want to paste the modified complete codes here again?
Regards.
YS
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |