cancel
Showing results for 
Search instead for 
Did you mean: 

Can we use Lookup in SAP HANA

former_member182277
Contributor
0 Kudos

Hello All,

Can we use Lookup in SAP HANA?

Regards,neha

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

If you are building a analytical view on BSEG, and you need some information (caracateristics - NOT measures) from BKPF, you add BKPF to your calculation view and link BSEG and BKPF properly. Then you make the BKPF caracteristics you want available as attributes/dimentions. When you report, you'll see for each BSEG record all the BKPF info you need.

Notice that you cannot have measures coming from two tables. If you want in a same report measures from BKPF and BSEG, you need to go to Calc Vies.

former_member184768
Active Contributor
0 Kudos

What exactly do you need to do ? Look up to find existence of a value or to derive some attributes.

Both the cases are possible in HANA. I think may be, I didn't understand your question correctly.

Ravi

former_member182277
Contributor
0 Kudos

Hello Ravi,

Suppose I am having the table BSEG and I want to execute lookup for BKPF table that all the enteries present in the BKPF with lookup to BSEG will disply.

How can i achieve the same?

regards,Neha

former_member184768
Active Contributor
0 Kudos

Do you mean like "Inner Join" or " WHERE EXSITS" type scenario. I am confused because it cannot be such a simple question coming from you :-). I think I am still missing something.

Ravi

former_member182277
Contributor
0 Kudos

Hello Ravi,

We are using vlookup in excel. Same can we achieve in the HANA also.

Hope now it clears to you what exactly my question is?

Regards,neha

former_member184768
Active Contributor
0 Kudos

VLOOKUP in Excel is just like outer Join so you can use it anyway in HANA. If you are using a Query then you can use "EXISTS" predicate with the subquery on BKPF.

Ravi

former_member182277
Contributor
0 Kudos

Could you please give provide me the code for the same? how you are using the same?

Neha

former_member184768
Active Contributor
0 Kudos

select * from HANA."/BIC/PSTORE" a

where EXISTS (select "/BIC/STORE" from HANA."/BIC/TSTORE" b where "/BIC/STORE" = a."/BIC/STORE" )

The lookup condition can be specified in the subquery where clause

Ravi

former_member182277
Contributor
0 Kudos

Thanks Ravi,

But i need to use the same in the calculation view using script so how can i use the same? I am not able to use the same.

Regards,neha

former_member184768
Active Contributor
0 Kudos

The query is similar to any other query you can use in calculation view. Alternatively you can also use Left outer join. It provides the same result. Actually EXISTS provides INNER join functionality.

But I think you need outer join condition.

Ravi

rama_shankar3
Active Contributor
0 Kudos

Neha:

Try this syntax in the calculation view:  for testing purpose put some filters in your analytical views if you created to limit the no.of rows:

Out =

SELECT field1, field2, field3 from “TAB1”

INNER JOIN

“TAB2”

WHERE

“TAB1”.”KEY1” = “TAB2”.”KEY1”

AND ….

Rama