2013 Dec 31 11:44 AM
Hi all,
Is it possible to apply a dynamic where clause in AMDP like ABAP
ex:
SELECT c1 c2.. from T1
...
where(my_dynamic_where_clause) ?
I dint' get proper documentation on AMDP dynamic sql's
Query 2:-
I see that there's EXEC 'sql_query' in stored procedures.we cannot use EXEC in read only procedures.
when i try to create a procedure , in the wizard it's always "read_only" procedure that is created., How to create a read-write procedure?
Is it authorization issue ? If not what am i missing here?
Regards
Saurabh
2014 Jan 28 2:15 PM
Syntax of the method body of AMDP is SQL Script. You can see this mentioned in
Jens promises more details later "More details for AMDP will follow soon and can be found in a detailed document here in SCN ( ABAP Managed Database Procedures) " in his blog You can see a glimpse of what would be possible with respect to "read_only" in the picture there and in the video Introduction into ABAP Managed Database Procedures on SAP HANA.
2014 Feb 20 6:25 AM
A colleague pointed out to me that specifics of your question is not answered in the references I offered earlier. Let me try to rectify that.
Could you please check out APPLY_FILTER in the SAP HANA SQL Script reference. This might be what you are looking for. In this case you will not need to use "EXEC 'sql_string'. You can do the following instead:
temp_result = SELECT c1 c2.. from T1 ...;
result = APPLY_FILTER(:temp_result, :my_dynamic_where_clause)
Don't be afraid that temp_result will be fetched and later filtered. If you do not read temp_result only result will be fetched after applying the filter.
Hope this answers your query better.
2019 Oct 29 7:32 PM
The best practice is the opposite. First the filter is created and then the query
*...Filtro
ex_it_vbak_filter = APPLY_FILTER (vbak,:ip_filter_vbeln_auart);
*...Select Data
ex_it_vbak = SELECT vbeln,auart
FROM :ex_it_vbak_filter