SlideShare a Scribd company logo
REPORT zgs_simple_alv.
DATA : it_mara TYPE TABLE OF mara.
DATA : container TYPE REF TO cl_gui_custom_container,
grid TYPE REF TO cl_gui_alv_grid.
SELECT * FROM mara INTO TABLE it_mara UP TO 10 ROWS.
CREATE OBJECT container
EXPORTING
* PARENT =
container_name = 'CONTAINER'
* STYLE =
* LIFETIME = lifetime_default
* REPID =
* DYNNR =
* NO_AUTODEF_PROGID_DYNNR =
* EXCEPTIONS
* CNTL_ERROR = 1
* CNTL_SYSTEM_ERROR = 2
* CREATE_ERROR = 3
* LIFETIME_ERROR = 4
* LIFETIME_DYNPRO_DYNPRO_LINK = 5
* others = 6
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT grid
EXPORTING
* I_SHELLSTYLE = 0
* I_LIFETIME =
i_parent = container
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
* I_FCAT_COMPLETE = SPACE
* EXCEPTIONS
* ERROR_CNTL_CREATE = 1
* ERROR_CNTL_INIT = 2
* ERROR_CNTL_LINK = 3
* ERROR_DP_CREATE = 4
* others = 5
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD grid->set_table_for_first_display
EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
i_structure_name = 'MARA'
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
* IS_LAYOUT =
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
* IR_SALV_ADAPTER =
CHANGING
it_outtab = it_mara
* IT_FIELDCATALOG =
* IT_SORT =
* IT_FILTER =
* EXCEPTIONS
* INVALID_PARAMETER_COMBINATION = 1
* PROGRAM_ERROR = 2
* TOO_MANY_LINES = 3
* others = 4
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL SCREEN 100.
http://www.erpgenie.com/abap/controls/alvgrid.htm
Go to the following link which gives you sample codes with brief description of
the programs.
OOALV
Then coming to steps for creation of ALV in OOABAP.
1. Create a program in se38 and just activate it without any code for now.
2. Go to module pool and create a screen, put a custom container control on to
the screen. (You will find this control on right side tool box).
3. Give a name to the control created in step 2.
4. Activate the screen.
5. Come to the program declare two variables to hold instances of 2 classes
CL_GUI_CUSTOM_CONTAINER, CL_GUI_ALV_GRID.
6. create an instance of the class CL_GUI_CUSTOM_CONTAINER passing container
name created in step 3.
7. create an instance of the class CL_GUI_ALV_GRID passing INSTANCE VARIBALE
name created in step 6.
8. using the ref. variable of previous step call method SET_TABLE
FORFIRST_DISPLAY method and pass structure name and internal table containing
data.
9. then call screen created in step 2.
Hey... execute the program . You are there with your OOALV.

More Related Content

Viewers also liked

الطريق المنير إلى قراءة ابن كثير بروايتي البزي وقنبل من طريقي الشاطبية والطيبة
الطريق المنير إلى قراءة ابن كثير بروايتي البزي وقنبل من طريقي الشاطبية والطيبةالطريق المنير إلى قراءة ابن كثير بروايتي البزي وقنبل من طريقي الشاطبية والطيبة
الطريق المنير إلى قراءة ابن كثير بروايتي البزي وقنبل من طريقي الشاطبية والطيبة
قال تعالى: "كتاب أنزلناه إليك مبارك ليدبروا آياته وليتذكر أولو الألباب".
 
ESDEMC TS004 TVS Failure Level Tests Comparison Between ESD Gun, TLP & HMM
ESDEMC TS004 TVS Failure Level Tests Comparison Between ESD Gun, TLP & HMMESDEMC TS004 TVS Failure Level Tests Comparison Between ESD Gun, TLP & HMM
ESDEMC TS004 TVS Failure Level Tests Comparison Between ESD Gun, TLP & HMM
ESDEMC Technology LLC
 
Introdução ao estudo das funções
Introdução ao estudo das funçõesIntrodução ao estudo das funções
Introdução ao estudo das funções
Everton Moraes
 
