05-27-2011 11:56 AM
Hi,
I was extensively searching SDN and did not get any suitable answers, so I'm posting. Maybe I'm sure what keywords to use. This is my requirement:
I want to create a hierarchical list display.
One header and one item. However I want to change the layout programmatically, so that the header is grouped according to various fields in 4 lines. I created a simple hierarchical list display and manually changed the layout on the screen (using change layout button). I can choose maximum upto 3 header lines, hence grouping is possible upto 3 levels.
Unfortunately my requirement is to group upto 4 levels. Also my last level should contain the fields including key fields (but layout is not allowing me to move the key field to the 3rd line).
Current output:
Header: Shipmentdocno(this is key field) ShipmentType Route Carrier ShippingPoint Description Destination
Item: Shipmentdocno Delivery Customer Name1
Required output:
Header:
Line 1: Carrier
Line 2: Route
Line3: ShippingPoint
Line4: Shipmentdocno(key field) ShipmentType Description Destination
Item: Shipmentdocno Delivery Customer Name1
Note: ALV tree also does not serve my purpose as there is no provision to display both header and item text on top, with data below.
This is basically a grouping requirement and needs to be visually grouped in separate lines at header level.
05-27-2011 12:17 PM
Hi.,
In REUSE_ALV_HIERSEQ_LIST_DISPLAY did you checked it_special_groups parameter " for grouping Columns.,
this may server your requirement., I may be wrong. wait for Experts reply..
Thanks & Regards,
Kiran
05-27-2011 2:12 PM
Yes i checked special groups too.. it does not serve my purpose.
thre is a sample screenshot given to us but it is the result of a SAP query, they want the grouping like this in the hierarchical output as well. any ideas?? LINK to screenshot: [Hier_query|http://postimage.org/image/48bi2nok/] (data blurred for privacy)
05-28-2011 6:51 PM
Hi abapfreak,
I've made some tests, and if you populate the row number in the field catalog, you are able to get 4 or more lines on the header. I've even debugged the function module REUSEHIERSEQDISPLAY (sorry, I have no SAP right now, so I can't tell the full name of the FM ), and the popup which allows you to show/hide columns has up to 9 tabs, one for each row... but unfortunately I was not able to activate all of them.
So: you may begin your list with more than 4 header rows (if you populate the field catalog properly), but as soon as you want to change the layout, you may lose that info...
...at least this is what I've found out...
Kind regards,
Alvaro
06-07-2011 11:31 AM
Solved it by grouping at header level using the sorting internal table it_sort. by giving it_sort-group = '*' and by populating top_of_page in events.