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

Write to ERP Tables on HANA DB using SQL script

p1024029
Participant
0 Likes
1,475

Hello All,

We are using HANA as our primary database for ABAP system and trying to feed the data to ABAP tables using SQL script and experiencing authorization errors . Please see below for more details.

Scenario.

I am getting no authorised error when i try to write some data to Z* tables using SQL script in HANA studio.But I am able to create new tables in the same schema.

As shown above Query1: SAPSR1 is the schema which contains underline ABAP tables. ZGSA is existing table and now i am trying to insert new rows into it.

Query 2&3: Creating new tables in SAPSR1 works fine.

Can you please suggest me whether it is right approach or i need to have RFC to update these table from some other tool/app?.

Thanks in advance,

Naresh

1 ACCEPTED SOLUTION
Read only

p1024029
Participant
0 Likes
1,265

I have successful transported data from HANA tables to ERP Tables.

1. Created Attribute views on HANA tables.

2. Created Dictionary View in ABAP and used HANA attribute views as external views.

3. Implemented Program to copy data from Dictionary view and written to ERP tables.

Cheers,

Naresh

6 REPLIES 6
Read only

lbreddemann
Active Contributor
0 Likes
1,265

Hi Naresh,

Obi Wan would now probably say: "this is not the functionality you're looking for".

Even though you are working with Z-tables you really don't want to start messing with those from outside the context of the NetWeaver system.

Instead you want to keep the control over all tables in the NetWeaver schema completely  to the SAP<sid> user and NetWeaver.

For your data loading scenario, just write a simple ABAP report with native sql or an AMDP to do the copying of the data for you.

Don't spread your code across the landscape and don't loosen access restrictions on your schema.

- Lars

Read only

christian_seitel
Product and Topic Expert
Product and Topic Expert
0 Likes
1,264

I think your approch is correct, but 'create' does not imply 'insert' authorization; this has to be granted separately, e.g.:

Read only

0 Likes
1,264

What is your reasoning behind supporting to give up schema management and self-containment?

The moment you create new objects in the NetWeaver schema directly on DB level, you made the system a lot harder to manage.

How do you transport these objects?

How do you maintain them later on?

What do you do, when these objects get changed from "outside" NetWeaver and your ABAP doesn't know about it?

Read only

0 Likes
1,264

Hi,

above there is a screenshot of a SQL-script console and I don't think this can serve as a prototype of a productively used data replication scenario (or it would be very hard to convert it into such).

Maybe Naresh just wants to get the script running in order to measure how long it takes to copy the data this way. Or to copy the data to run some further tests in the "target" system which require these data.

Read only

0 Likes
1,264

Thanks you both for your replies,

I have got some test data in my temporary tables and i need same data in ERP Z* tables. So I was just trying to replicate the data from temp tables to actual tables.

I am getting authorization error since Insert permission on Schema not granted to any of my users.

As this Schema is mapped from ABAP system, I am wondering how to grant the insert permission to make my job easy.

If it is really wrong way of doing or not possible to do this, then i will change my mind and follow Lars suggestion which was my original plan.

Thanks,

Naresh

Read only

p1024029
Participant
0 Likes
1,266

I have successful transported data from HANA tables to ERP Tables.

1. Created Attribute views on HANA tables.

2. Created Dictionary View in ABAP and used HANA attribute views as external views.

3. Implemented Program to copy data from Dictionary view and written to ERP tables.

Cheers,

Naresh