cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Graphical Calculated View HANA with data selection conditions.

pamarque
Participant
0 Kudos
789

Hi guys,

I have a requirement in which I have to get the data from the purchase documents of the ACDOCA and BKPF, for each document class (BLART field) according to these conditions of this selection.

Document class: A

ACDOCA-BELNR = BKPF-BELNR = 0014 * (ACDOCA-BLART = 'C4', 'C5' and 'C0') + 0020 * (ACDOCA-BLART = 'C9', 'CR') BKPF-GRPID = "CARGOSPROV"; "REGA *"; REST ACDOCA-USNAM = BKPF-USNAM = In SET of users Z_USER_PMYC ACDOCA-RLDNR = '0L'

Document class: B

ACDOCA-BELNR = BKPF-BELNR = 0043 * + 0048 * ACDOCA-BLART = '12' AND '75' ACDOCA-LIFNR = 33156 ACDOCA-SGTXT = "Price Rev." and band 0032 ((BKPF-BLART = '10')) ACDOCA-RLDNR = '0L'

Document class: C

ACDOCA-BLART = BKPF-BLART = 14, 15, 64 y 65.

BKPF-GRPID(4) <> “ATTR”

ACDOCA-RLDNR = ‘0L’

Document class: D

ACDOCA-BLART = BKPF-BLART = FK Y KF

ACDOCA-EBELN = 45*

ACDOCA-RLDNR = ‘0L’

How can I archive this selection of data using graphical calculated views. It would be possible by creating a calculated view for each document class, and applying the specific selection conditions of each document class in the filter expression area, and then joining all the calculated views to create a single view with a UNION. Could you also guide me what sql code is the one that I have to implement to make the filtering conditions?

BR,

Patricia.

Accepted Solutions (0)

Answers (1)

Answers (1)

DotEiserman
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Patricia,

If you want to achieve this in a graphical calculation view, then you could drag each table in as a projection node and then right-click on the columns you want to filter and select your filter values, these filtered projections can then be pulled together into a union node. Note: You can pull in the same table multiple times if you want to do different complex filtering.

This bit where you've put "BKPF-USNAM = In SET of users Z_USER_PMYC" you could do by applying a join between table BKPF and table Z_USER_PMYC.

Another way completely would be to write this in SQL inside a table function object, and then adding that into your graphical calculation view. I suggest you give it a try and then let us know if you get stuck.

Thanks

Dot

pamarque
Participant

Hi Dot Eiserman,

In the end I managed to solve it by creating a calculated view of the SQL type. Thanks anyway for the answer and the help.

BR,

Patricia.

DotEiserman
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Patricia,

Glad you came right, if you used a scripted-based calculation view then I would recommend that you convert it to a table function version one, it is much more flexible and reusable:

https://help.sap.com/viewer/fc5ace7a367c434190a8047881f92ed8/2.0.05/en-US/ecea9eb791954a6dbed4942148...

Thanks Dot 🙂