on 2021 Oct 08 2:24 PM
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.
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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:
Thanks Dot 🙂
| User | Count |
|---|---|
| 18 | |
| 7 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.