‎2006 Aug 10 3:44 AM
I want to create a table using Report with native SQL
the code as blow:
===============================================
REPORT ZDF100001 .
EXEC SQL.
CREATE TABLE ZZDEF50 (
MANDT CHAR(3) NOT NULL,
ZZFDTYPE CHAR(1) NOT NULL,
ZZFLINENO CHAR(4) NOT NULL,
ZZFCOUNTER CHAR(3) NOT NULL,
ZZFSHKZG CHAR(1),
ZZFRACCT_F CHAR(10),
ZZFRACCT_T CHAR(10),
PRIMARY KEY (MANDT, ZZFDTYPE, ZZFLINENO, ZZFCOUNTER)
)
ENDEXEC.
=========================================
when I execute and create it. but I can't find it in Dictionary (SE11) . So I do it again .the Error shows that the object table has already exist....why I can't find it in SE11?
My requirement is to create a transaction table and insert some data at first time the porject running.
But I don't want to create it with SE11 manually.
Can anybody help me to solve the problem?
thanks a lot.
‎2006 Aug 10 4:20 AM
That is the most harmful way you are misusing the native SQL feature. If you are aware of the SAP database concepts, you will know that it is a logical database layer that SAP works with. That is the only way SAP can make its database objects independent of the database platform chosen. When you install SAP and tell that you are going to use Oracle as the database, then the database layer will issue the native commands to create the whole database schema in Oracle. That is the reason why you have to create/change/delete/display data dictionary objects through SAP transactions.
When you create a table through SE11, the table is not only created in the underlying Oracle database, the metadata of the table is stored in other SAP tables (DD02L, DD03L are some examples where this metadata is stored). So when you access the same table, system will read the metadata first.
If you want to create the table programatically, use some function module like DDCREATETAB*
‎2006 Aug 10 4:20 AM
That is the most harmful way you are misusing the native SQL feature. If you are aware of the SAP database concepts, you will know that it is a logical database layer that SAP works with. That is the only way SAP can make its database objects independent of the database platform chosen. When you install SAP and tell that you are going to use Oracle as the database, then the database layer will issue the native commands to create the whole database schema in Oracle. That is the reason why you have to create/change/delete/display data dictionary objects through SAP transactions.
When you create a table through SE11, the table is not only created in the underlying Oracle database, the metadata of the table is stored in other SAP tables (DD02L, DD03L are some examples where this metadata is stored). So when you access the same table, system will read the metadata first.
If you want to create the table programatically, use some function module like DDCREATETAB*
‎2006 Aug 10 5:06 AM
hi
good
you cant create the table like this, if you want to create a ztable than you have to use the se11 there you have to give the table name.There is two process to create the table one is top down and another one is bottom up.
thanks
mrutyun
‎2006 Aug 10 5:54 AM
I see
thank you very much !
I will try function DD_CREATE_TABLE to have a test.