cancel
Showing results for 
Search instead for 
Did you mean: 

concatenate hrpad23 fields to validate with dbtablog abap 7.4

JuanLeiva1986
Newcomer
0 Kudos
95

I am new to working with SAP Hana and I have not been able to solve the following problem:

I need to obtain the data from the hrpad23 table but only those that are in the dbtablog table. The problem is that to connect both tables I need to CONCATENATE the fields HRPAD23~MANDT and HRPAD23~ADATANR to compare it with the DBTABLOG~LOGKEY field, the limitations of the version abap with opensql does not allow me to CONCATENATE  in the sql statement (select)
I need help to be able to carry out this process in some way.

attentive to your comments.

Thank you

Juan Leiva

View Entire Topic
Romanos
Explorer
0 Kudos

Hello,

You can use Open SQL string functions without concatenation, that can suit your needs. For example

  SELECT
    h~mandt,
    h~adatanr
  FROM hrpad23 AS h
  INNER JOIN dbtablog AS d
  ON
     left( d~logkey, 3  ) = @SY-mandt AND
     h~adatanr = substring( d~logkey, 4, 10 )
  INTO TABLE @DATA(lt_temp).

Another possibility is to use Native SQL, AMDP'S or ADBC so you can execute a more complicated query with HANA Native SQL.
Lastly it is also possible to just fetch the data in internal tables and use logic in ABAP to keep the records you want.