A Database View is a subset of the database sorted and displayed in a particular way. For example, in an Invoice database, perhaps you only wish to display the Vendors stored in the database.
EnterpriseOne Views are similar in nature, where it sits on top on JD Edwards Tables, to retrieve data, or a subset of data.
With Business Views, we can join tables using Left outer, Right outer, Union, Intersect joins. One can usually join up to 5 tables in a Business View if using Simple joins. If one uses a Complex join, then number of tables is limited to 3.
What if you need to use more than 5 tables? What if you need to do some complex joins? And What if you need a column which would give you a Count of records for the group?
For e.g. if you have a need to display the number of items on Open orders and quantities shipped, with the order details, you may have to do the following SQL
SELECT sddoco, sdkcoo, sddcto, count(*), sum(sduopn)
FROM F0411
WHERE sdnxtr <=540
GROUP BY sddoco,sdkcoo,sddcto
To accomplish this in current JD Edwards EnterpriseOne Reporting, you will need to do a little more programming.
We can do this easily via Database Views. We can trick the EnterpriseOne software to use the Database views as E1 tables.
We will need to do the following steps.
- Create a Data base view on the above Select query with name FD550411 (use a different naming convention so that they stand out as Database Views)
CREATE VIEW TESTDTA.FD554211 (dddoco, ddkcoo, dddcto, ddcnt, dduopn )
AS (SELECT (sddoco, sdkcoo, sddcto, count(*), sum(sduopn))
FROM F4211
WHERE sdnxtr <=540
GROUP BY sddoco,sdkcoo,sddcto)- Grant privileges on the View to the EnterpriseOne User id for the database, like
Grant ALL on TESTDTA.FD554211 to PUBLIC; - Now, create an EnterpriseOne table with the same name = FD554211, and using the table Prefix = DD (as used in the Database View)
- Add the columns in the same order as in the view (created above) –
- DOCO
- KCOO
- DCTO
- CNT
- UOPN
- Save and close the Table Design Aid (TDA)
- Add the columns in the same order as in the view (created above) –
- Do NOT Generate the Table.
- Now, you can see the Data coming up in UTB for FD554211.
- Once done, you have your E1 Table ready on top of the Database View.
- You can create E1 Business Views on this E1 Table, and create/use UBE’s, Reports, Application via the Business View.
Only Con’s of this approach is that you cannot Insert or Update or Delete records in the Database.
Now, incase you are still not able to view/see the Database View in UTB or JDE, do the following
- Create the Table First in JDE.
- Generate it in JDE. Now you have a physical table in Database
- Drop the table from the database –
DROP TABLE TESTDTA.FD554211; - Now, you will be able to create your View as given above.
- Grant all privileges to the View.
- This time you should be able to view it in JDE.
Know more at MOS: [ID 640352.1]
Hi Deepesh,
Thats really useful..But can we create such data base views for versions above XE.
Very much. We are doing the same at the current location. Helps a lot with complex joins, and even performance.
Its about how we trick E1 to use the DB View as an E1 table.
Thats great. Would try using them.
You can still do DML operation on the database view by creating an instead of trigger for this view. Of course that is too much database coding 🙂
This works smoothly on JDE9.0 demo SSE and assume shall work in all versions.
Thnx for sharing this bit of information
Hurray! It works! I had to join 6 tables and this was the saviour.. Thank u! Worked for E9 Oracle DB
Do you know if this solution will work if your db backend is an as400 db2?
Thanks Deepesh for the detailed explanation !!