Question:
I am trying to do this :
Enter ODS name at run-time :
PARAMETERS: ZODS LIKE..........
Is there any way by which I can read the data from the ODS entered during runtime :
SELECT * FROM ZODS ..............
Which will not work because ZODS cannot be defined using Tables STATEMENT ....
Any idea on how to get data from a runtime database object will be of great help to me.
Thanks
Answer:
Your active table of the ODS will be something like /BIC/AZODS00 (prefix '/BIC/A' for custom, suffix '00'). Right-click the ODS -> choose manage -> contents tab -> active data button to confirm.
Answer:
I am not trying to activate data or look at the data :
I have created a simple Z report program that reads ODS table /bic/az......
My issue is I do not want to hardcode the table name (reason being this report will be used by different ODS objects)...
Hence, I have created a parameter to enter ODS name at runtime.
Now the issue is how do I read the data from this...
as
SELECT * from ZODS will not work.....as this table is not in TABLES statement...
I think my explanation is understandable
Answer:
Use following statements:
paramaters: P_tabnm(30) type c.
data: dref type ref to data,
typename type string.
Field-symbols: <fs> type any.
"Create dynamic data i.e. the table structure
TypeName = p_tabnm.
create data dref type (TypeName).
assign dref->* to <fs>.
select single * from (p_tabnm) into <fs> where .....
After this you can use <fs> to show the data.
Answer:
Thanks for the code.....This works.....
Thanks for this forum that I got correct solution.......
Keep smiling