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: 

ZTABLE insert or update from DB (Backend)

Former Member
0 Kudos
144

Hi Friends,

I have a doubt.

Is it possible to update a Ztable in SAP from Database.

I mean not from Application server, not thru open SQL or Thru SE11 tools.

As table will be defined in the database in the backend as and when a table is created in SAP, right! will i be able to update that?

I know we should not do that in SAP but wanted to explore.

Thanks,

Simha

7 REPLIES 7

Former Member
0 Kudos
117

You should NEVER try this.

JanStallkamp
Advisor
Advisor
0 Kudos
117

Hi.

If you create a table (Zsomething) on the database and do not define it with SE11 or similar then you will not be able to access it using OPENSQL.

If you use some other technology (e.g. EXEC SQL) to connect to the database then you can access any table on the database. But if you don't have a very good reason to do so I would refrain from it. You are loosing all the great advantages OPENSQL offers like database independent syntax, type checks...

Best regards,

Jan Stallkamp

0 Kudos
117

Hi Jan Stallkamp,

Thanks for your inputs.

Yes i am aware that i will be loosing all the great advantages of Open SQL.

So you mean to say that it is possible to create a table in the same schema in the Database where SAP Database exists and i can access that table thru Exec SQL Commands, right!

Pls clarify.

Regards

Simha

Edited by: Simha on Jul 22, 2008 10:57 AM

0 Kudos
117

>

> Yes i am aware that i will be loosing all the great advantages of Open SQL.

>

> So you mean to say that it is possible to create a table in the same schema in the Database where SAP Database exists and i can access that table thru Exec SQL Commands, right!

Yes. You can create such a table. And you can access it through EXEC SQL. But you will see in the DBACOCKPIT that there is a table on the database not maintained in the DDIC. And I'm not sure if there are any other problems that might arise from it. You have to face that your ABAP system does not know anything about that table and therefore most SAP tools will not recognize that table. I definitely would not go this way without a very good reason.

/Jan

0 Kudos
117

Hi Jan,

My reason goes like this, don't know if its good or bad.

we are building an interface for invoices, so invoice is in a data file and there are some additional documents(PDF, JPEG)for each invoices.

All will be FTP ed into a local share drive.

Invoice data file will be moved to SAP directory and a program(Java program running in AIX os, where SAP is there) will push those docs into a Document Management System which is custom built DMS application. So once they are pushed into DMS, DMS will return an Id for each doc, that has to be stored against the invoice id.

So that i have track of Invoice Vs Document Id.

Here i want to make use of Database table and user native sql to get that data.

Do you know any better way of doing this?

SAP on 4.7EE no Java Engine

Os: AIX

DB: DB2

Regards,

Simha

0 Kudos
117

Hi Simha.

One suggestion: Maybe you ask in the 'SAP on DB2 for Linux, Unix, Windows' forum. There you will find a lot of experts familiar with the native SQL used for DB2 on AIX.

Second idea: There is something called multiconnect. That allows you to access other databases from your ABAP code. I just feel uncomfortable with a table inside the SAP database that is not registered in the DDIC. Either have it in a different database or register it in the DDIC. But I'm not an expert in setting up such scenarios.

Third idea: Can't you build a nice interface between the DMS and your SAP system using RFC or something like that?

Best regards,

Jan Stallkamp

0 Kudos
117

Hi Jan Stallkamp,

thanks for your prompt response.

What you said is right but we have constraints both from DMS application side and SAP side as well.

Any ways thanks a lot for your inputs and FYI it would be the last option to use a table in DB. We might not go for it as its not the right practice.

Thanks,

Simha