2009 Mar 05 1:09 PM
Hello!
Is there any way to create a Database table or a database structure through ABAP code?
Thanks in advance, mastuerzos!
Hi,
Hope this can be done to simulate Table creation using BDC methods.
Create recording for Table creation in Se11,then program this in SE38.
2009 Mar 05 1:12 PM
2009 Mar 05 1:12 PM
Hi,
Good Question...,
No . As of my knowledge its not possible. But we can create internal table from transaction code SE11.
Thanks,
Naveen Inuganti.
2009 Mar 05 1:27 PM
Hi,
Hope this can be done to simulate Table creation using BDC methods.
Create recording for Table creation in Se11,then program this in SE38.
2012 Apr 23 12:08 PM
Hi,
Its is not possible from se38.
In order to create Table from se38 you have to use BDC concept, even I have done this....
Regards,
Rajesh Sadula.
2012 Apr 23 6:33 PM
Hi,
What about FM DDIF_TABL_PUT?
by the way, all DDIC objects can be created with DDIF* fms...
Cheers,
Manu.
2012 Apr 23 6:43 PM
2012 Apr 23 7:19 PM
arff...sorry for that...haven't noticed, was just focused on the last reply...
Kr,
Manu.
2012 Apr 23 7:22 PM
It happens
I was able to change a table using this FM, but not actually able to create one.
Rob
2012 Apr 23 8:27 PM
ah? I thought I used it in the past... or perhaps it was DD_CREATE_TABLE... For sure one of them can be used to do this.
Manu
2012 Apr 24 6:46 AM
Hi,
I have gone through some SDN links, and I found we can create table using FM
1) DDIF_TABL_PUT - Create New Transparent Table.
2) DDIF_TABL_ACTIVATE - To active the table.
While using DDIF_TABL_PUT
DATA:
lt_fields TYPE TABLE OF dd03p,
wa_field TYPE dd03p,
table_header TYPE dd02v,
techn_set TYPE dd09v.
table_header-tabname = p_tabnam.
table_header-ddtext = p_tabtxt.
table_header-ddlanguage = sy-langu.
table_header-tabclass = 'TRANSP'.
table_header-as4user = sy-uname.
table_header-contflag = 'A'.
table_header-mainflag = 'X'.
techn_set-tabname = p_tabnam.
techn_set-tabkat = 0.
techn_set-tabart = 'APPL1'.
techn_set-bufallow = 'X'.
techn_set-pufferung = 'X'.
wa_field-tabname = p_tabnam.
wa_field-ddlanguage = sy-langu.
wa_field-notnull = 'X'.
wa_field-keyflag = 'X'.
wa_field-fieldname = 'ID'.
wa_field-position = position.
wa_field-rollname = 'CHAR10'.
APPEND wa_field TO lt_fields.
CALL FUNCTION 'DDIF_TABL_PUT'
EXPORTING
name = 'Table Name'
dd02v_wa = table_header
dd09l_wa = techn_set
TABLES
dd03p_tab = lt_fields " Table fields
EXCEPTIONS
tabl_not_found = 1
name_inconsistent = 2
tabl_inconsistent = 3
put_failure = 4
put_refused = 5
OTHERS = 6.
IF sy-subrc = 0.
WRITE: /, 'Table Created'.
ELSE.
WRITE: /, 'Error occurred'.
ENDIF.
*Activating the Table
CALL FUNCTION 'DDIF_TABL_ACTIVATE'
EXPORTING
name = 'Table Name'
* IMPORTING
* RC =
EXCEPTIONS
not_found = 1
put_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE: /, 'Table could not be activated.'.
RETURN.
ELSE.
WRITE: /, 'Table has been activated.'.
ENDIF.
I believe this will solve your problem...
Regads,
Rajesh Sadula.
2021 Apr 12 5:33 PM
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |