Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9041

Re: Push down SELECT-OPTIONS to HANA

$
0
0

Hello Hyukjoo,

sorry but for me it is not clear what is really wrong.

Do you mean that the APPLY_FILTER get the wrong data back. In the way that the filter is not

working ? OR the select Options that was created are wrong converted ?

We tried the same way and there was no problem with the convertion of the select option.

For better comparison I will copied our example !
Please could you check your coding with the example below ?
1. Define Selection Screen.
TABLES SNWD_BP.
SELECT-OPTIONS BP_ID FOR SNWD_BP-BP_ID.
2. Use the class CL_LIB_SELTAB to convert the range table into WHERE Clause string.
DATA(lv_sel_tab) = cl_lib_seltab=>new( it_sel =BP_ID[] ).
DATA(lv_where_clause) = lv_sel_tab->sql_where_condition( iv_field = '"BP_ID"').
3. Output of variable lv_where_clause is e.g.   ("BP_ID" BETWEEN '0100000000' AND '0100000016')  .Hence we can use lv_where variable directly into the AMDP.
4. Call the AMDP procedure. In our example test_select_options and transfer the where_clause in the AMDP as input parameter.
create object l_amdp_test.
CALL METHOD l_amdp_test->test_select_options
EXPORTING
it_sel_options = lv_where_clause
IMPORTING
et_snwd_bpa = lt_snwd_bpa.

5. You can see that the Where_clause string are used in the APPLY_FILTER as second parameter (IT_SEL_OPTIONS).
CLASS zdw_amdp_with_select_options DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
interfaces if_amdp_marker_hdb.
   METHODs test_select_options
     IMPORTING
        VALUE(it_sel_options) TYPE string
     EXPORTING
        VALUE(et_snwd_bpa) type ZDW_SNWD_BPA
       .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
METHOD test_select_options by database procedure for hdb language SQLSCRIPT using SNWD_BPA.
itab = select * from SNWD_BPA ;
et_snwd_bpa = APPLY_FILTER(:itab,:IT_SEL_OPTIONS) ;
ENDMETHOD.

I hope this information is helpful. Otherwise feel free to contact us again.

Best regartds,

Daniel


Viewing all articles
Browse latest Browse all 9041

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>