Hello John,
as you can see under the link provided by Andy the OSA data model consists of a lot of tables. You cannot directly access most of these tables with transactions like SE16 or SE11 as the table settings prevent the display. Solution here is report RHHAP_DISPLAY_DB. The data model is very generic / flexible and therefore difficult to report directly. So it is recommended to use service functions which resolve the complex table relations to access the data of OSA documents.
While the service functions solve parts of the complexity issues you remain with the question of performance. To read the data of an OSA document can easily take 0.5 seconds each. So if you want to have a report which can be processed in dialog and is reporting more than a hand full of questionnaires you will run into performance problems.
Solution -> use a buffer table which contains the data of your questionnaire in a plain structure which can be reported quickly on the fly.
Creating a report based on a simple table is probably not an issue for you so I will only describe how you can fill this table.
We have different options to do this. If you are more from the OSA area you would usually create an implementation of the OSA follow up BAdI (HRHAP00_FOLLOW_UP) which is processed in background if an OSA document is completed. In this implementation you would use a function module like HRHAP_DOCUMENT_GET_DETAIL to get the questionnaire content and put it into the buffer table. To get the implementation running you would need to make it available in the OSA configuration by adding it first to OOHAP_BASIC and then add it to category (group) and last to the OSA template (VA object) of the questionnaire itself in PHAP_CATALOG. Issue here would be that you can only apply changes to the OSA template if it is not released so you might need to retake the status. But this is usually no problem for an OSA developer as they have the required SAP help report. Drawback of this approach is that it is not expected by SAP to change the eRec questionnaire OSA templates using PHAP_CATALOG. So you might encounter issues with consistency checks. I am also not fully sure that you won't lose your changes when you touch the questionnaire again with the eRec tools. Some things eRec does are not aligned with the OSA standards. E.g. in eRec you create questions which are technically VB objects and link them to questionnaires which are technically VA objects later. In OSA you cannot have a VB w/o VA so eRec does some tricks with a temporary VA.
As eRec developer you would go a different way which is not touching the questionnaire definition. To run the buffer table update synchronous you can define a workflow linked to the ACTIVITYCOMPLETED event of ERC_ACTIV. The workflow start would be restricted to the correct questionnaire activity type. The workflow would consist of a single step either a workflow activity based on a customer task or a container operation calling a static method of a class. In the step you would use the methods GET_DOCUMENT_DETAILS or GET_DOCUMET_DETAILS_WITH_TEXT of class CL_HRRCF_QA_BL to get the questionnaire content, transform it and put it into the buffer table. Of course you would in advance check the activity record if it is the required questionnaire (QA_TPL_OBJID) and the questionnaire was actually filled (QA_DOC_GUID is not initial). PHAP_CATALOG would only be used to get information about the technical structure and Ids of the OSA template elements.
If it is not necessary to run the update synchronous you could of course also create a report you plan as a job which is doing the same for all HRP5141 records based on their attributes and last changed timestamp.
I hope this helps you implementing your requirement.
Kind Regards
Roman