Shared Top Border

Enterprise Resource
Planning Portal

 

Advertise | Founder BLOG

ERPGenie.COM ABAP Tips and Tricks Database

THE ultimate
ERP website

 

Forums | Vote for us |

Google    Other Search Options

Home arrow Tips and Tricks arrow Control Objects arrow Creating an ALV Grid in 3 lines
Creating an ALV Grid in 3 lines PDF Print E-mail
User Rating: / 4
PoorBest 
Written by Dany Charbonneau   
Tuesday, 15 May 2007
Did you know that you can create an ALV Grid very fast; you don't need to define a layout, a fieldcatalog, a container and all the other small things we usually define in an ALV Grid. If we don't need to finetune the ALV Grid and just want to display a list on the screen or to the printer, here is a very simple way to proceed:
Code:
DATA: l_alv TYPE REF TO cl_gui_alv_grid,
lt_sflight TYPE TABLE OF sflight.

SELECT * FROM sflight INTO TABLE lt_sflight.

* Creation of the ALV object, when we use cl_gui_container=>screen0 as parent, the ALVGrid control will
* automatically use the full screen to display the grid, NO CONTAINER DEFINITION IS REQUIRED !
CREATE OBJECT l_alv EXPORTING i_parent = cl_gui_container=>screen0.

* calling the display of the grid, the system will automatically create the fieldcatalog based
* on the table name you pass in parameter
CALL METHOD l_alv->set_table_for_first_display
EXPORTING i_structure_name = 'SFLIGHT'
CHANGING it_outtab = lt_sflight.

* You have to create an EMPTY screen, put NOTHING in the layout and this is going to work
CALL SCREEN 100.
Instead of creating an empty screen 100, you can also define an empty selection screen in you program and use it, no more screen painter required !

Code:
SELECTION-SCREEN BEGIN OF SCREEN 1001.
SELECTION-SCREEN END OF SCREEN 1001.
CALL SELECTION-SCREEN 1001.

Related Items:

 
< Prev

Google Search

Google Ads

Shared Bottom Border

Contact Us | Polls | Add URL | Contribute | Privacy | Terms | Feedback

Discussion Forum | BLOG | Consultants: Post your resume | Companies: Advertise on ERPGenie.COM | Post Job
Financials Consultant | Consultant Review | Gallia Consulting | Supply Chain Project | SAP Financials Forum
GenieHoldings.COM, Inc. | Genie Press | WorkflowGenie | ESAGenie | ERPTopSites | ABAP Tips and Tricks | SAP Solutions Database

EDIGenie | Searching Survivor