Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Creating view by code

0 Kudos

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.

6 REPLIES 6

anne-petteroe
Community Manager
Community Manager
0 Kudos

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

junwu
Active Contributor

have you heard CDS? unless you are working on very old abap system.

matt
Active Contributor

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.

matthew.billingham Thank you! I've learned something new. I was not aware CDS is available outside of HANA realm.

Sandra_Rossi
Active Contributor

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.

manfred_reinart
Employee
Employee
0 Kudos

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