As tensões na colônia
As tensões na colôniaAs tensões na colônia
As tensões na colônia
Privada
 
Slide 12
Slide 12 Slide 12
Slide 12
Gabriel Santos
 

Viewers also liked (6)

Final Power point EGR 110
Final Power point EGR 110Final Power point EGR 110
Final Power point EGR 110
 
الطريق المنير إلى قراءة ابن كثير بروايتي البزي وقنبل من طريقي الشاطبية والطيبة
الطريق المنير إلى قراءة ابن كثير بروايتي البزي وقنبل من طريقي الشاطبية والطيبةالطريق المنير إلى قراءة ابن كثير بروايتي البزي وقنبل من طريقي الشاطبية والطيبة
الطريق المنير إلى قراءة ابن كثير بروايتي البزي وقنبل من طريقي الشاطبية والطيبة
 
ESDEMC TS004 TVS Failure Level Tests Comparison Between ESD Gun, TLP & HMM
ESDEMC TS004 TVS Failure Level Tests Comparison Between ESD Gun, TLP & HMMESDEMC TS004 TVS Failure Level Tests Comparison Between ESD Gun, TLP & HMM
ESDEMC TS004 TVS Failure Level Tests Comparison Between ESD Gun, TLP & HMM
 
Introdução ao estudo das funções
Introdução ao estudo das funçõesIntrodução ao estudo das funções
Introdução ao estudo das funções
 
As tensões na colônia
As tensões na colôniaAs tensões na colônia
As tensões na colônia
 
Slide 12
Slide 12 Slide 12
Slide 12
 

Similar to Sample1

Calculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docx
Calculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docxCalculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docx
Calculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docx
RAHUL126667
 
The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 68 of 181
The Ring programming language version 1.5.2 book - Part 68 of 181The Ring programming language version 1.5.2 book - Part 68 of 181
The Ring programming language version 1.5.2 book - Part 68 of 181
Mahmoud Samir Fayed
 
原创 读《大话设计模式》---外观模式(Facade) 收藏
原创 读《大话设计模式》---外观模式(Facade) 收藏原创 读《大话设计模式》---外观模式(Facade) 收藏
原创 读《大话设计模式》---外观模式(Facade) 收藏wensheng wei
 
How to capture a variable in C# and not to shoot yourself in the foot
How to capture a variable in C# and not to shoot yourself in the footHow to capture a variable in C# and not to shoot yourself in the foot
How to capture a variable in C# and not to shoot yourself in the foot
PVS-Studio
 
How to capture a variable in C# and not to shoot yourself in the foot
How to capture a variable in C# and not to shoot yourself in the footHow to capture a variable in C# and not to shoot yourself in the foot
How to capture a variable in C# and not to shoot yourself in the foot
Sofia Fateeva
 
The Ring programming language version 1.8 book - Part 12 of 202
The Ring programming language version 1.8 book - Part 12 of 202The Ring programming language version 1.8 book - Part 12 of 202
The Ring programming language version 1.8 book - Part 12 of 202
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 71 of 185
The Ring programming language version 1.5.4 book - Part 71 of 185The Ring programming language version 1.5.4 book - Part 71 of 185
The Ring programming language version 1.5.4 book - Part 71 of 185
Mahmoud Samir Fayed
 
SAP Batch data communication
SAP Batch data communicationSAP Batch data communication
SAP Batch data communication
Jugul Crasta
 
Android hide
Android hideAndroid hide
Publishing app to play store
Publishing app to play storePublishing app to play store
Publishing app to play store
Shamsher Ahmed
 
The Ring programming language version 1.9 book - Part 14 of 210
The Ring programming language version 1.9 book - Part 14 of 210The Ring programming language version 1.9 book - Part 14 of 210
The Ring programming language version 1.9 book - Part 14 of 210
Mahmoud Samir Fayed
 
Models, controllers and views
Models, controllers and viewsModels, controllers and views
Models, controllers and viewspriestc
 
