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: 

Consuming HANA views in ABAP

former_member226419
Contributor
0 Kudos

Hi,

I have created one attribute view and activated successfully but while I am creating database proxy and importing it in ABAP , its giving me below error.

BR

Sumeet

1 ACCEPTED SOLUTION

thomasgauweiler
Active Participant
0 Kudos

Dear Sumeet,

the database type VARCHAR (non-unicode characters) is not supported by ABAP.

You have to use NVARCHAR (Unicode characters) instead.

Best Regards, Thomas

19 REPLIES 19

thomasgauweiler
Active Participant
0 Kudos

Dear Sumeet,

the database type VARCHAR (non-unicode characters) is not supported by ABAP.

You have to use NVARCHAR (Unicode characters) instead.

Best Regards, Thomas

0 Kudos

But i am using standard MARA and MRC tables in attribute view. How can i change the datatypes then? Or need to use  calculated columns tehn of type NVARCHAR?

0 Kudos

The tables should have NVARCHAR, otherwise you could not use them from ABAP.

I assume your calculated columns have the wrong type.

The default for them in HANA studio is VARCHAR. Please check them to be NVARCHAR.

Best Regards, Thomas

0 Kudos

Hi,

Everything is activated but output is blank. When I see data preview of attribute view its showing an output.

one information message is coming: Invalid GUI input data: window dimension

Any idea?

BR

Sumeet

0 Kudos

Is the client setting used by ABAP correct?

0 Kudos

Can you please let me know how to check the same? I have no idea.

0 Kudos

Hmm.. I see...

Could you run

select * from user_parameters

where parameter ='CLIENT';

on the SAP HANA instance and check the client setting for the technical user used to connect the NetWeaver to HANA DB?

- Lars

0 Kudos

Hi,

These are the names I got ( below screenshot).My user ID is BEST by which I have logged it into ABAP which is not coming in this list. I have one more question here.  I have just debugged my report and I can see my select query is getting failed. How can i find out the reasob for the same. i am not worried about the window information but it must show output. below is the query which is getting failed.

select  * from ztest_attr up to 10 rows

    into corresponding fields of table lt_test.

BR

Sumeet

0 Kudos

Ok, first of all:

The client for the SAP<SID> user mustn't be set (since it deals with *all* clients! just reminded me of that - thanks for that Thomas!

Now, your problem seems to be related with the query execution itself as you got errors.

Just check the developer workprocess trace for the full error message (in case SM21 - System log doesn't already get you further).

0 Kudos

But there is some magic client handling in some kind of HANA views depending on the views "Default client" setting. This relies on some SESSION_CONTEXT which might be set by the ABAP.

This can lead to an empty result in the ABAP case but a large result when running from SQL Console.

In addition, if you expose the client as first column on your view with name CLIENT or MANDT then OpenSQL might filter on it.


0 Kudos

I added MANDT in my view but still its not showing an output.

0 Kudos

When I see data preview of my z view its showing blank data.

Also i want to tell one thing I have alter the fields of standard table MARA from varchar to nvarchar. Does this affect any functionality since varchar is not supported by ABAP?

0 Kudos

I can't believe that an ABAP table on HANA has type VARCHAR.

Are you really working in your ABAP schema ?


0 Kudos

The other way round: If you now filter within SQL Console the MANDT by the ABAP mandant you are logged into the ABAP: Do you still get some data? Don't forget to add also the client to the Join-Conditions in your attribute view.

0 Kudos

Didn't you mention some _errors_ you got when trying to access the table?

What about those?

0 Kudos

Hi Lars,

I am confused.

I just tried the same with one more table SCARR and I am able to get the data preview. but when i am trying to do with MARA table I am not getting output. The only thing i did in MARA I changed some fields from varchar to NVARCHAR by alter table.

BR

Sumeet

0 Kudos

Hi Thomas,

I have one more query. I can see many of my models using lot of SAP tables and mostly have dataypes as VARCHAR . Is there any method when we create proxy at that time we can change them to NVARCHAR as per ABAP supported types? As it is very difficult to change datatypes of so many fields via ALTER command.

BR

Sumeet

0 Kudos

Hi Sumeet,

how was your system created/upgraded? Normally your tables should already have becone NVARCHAR during creation/upgrade. Can you pleas check in transaction SE11 if the runtime object is consistent?

Regards, Thomas


0 Kudos

Hi,

Its done. I removed MANDT and created everything again with NVARCHAR  and it worked.

Thanks

Sumeet