Code: Alles auswählen.
CALL FUNCTION 'DB_CREATE_TABLE'
EXPORTING
no_exec = 'X'
progname = 'DYN_DB_CREATE'
tabname = 'MYTABL'
TABLES
ddfields = lt_ddfield
EXCEPTIONS
program_not_generated = 1
program_not_written = 2
table_exists = 3
table_not_created = 4
OTHERS = 5.
Code: Alles auswählen.
PERFORM genform IN PROGRAM ('DYN_DB_CREATE') USING rc.
Code: Alles auswählen.
call function 'DB_STORAGE_CLEAR'
exporting
dbsys = dbsys
prid = prid
for_table_and_indexes = 'X'
tabname = tabname
indexname = '0'
exceptions
not_found = 1
db_error = 2
other_error = 3
others = 4.
Code: Alles auswählen.
CALL FUNCTION 'DDIF_TABL_PUT'
EXPORTING
name = lv_table
dd02v_wa = ls_dd02v
dd09l_wa = ls_dd09l
TABLES
dd03p_tab = lt_dd03p[]
EXCEPTIONS
tabl_not_found = 1
name_inconsistent = 2
tabl_inconsistent = 3
put_failure = 4
put_refused = 5
OTHERS = 6.
CALL FUNCTION 'DDIF_TABL_ACTIVATE'
EXPORTING
name = lv_table
auth_chk = ' '
prid = -1
EXCEPTIONS
not_found = 1
put_failure = 2
OTHERS = 3.
Zum Beispiel, um frei zu definierende Konditionstabellen oder einen Ergebnisbereich zu haben...Anonymous hat geschrieben:Warum sollte man Tabellen per Programm erstellen wollen?