OpenGL-SolarSystem-master.gitattributes# Auto detect text fil.docx
OpenGL-SolarSystem-master.gitattributes# Auto detect text fil.docxOpenGL-SolarSystem-master.gitattributes# Auto detect text fil.docx
OpenGL-SolarSystem-master.gitattributes# Auto detect text fil.docx
hopeaustin33688
 
Checking Oracle VM VirtualBox. Part 2
Checking Oracle VM VirtualBox. Part 2Checking Oracle VM VirtualBox. Part 2
Checking Oracle VM VirtualBox. Part 2
Andrey Karpov
 
Modularization & Catch Statement
Modularization & Catch StatementModularization & Catch Statement
Modularization & Catch Statement
sapdocs. info
 
Introduction to glpk
Introduction to glpkIntroduction to glpk
Introduction to glpk
University of Tehran
 
The Ring programming language version 1.8 book - Part 78 of 202
The Ring programming language version 1.8 book - Part 78 of 202The Ring programming language version 1.8 book - Part 78 of 202
The Ring programming language version 1.8 book - Part 78 of 202
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180
Mahmoud Samir Fayed
 
Android tips and tricks
Android tips and tricksAndroid tips and tricks
Android tips and tricks
Nikola Kapraljevic Nixa
 

Similar to Sample1 (20)

Calculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docx
Calculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docxCalculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docx
Calculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docx
 
The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210
 
The Ring programming language version 1.5.2 book - Part 68 of 181
The Ring programming language version 1.5.2 book - Part 68 of 181The Ring programming language version 1.5.2 book - Part 68 of 181
The Ring programming language version 1.5.2 book - Part 68 of 181
 
原创 读《大话设计模式》---外观模式(Facade) 收藏
原创 读《大话设计模式》---外观模式(Facade) 收藏原创 读《大话设计模式》---外观模式(Facade) 收藏
原创 读《大话设计模式》---外观模式(Facade) 收藏
 
How to capture a variable in C# and not to shoot yourself in the foot
How to capture a variable in C# and not to shoot yourself in the footHow to capture a variable in C# and not to shoot yourself in the foot
How to capture a variable in C# and not to shoot yourself in the foot
 
How to capture a variable in C# and not to shoot yourself in the foot
How to capture a variable in C# and not to shoot yourself in the footHow to capture a variable in C# and not to shoot yourself in the foot
How to capture a variable in C# and not to shoot yourself in the foot
 
The Ring programming language version 1.8 book - Part 12 of 202
The Ring programming language version 1.8 book - Part 12 of 202The Ring programming language version 1.8 book - Part 12 of 202
The Ring programming language version 1.8 book - Part 12 of 202
 
The Ring programming language version 1.5.4 book - Part 71 of 185
The Ring programming language version 1.5.4 book - Part 71 of 185The Ring programming language version 1.5.4 book - Part 71 of 185
The Ring programming language version 1.5.4 book - Part 71 of 185
 
SAP Batch data communication
SAP Batch data communicationSAP Batch data communication
SAP Batch data communication
 
Android hide
Android hideAndroid hide
Android hide
 
Publishing app to play store
Publishing app to play storePublishing app to play store
Publishing app to play store
 
The Ring programming language version 1.9 book - Part 14 of 210
The Ring programming language version 1.9 book - Part 14 of 210The Ring programming language version 1.9 book - Part 14 of 210
The Ring programming language version 1.9 book - Part 14 of 210
 
Models, controllers and views
Models, controllers and viewsModels, controllers and views
Models, controllers and views
 
OpenGL-SolarSystem-master.gitattributes# Auto detect text fil.docx
OpenGL-SolarSystem-master.gitattributes# Auto detect text fil.docxOpenGL-SolarSystem-master.gitattributes# Auto detect text fil.docx
OpenGL-SolarSystem-master.gitattributes# Auto detect text fil.docx
 
Checking Oracle VM VirtualBox. Part 2
Checking Oracle VM VirtualBox. Part 2Checking Oracle VM VirtualBox. Part 2
Checking Oracle VM VirtualBox. Part 2
 
