cancel
Showing results for 
Search instead for 
Did you mean: 

Copy HANA Views across schemas

Former Member
0 Kudos

Hi Experts,

I have a requirement where I need to make 20 HANA views with same set of ECC tables and with same logic of derivation. I have graphical view for one schema and I need to create similar views for all remaining 19 schemas.

Now I want to know any script or way where I do not need to recreate views manually.

Can I simply copy and replace schema names in the definition of the graphical calculation views? Is there any way to edit the defnition of graphical calculation views in background?

Regards,

Shiwesh

Accepted Solutions (1)

Accepted Solutions (1)

SergioG_TX
Active Contributor
0 Kudos

Shiwesh,

are the tables still on the same original schema? or are the tables on a new schema? is the view only changing the schema?

Former Member
0 Kudos

Hi Sergio,

Thanks for your reply.

Scenario is like this -

1. Schema A-Table A and Schema A-Table B are joined to get the calculation view currently

2. Schema B-Table A and Schema B-Table B join has to be created for next calculation view which eventually has same mapping, same logic but just tables pointing to new schema.

Now I do not want to create calculation manually in each case as I have to deal with plenty of schemas.

Just to mention that all tables for particular calculation views will always come from single schema.

muthuram_shanmugavel2
Contributor
0 Kudos

Hi Shiwesh,

Please follow the steps.

1. Create One Calculation View.

2. Export the Calculation View using "Developer Mode" Option.

    Select Source System

    Select Object to Export (Calculation View)

    Select Target Folder

   

3. Check the Target Folder, (*.Calculationview) would be created.

    If your Calculation View Name is CV_01, Then CV_01.calculationview file would be created.

   

4. Copy this File and rename it as CV_02.calculationview.

    Open the File, It will be opened in XML format.

    There schema Name would be mentioned in "columnObject schemaName" Tag.

     Replace the existing schema name with new schema name which you want to use for this view.

     Save the File.

5. Then Import this File to HANA System using Import --> Developer Mode.

    Select Source System,

    Select the Path (Path has to be mentioned till SID)

    Once the File selected, Click Finish.

   

New Calculation View would be created with new schema.

Try this and let me know the result.

I hope it would work.

Regards,

Muthuram

Answers (1)

Answers (1)

RashmiAcharya
Advisor
Advisor
0 Kudos

Hi Shivesh,

If you are using SAP HANA Studio of SP10+ version you can do it easily by using "Chnage Authoring Schema" option in Quick View.

1. Open Quick view from Help > Quick view

2. Select Change Authoring Schema from Qucik view options

3. Select the system > click on Next

4. Select the package or specific view's for which you want to change the table schema and add it to right side

5. Below in schema details section TYPE your source schema name and target schema name

6. Click on Finish button

Once the job is completed open your views and check the schema of your source tables. You have to activate the views again to use them.

Regards,

Rashmi

Former Member
0 Kudos

Hi Rashmi,

Thanks for your reply. Looks correct step which you explained. But somehow all schemas does not show in the drop down of source and target schemas.

Let's say if we have multiple ECC systems connected then for ECC system with schema name "ABC01" has to be changed to "XYX01". These ECC schemas are not showing in the drop down.

@Muthuram - I am yet to test with your approach due to other priority works.

I however understand that the option you explain will work.

Thanks for the help.

RashmiAcharya
Advisor
Advisor
0 Kudos

Hi Shiwesh,

Its not mandatory to select the source and target schema from the drop down. You can type them manually and continue.
Let me know if that works out for you.

Regards,

Rashmi

siddharth_madireddy
Discoverer
0 Kudos

Hi Rashmi,

When I try the steps you suggested- I am getting the below Error:

Please help.

Thanks in advance,

Siddharth M