Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically ALV Titles Using Events - How To

Former Member
0 Kudos

Dear All,

There is a selection screen. Depending upon the selection, there will be output in ALV grid or list. This output doesn't contain any field of selection.

So the output must be grouped on the basis of selection as their common title.

Eg. If model and type are in selection screen then output something like

Model No. 1 Type No. 2

ALV Grid for Model 1 and Type 2

Model No. 3 Type No. 4

ALV Grid for Model 3 and Type 4

-


-


How to use ALV Events to process the data dynamically for the titles as in above case the numbers 1, 2 ,3 & 4 are present in the output table which is passed to ALV for display.

Thanks & Regards,

Sapna Modi.

1 REPLY 1

ssimsekler
Active Contributor
0 Kudos

Hi Sapna

To set title you can fill a structure of type <b>"LVC_S_LAYO"</b> (the field gridtitle) and use the method <b>"set_frontend_layout"</b>. You can get the current layout structure using the method <b>"get_frontend_layout"</b>.

To set column headers you can use to get and set the fieldcatalog at any instance of the runtime. For this you can use <b>"set_frontend_fieldcatalog"</b> and <b>"get_frontend_fieldcatalog"</b>. At the field catalog, you can set titles for columns using <i>"coltext", "scrtext_s", "scrtext_m", "scrtext_t"</i> .

For more information you can refer to the tutorial <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an%20easy%20reference%20for%20alv%20grid%20control.pdf">"An Easy Reference For ALV Grid Control"</a>.

*--Serdar

ssimsekler@yahoo.com