cancel
Showing results for 
Search instead for 
Did you mean: 

SAP HANA Expert Script

ccc_ccc
Active Contributor
0 Kudos

Hi Experts,

Before posting this question, I spent lot of time on google and SCN portals, however I didn't find any suitable document/hint hence posting this question.

Could you please let me know how to write Expert Script in BW (HANA DB) transformation.

Please provide any sample code.

Thank you,

Nanda

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nanda,

   Check the process below to create HANA expert routine.

The HANA expert routine can be written via HANA studio for that the prerequisite is ABAP Development Tool KIT(ADT) should be installed in your HANA studio.

Create Transformation and edit the same

EDit-->Routine--> SAP HANA Expert Script

Then Copy the Class/Interface name

Now go to HANA studio Open the ABAP perspective

navigate-->  Open ABAP Development Object   

Then paste the Class or interface name

Now you can start writing your expert routine. As in our ABAP expert routine all the source and Target fields will be accessible and you can start manipulating those values.

In my above example I have mapped the source fields to target filed directly.

I hope this answers your query.

Thanks & Regards

  A.Dinesh

ccc_ccc
Active Contributor
0 Kudos

Hi Dinesh,

Thank you so much for quick response.

I went through the procedure however still I have few questions. Could you please try to answer the following.

1 Can we write code in SAP BW editor(when double lick on "SAP HANA Script processing" ) as you shown in first image or do we need ABAP Development Tool KIT(ADT) compulsory because we are are working on SAP BW HANA database.

2 How to get Class/Interface name

Regards,

Nanda

Former Member
0 Kudos

Hi Nanda,

          check the answers below:

1) In earlier release they allowed you to write the code in ABAP, but in latest release its mandatory to use   ABAP Development Tool KIT(ADT) .That's what I have mentioned in the first line of my previous post.

2) check the second screen shot of my previous post.

Thanks & Regards

  A.Dinesh

kevin_small
Active Participant
0 Kudos

Hi Nanda,

I don't know what version you are on, but as Dinesh mentioned, regarding use of earlier versions:

On BW 7.4 SP5, when you edit the HANA expert routine from within SAPGUI (not using Eclipse) you get a popup where you can enter SQLScript directly.  Screenshots is like below, you edit the SQLScript in the lower half of the screen:


Regards,

Kevin.

ccc_ccc
Active Contributor
0 Kudos

Hi Kavin,

Thanks you for reply.

We are also using same version what you said.

Could you please share me the document which describes about commands like LOOP , IF etcc. and syntax how to write expert script.

Thank you,

Nanda

Former Member
0 Kudos
ccc_ccc
Active Contributor
0 Kudos

Hi Kavin,

We are also same version, written same code what you put in image.

When activating Transformation, its throwing following error.

Code: which in transformation.,

outTab = SELECT  "FISCPER", "FISCVARNT", "CURRENCY",  "CALMONTH", "RECORDMODE", "AMOUNT", FROM :inTab;

@5C@sql syntax error: incorrect syntax near "AS": line 1 col 221 (at pos 221)
@5C@
@5C@Error in substep
@5C@An exception was raised
@5C@Error during generation
@5C@Error when activating Transformation 0EHMQVP8BBN231OIZQARR58RZICX6R2X

Any clue.

Regards,

Nanda

ccc_ccc
Active Contributor
0 Kudos

Hi Dinesh,

Already i gone through this document however it didn't find any syntax how deal with intab and outtab.

Regards,

Nanda

kevin_small
Active Participant
0 Kudos

The comma just before the FROM should not be there.  The document Dinesh linked to tells you the SELECT syntax.

Former Member
0 Kudos

Hi Nanda,

            This expert script is like a stored procedure. Access all the source data from inTab and do all data manipulation and assign it to outTab.  There is no specific document available  to show case how to write Expert script because its as simple as writing the stored procedure. We all should come little bit out of ABAP world and should learn to write stored procedure. Thanks & Regards A.Dinesh

ccc_ccc
Active Contributor
0 Kudos

Ok, Thank you all for helping me.

Regards,

Nanda

Former Member
0 Kudos

Hi Nanda,

   Can you mark this question as answered and close the thread.

Thanks & Regards

   A.DInesh

Former Member
0 Kudos

Hello Dinesh,

when i trying edit section METHOD PROCEDURE and END METHOD in ABAP expert routine, I get a message «Carry out repairs in non-original system only if they are urgent»:

and after that next message about the need to register object and enter the access key:

Did you encounter similar? If yes, how to solve this problem?

P.S. Our system is SAP BW on HANA 7.4 SP8

roland_szajko
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Dimitry

Beside the note suggested by Silvio i would suggest to apply all notes from this page:

HANA Transformations - Known problems and fixes - SAP NetWeaver Business Warehouse - SCN Wiki

Those notes are essential, so the HANA processing framework is up to date.

br

Roland

Former Member
0 Kudos

Hi Kevin,

Can you assist me with how to edit the HANA expert routine from within SAPGUI (not using Eclipse)?

Thanks and regards

Maunank

0 Kudos

Hi Dinesh,

thanks for pasting the pictures of your script, it is great,

can you give us an example if we need to do  if "EC_.."  = .. then ... end if;

I'm trying to modify the value of inTab before posting it in outTab, it doesn't work, I'm sure I miss something

another question: can we work with temporary table before updating outTab ?

Thx

Answers (2)

Answers (2)

former_member182537
Active Participant
0 Kudos

hi Guys,

Any idea if HANA SQL script can support deletion of certain data from source package?

thanks

0 Kudos

Hi Nilesh

You can perform your request with select and the where clause, by this way you're sure to retrieve the only needed row from inTab

ccc_ccc
Active Contributor
0 Kudos

Hi Dinesh/Kevin,

Both of you assigned points.

Regards,

Nanda

Former Member
0 Kudos

Hi Dmitry Zakurakin,

        Contact your basis guy he should be able to register and provide you an access key.

Thanks & Regards

   A.Dinesh

Former Member
0 Kudos

We already have developer key.  In this case system require access key for every new procedure created with "SAP HANA expert script" command in SAP GUI menu of transformation. It is look like a bug. We already have an application to support. But to find a workaround would be great. Thank you.

Former Member
0 Kudos

Hi Dmitry,

Thats an error mentioned in SAP Note 2082585

Apply them and everything will be fine.

Greets