Application Development and Automation 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: 
Read only

Creating a database table dynamically with different structure

Former Member
0 Likes
744

I want to create a database table dynamically with the content of table details stored in an internal table.

Ex:

ZTAB1 MANDT

ZTAB1 F1

ZTAB1 F2

ZTAB1 F3

ZTAB1 F4

ZTAB2 MANDT

ZTAB2 F1

ZTAB2 F2

ZTAB2 F3

The above structure will be dynamic, it can be of any structure. so, i need to create these ztables i.e. ztab1,ztab2.

For this, i am using fm:DDIF_TABL_PUT but how can i identify that the first set of fields in ztab1 should be created.

Requesting for a prompt solution.

Thanks in advance.

Rohith

2 REPLIES 2
Read only

SimoneMilesi
Active Contributor
0 Likes
512

Hi!

I think you should use another FM DD_CREATE_TABLE instead of DDIF_TABL_PUT.

DDIF_TABL_PUT is needed to create the TECHNICAL SETTINGS for what i can see

Read only

Former Member
0 Likes
512

Hi,

U can do that easily.

Just pass the refrence tablename and refrence field names to the parameter tables.

CALL FUNCTION 'DDIF_TABL_PUT'
  EXPORTING
    NAME                    = 
*   DD02V_WA                = ' '
*   DD09L_WA                = ' '
* TABLES
*   DD03P_TAB               =
*   DD05M_TAB               =
*   DD08V_TAB               =
*   DD35V_TAB               =
*   DD36M_TAB               =

here in your case ,

pass Ztab1 and F!, F2, F3 fields

Hope this will be helpful

Regards,

Abhishak

Edited by: Abhishak Arora on Nov 26, 2009 11:46 AM