2012 Oct 11 6:56 PM
Hello experts,
I would like to create a view based on a join between two tables.
I would like to take for a Date field, only the most recent date found in the data.
How can I perform it.
Thanks.
Amine
2012 Oct 11 8:23 PM
The ans to this thread might help you :
http://scn.sap.com/thread/2057528
Or check this document out :
hope this helps
Good luck
Hello experts,
I would like to create a view based on a join between two tables.
I would like to take for a Date field, only the most recent date found in the data.
How can I perform it.
Thanks.
Amine
2012 Oct 11 8:23 PM
The ans to this thread might help you :
http://scn.sap.com/thread/2057528
Or check this document out :
hope this helps
Good luck
2012 Oct 12 6:26 AM
Hi amine,
You can create database view that use the inner join. You can create database view from SE11->View->Create->database view and then provide tables in table tab and there you can give join condition between table. IN view field tab you can provide fields that you want.
I hope this will help in case of any doubt reply back.
Thanks,
Ashish Trivedi
2012 Oct 12 9:02 AM
Hi Ashish and Amarpreet,
Thanks for both of you for your answers.
But what I need to know is how to select the most recent date in my records while creating my view. I give you an example:
Let's say that my view contains 3 records with the same keys:
Reference | Client | material | date | quantity |
1 | ABC | MaterialA | 01.01.2012 | 3 |
1 | ABC | MaterialA | 02.01.2012 | 4 |
1 | ABC | MaterialA | 03.01.2012 | 1 |
So as you can see. The most recent date is 03.01.2012 (03 Jan 2012)
Is only this record that i need to take in account in my view.
Thanks for your help.
Amine
2012 Oct 12 9:45 AM
Hi Amine,
As for as i think this would not be possible at the time of defining view as in the selection criteria tab we cant put such condition. So it would be better to apply a condition while selectiing data from view in your query, for example:
Select material quantity from view where (condition to select latest date).
However you can give some filtering criteria on selection tab of DB view:
table | field | operator | quantity |
Tab A | DATE | >= or <= or = or any operator | here you can enter constant for compare, means any date; here if we provide text literal it gives error. |
Regards,
Ashish
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |