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: 

How to programmatically create DB table (or alternatives)?

Former Member
0 Kudos

Hi all,

I want/need to programmatically create a Z-table on the SAP database from within a report. The fields to be defined for this new table are unknown in advance, they can dynamically be set on a web dynpro user interface, therefore we need to create such a new table from within ABAP code. Is that possible at all, including activating it as well?

If there is absolutely no way of accomplishing that task do you see any suitable alternative? I assume it is possible somehow though, as SAP standard is doing that via SE11 as well...

Thanks in advance for your help!

Kind regards, Matthias

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Please have a look to FMs DDIF_*, such like DDIF_TABL_PUT  and DDIF_TABL_ACTIVATE...

Cheers,

Manu.

4 REPLIES 4

pushkar_dhale
Participant
0 Kudos

Hi,

You may use BDC for SE11 (Table creation) Or native SQL to create table programmatically

Regards,

Pushkar Dhale.

0 Kudos

Hello Pushkar,

thanks for your reply.. I wasn't aware of the fact that SAP allows for such native SQL commands. When I create a table that way, do I need to activate it then via a SAP tool? If so, can I do so again from within my ABAP code?

Thanks!

Former Member
0 Kudos

Hi,

Please have a look to FMs DDIF_*, such like DDIF_TABL_PUT  and DDIF_TABL_ACTIVATE...

Cheers,

Manu.

0 Kudos

thanks Manu, exactly what I was searching for