05-03-2023 3:50 PM
It is possible to create database view by code? E.g I have a two tables which tablename is in mv_ddtab, and the other mv_tab, I also need change a field names. the view will be join of two tables with all fields which tables constains.
05-03-2023 3:51 PM
Hello Rebeka,
Welcome to the SAP Community! Thank you for visiting us to get answers to your questions.
Since you're asking a question here for the first time, I'd like to offer some friendly advice on how to get the most out of your community membership and experience.
First, please see https://community.sap.com/resources/questions-and-answers, as this resource page provides tips for preparing questions that draw responses from our members. Secondly, feel free to take our Q&A tutorial at https://developers.sap.com/tutorials/community-qa.html as well, as that will help you when submitting questions to the community.
Finally, I recommend that you include a profile picture. By personalizing your profile, you encourage readers to respond: https://developers.sap.com/tutorials/community-profile.html.
I hope you find this advice useful, and we're happy to have you as part of SAP Community!
All the best,
Anne
05-03-2023 5:11 PM
have you heard CDS? unless you are working on very old abap system.
05-04-2023 10:52 AM
3a9e4ce873a94034b33dc62b0ce600ee
https://blogs.sap.com/2017/09/09/abap-core-data-services-introduction-abap-cds-view/
Originally, CDS was available only in the design-time and runtime environment of SAP HANA. Now, the CDS concept is also fully implemented in SAP NetWeaver AS ABAP, enabling developers to work in the ABAP layer with ABAP development tools while the code execution is pushed down to the database.
I've created CDSs on MaxDB systems.
05-04-2023 11:26 AM
matthew.billingham Thank you! I've learned something new. I was not aware CDS is available outside of HANA realm.
05-03-2023 6:31 PM
In "very old abap system", it's function module DDIF_VIEW_PUT. To see how it works, run DDIF_VIEW_GET on an existing view and see how the parameters are filled.
But why do you need to create a view programmatically if you need to do it only once? I don't get it.
05-03-2023 7:20 PM
You might check options for native SQL you have in AMDPs.
Else - to have objects available on DDIC level - refer to CDS views as available since Netweaver 7.4 SP 05 (if I am not mistaken) like recommended by Jun Wu