Modularization & Catch Statement
Modularization & Catch StatementModularization & Catch Statement
Modularization & Catch Statement
 
Introduction to glpk
Introduction to glpkIntroduction to glpk
Introduction to glpk
 
The Ring programming language version 1.8 book - Part 78 of 202
The Ring programming language version 1.8 book - Part 78 of 202The Ring programming language version 1.8 book - Part 78 of 202
The Ring programming language version 1.8 book - Part 78 of 202
 
The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180
 
Android tips and tricks
Android tips and tricksAndroid tips and tricks
Android tips and tricks
 

Sample1

  • 1. REPORT zgs_simple_alv. DATA : it_mara TYPE TABLE OF mara. DATA : container TYPE REF TO cl_gui_custom_container, grid TYPE REF TO cl_gui_alv_grid. SELECT * FROM mara INTO TABLE it_mara UP TO 10 ROWS. CREATE OBJECT container EXPORTING * PARENT = container_name = 'CONTAINER' * STYLE = * LIFETIME = lifetime_default * REPID = * DYNNR = * NO_AUTODEF_PROGID_DYNNR = * EXCEPTIONS * CNTL_ERROR = 1 * CNTL_SYSTEM_ERROR = 2 * CREATE_ERROR = 3 * LIFETIME_ERROR = 4 * LIFETIME_DYNPRO_DYNPRO_LINK = 5 * others = 6 . IF sy-subrc <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. CREATE OBJECT grid EXPORTING * I_SHELLSTYLE = 0 * I_LIFETIME = i_parent = container * I_APPL_EVENTS = space * I_PARENTDBG = * I_APPLOGPARENT = * I_GRAPHICSPARENT = * I_NAME = * I_FCAT_COMPLETE = SPACE * EXCEPTIONS * ERROR_CNTL_CREATE = 1 * ERROR_CNTL_INIT = 2 * ERROR_CNTL_LINK = 3 * ERROR_DP_CREATE = 4 * others = 5 . IF sy-subrc <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. CALL METHOD grid->set_table_for_first_display EXPORTING * I_BUFFER_ACTIVE = * I_BYPASSING_BUFFER = * I_CONSISTENCY_CHECK = i_structure_name = 'MARA' * IS_VARIANT = * I_SAVE = * I_DEFAULT = 'X'
  • 2. * IS_LAYOUT = * IS_PRINT = * IT_SPECIAL_GROUPS = * IT_TOOLBAR_EXCLUDING = * IT_HYPERLINK = * IT_ALV_GRAPHICS = * IT_EXCEPT_QINFO = * IR_SALV_ADAPTER = CHANGING it_outtab = it_mara * IT_FIELDCATALOG = * IT_SORT = * IT_FILTER = * EXCEPTIONS * INVALID_PARAMETER_COMBINATION = 1 * PROGRAM_ERROR = 2 * TOO_MANY_LINES = 3 * others = 4 . IF sy-subrc <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. CALL SCREEN 100. http://www.erpgenie.com/abap/controls/alvgrid.htm Go to the following link which gives you sample codes with brief description of the programs. OOALV Then coming to steps for creation of ALV in OOABAP. 1. Create a program in se38 and just activate it without any code for now. 2. Go to module pool and create a screen, put a custom container control on to the screen. (You will find this control on right side tool box). 3. Give a name to the control created in step 2. 4. Activate the screen. 5. Come to the program declare two variables to hold instances of 2 classes CL_GUI_CUSTOM_CONTAINER, CL_GUI_ALV_GRID. 6. create an instance of the class CL_GUI_CUSTOM_CONTAINER passing container name created in step 3. 7. create an instance of the class CL_GUI_ALV_GRID passing INSTANCE VARIBALE name created in step 6.
  • 3. 8. using the ref. variable of previous step call method SET_TABLE FORFIRST_DISPLAY method and pass structure name and internal table containing data. 9. then call screen created in step 2. Hey... execute the program . You are there with your OOALV.