Claus_Jambrich_5663

Getting Version Objects for an object

Discussion created by Claus_Jambrich_5663 on Dec 19, 2017
A customer asked how to list version objects and the main object that belongs to them. Here is a select:
SELECT
    oh1.oh_client AS "Client"
  , oh2.oh_name AS "Main object"
  , oh1.oh_refidnr AS "Main object OH_Idnr"
  , oh1.oh_name AS "Version Object"
  , oh1.OH_Idnr AS "Version Object OH_Idnr"
FROM
    oh oh1,
    oh oh2
WHERE
    oh1.oh_deleteflag = 2
    AND   oh1.oh_refidnr = oh2.oh_idnr
ORDER BY
    oh2.oh_name
  , oh1.OH_Idnr;
It gives all Version objects (OH_Deleteflag = 2) and the according main object including client and the OH_Idnrs.

Outcomes