09-05-2010 1:33 PM
Hi ABAP Gurus,
I'am doing report to read cluster results
My requirement is :
The report uses LDB -PNP in the selection screen in addition to that Clusterid is passed and what ever cluster id we select for the pernr that cluSter id results has to show in the report output
The report has to dynamically change in the output (whole structure of the cluster id) how to pass in selected cluster id (what we selected in the selection screen) in the function module
LVC_FIELDCATALOG_MERGE
Importing
I_STRUCTURE_NAME - (HERE I WANT TO GET THE STRUCTURE OF THE SELECTED CLUSTER ID IN THE SELECTION SCREEN)
Thanks and Regards,
Deepthi.
09-05-2010 4:03 PM
Hello Pavan,
Whenever dynamic internal tables need to be displayed in an ALV think SALV classes.
You don't have to explicitly define the fieldcatalog when calling the factory method.
Search in SDN there are plenty of threads on similar requirement.
BR,
Suhas
09-06-2010 10:52 AM
Recently I have been working on generic cluster access and I must say the task was challenging. What I've discovered is:
- generic access as per cluster ID is impossible via [IMPORT ... FROM DATABASE...|http://help.sap.com/abapdocu_70/en/ABAPIMPORT_SHORTREF.htm] -> in order to create a fully flexible access you would have to go for pure dynamic program generation by means of [GENERATE SUBROUTINE POOL|http://help.sap.com/abapdocu_70/en/ABAPGENERATE_SHORTREF.htm]
- as there are houndreds of available cluster IDs it is very difficult to determine those relevant to particular employee. For just one table PCL2 there are multiple of unknown to me areas which are hard to distinguish from those (un)relevant to employee. First look at fixed values from domain RELID_PCL2 gives the feeling what we are struggling with.
- focusing on all common clusters (only from PCL2) like CU, RX, ZL, B2, PS, PT can narrow the search result but still is a lot to be handled by one program
- eventually looking deeper only on RX and possibly B2 areas seemed to be the best choice (as mostly we use only those - at least I do). So I focused on this area as generic payroll result can be easily extracted. What I needed was extracting relid for given EE molga, then py result type for this relid, the simply using FM PYXX_READ_PAYROLL_RESULT to access py results itself for given cluster directory entry (table hrpy_rgdir )
- the final challenge was how to show the results in user friendly form. As the result table I had was not only nested but deep too it wasn't so obvious. Luckily to me I was using Web Dynpro which allows to create table popins (showing the table within the table) but I don't think there is corresponding GUI control in SAP GUI. So considering how you want to show this data is really not an easy thing to do.
- As for the structure of payroll result itself (or rather structure of each of its components) can be delivered using RTTI but you will also sweat a bit before getting that done.
To conclude. There is no easy way of accessing clusters by just giving its RELID Even though you would focus on some specific part, it will take you more time then you expect at the beggining. So I would try to suppress the tempation for a moment and consider all these discussed (and those which I didn't think of) aspects.
Regards
Marcin
09-07-2010 7:47 AM
Hi Pavan,
I see your requirement is to get the dynamic cluster structure which basically depends on the cluster id. What u can do is create the structure during the run time based on the cluster id.. Using the statements
FIELD-SYMBOLS: <fs_table> TYPE ANY TABLE.
DATA: gt_final TYPE REF TO data.
assign the name of the structure to p_table...based on cluster ID then..
CREATE DATA gt_final TYPE STANDARD TABLE OF (p_table).
Regards
Pavan