2015 Dec 08 9:18 PM
Hello,
Just wondering if dynamic table specification is possible with CDS view?
My requirement is to represent the below in a CDS view-
parameters: p_region type char5.
SELECT table_name
FROM Ztable_names
INTO @data(lv_table)
WHERE region = @p_region.
SELECT col1,
col2
FROM (lv_table)
INTO TABLE @DATA(lv_result).
Thanks,
Ajith
2015 Dec 09 5:18 AM
Hello Ajith,
within a CDS view declaration the names must be specified. No dynamic placeholders can be used.
Regards,
Florian
Hello,
Just wondering if dynamic table specification is possible with CDS view?
My requirement is to represent the below in a CDS view-
parameters: p_region type char5.
SELECT table_name
FROM Ztable_names
INTO @data(lv_table)
WHERE region = @p_region.
SELECT col1,
col2
FROM (lv_table)
INTO TABLE @DATA(lv_result).
Thanks,
Ajith
2015 Dec 09 5:18 AM
Hello Ajith,
within a CDS view declaration the names must be specified. No dynamic placeholders can be used.
Regards,
Florian
2015 Dec 09 12:34 PM
Hi Florian,
Thanks for the clarification.
Is there any other way to achieve this (AMDP etc) ?
Thanks,
Ajith
2015 Dec 09 1:19 PM
Hello Ajith,
within SQLScript you can use dynamic sql (e.g. EXEC command). But you should avoid this because of different reasons, for instance SQL injection vulnerability, decreased performance ...
Best Regards,
Florian
2015 Dec 09 3:12 PM
Thanks ! I think I'll create a RFC function module so that it can be called from external system.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |