cancel
Showing results for 
Search instead for 
Did you mean: 

Any chance of using regular expression?

andre_kster
Explorer
0 Kudos

Hi there,

I'm facing some problems with having to dissect a string (it contains adresses) into its componenents. This should be feasible by using appropriate regular expressions, but I don't see any way to use them in HANA.

Did I miss something, or is it just not possible?

As an alternative I am currently considering to do the split in ABAP using a secondary DB connection to read and write in HANA, but I do not really like this idea. This seems to be a somewhat clumsy approach and will be very time consuming as I need to process several million recors.

Any ideas or help?

Regards

Andre

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

Hello Andre,

at the moment there is no RegEx support build into HANA, but I guess it will be added sooner or later.

Meanwhile I see two additional options that might be feasible:

- if you need to perform the transformation as part of a data loading process, why don't you do it with BO Data Services?

- if the transformation needs to be done on the fly a SQL script procedure might be the right thing for you.

regards,

Lars

former_member182779
Active Contributor
0 Kudos

at the moment there is no RegEx support build into HANA, but I guess it will be added sooner or later.

I hope so...life is sweeter with Regular Expressions -:)

Greetings,

Blag.

Former Member
0 Kudos

Its been a while since this post has been replied to, so I was wondering if regular expressions have been added to your knowledge at this point in time?

Answers (2)

Answers (2)

Former Member
0 Kudos

You may want to consider R Language for Regular Expressions in SAP HANA.

http://help.sap.com/hana/SAP_HANA_R_Integration_Guide_en.pdf

Regular Expressions with grep, regexp and sub in the R Language

Regards,

itsvtk

andre_kster
Explorer
0 Kudos

I went for an ABAP solution, I'm creating an additional table in the ABAP system to hold the addresses and will drop the source column from the original table when I'm done.

In case your interested, my code to extraxt postal code and city (the country was determined and stripped from the string earlier)


    if ms_address-country = 'DE'.
*-Finde den Beginn der PLZ inkl. umschliessender Whitespaces
      find first occurrence of
        regex 'sd{5}s'
        in mv_string
        match offset lv_offset.

      if sy-subrc = 0.
        add 1 to lv_offset.
        ms_address-post_code = mv_string+lv_offset(5).
        lv_city = lv_offset + 6.
        ms_address-city = mv_string+lv_city.
      endif.
endif.

Edited by: Andre Köster on Jan 26, 2012 12:51 PM