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

using ABAP data types in SQL procedures

former_member195748
Participant
0 Likes
2,276

Hello Gurus,

Is it possible to use ABAP Data types in SQL procedure.

Example- like in abap we declare structures and within structure when we define the fields we can define them as type table-field.

In the same way when I define table type in SQL can i use the ABAP data elements.

Example-

CREATE TABLE TYPE i_notification (

Matnr like MARA-MATNR) .

This is obviously not working but is there any workaround for this.

Regards,

Vivek

1 ACCEPTED SOLUTION
Read only

former_member195748
Participant
0 Likes
1,276

Hello Amol, Hello Florian,

actually I am converting ECC custom resports into HAna reports using views, but the problem that I am facing is the business Logics inside the reports,

To tackle that, I am planning to convert the ABAP Code into SQL code and using the views and sql code I may be able to achieve the business logic.

Is my approach correct , or is there any easy way of doing it as suggested by Florian- ABAP managed Procedure, I am not sure.If you have information on this kindly help me.

Vivek

9 REPLIES 9
Read only

pfefferf
Active Contributor
0 Likes
1,276

Hello Vivek,

the usage of ABAP Data Types (like data elements, structured, table types) is not possible in HANA native artifacts like stored procedures or structured types. In that artifacts primitive types and structured types can be used like described in the documentation (e.g. CREATE TYPE - SAP HANA SQL and System Views Reference - SAP Library or CDS Structured Type Definition - SAP HANA Developer Guide for SAP HANA Studio - SAP Library).

In relation to stored procedures you can use ABAP types in the interface definition of ABAP Managed Database procedures. This is possible because these objects are ABAP managed. When the stored procedures are created on the HANA database (when executed the first time) the ABAP types are converted to the according HANA types.

Best Regards,

Florian

Read only

amol_samte
Contributor
0 Likes
1,276

Hi Vivek,

You can not define any ABAP data types inside procedure.

Can you tell us what is ur requirement.


-Amol S

Read only

former_member195748
Participant
0 Likes
1,277

Hello Amol, Hello Florian,

actually I am converting ECC custom resports into HAna reports using views, but the problem that I am facing is the business Logics inside the reports,

To tackle that, I am planning to convert the ABAP Code into SQL code and using the views and sql code I may be able to achieve the business logic.

Is my approach correct , or is there any easy way of doing it as suggested by Florian- ABAP managed Procedure, I am not sure.If you have information on this kindly help me.

Vivek

Read only

0 Likes
1,276

Hello Vivek,

1. For converting ECC reports into HANA you are creating SQL script that is right approach.

If you wish to consume these views on ABAP layer you need to create external view either ADBC otherwise SQL script view is sufficient.

2. if you want to push you script into HANA layer then AMDP is useful.

One question from my side : After creation of views, where these are consumed? ABAP layer? BO? etc....

-Amol S

Read only

0 Likes
1,276

Hello Amol,

1) the users will access reports through bobj explorer tool

2) the plan is to scrap the ECC reports hence, code optimisation or consuming views in abap is not an option.

Hence somehow i need to convert these reports to HANA.

Tge biggest challenge is to convert the buisness logic into SQL, moreover how to use function module here in sql. Its not possible to recreate the function module here in HANA STUDIO procedures.

questions:

A)does it means that there is a limitation what views can do

b) is there anyway to consume abap function modules in sql.

Read only

0 Likes
1,276

Hello Vivek,

Since past 2 years we are working on same kind of scenarios.

1. You must have to convert report logic into SQL, there is no sach a option available to consume existing FM or any other abap functions in SQL.

2. For FM - you need to decode the logic of FM and built data modle/Procedure in SQL.

In our complex report cases.

1. We have created AMDP data modle called inside RFC ZFM and applied data processing logic in ABAP layer and given RFC ZFM to BO team.

-Amol S

Read only

0 Likes
1,276

Hello Amol,

Got it,

Secondly,( correct me if I am wrong, dont have much idea about AMDP). as you suggested AMDP, i dont think that will be possible as ECC reports will be scrapped , so no scenario of AMDP.

Read only

0 Likes
1,276

Hello Vivek,

Please elaborate.

I didnt get you.

-Amol S

Read only

0 Likes
1,276

Thanks Amol,

I realized there is no way I can consume the ABAP code in views, hence I need to recreate the complete logic in SQL.

thanks .