SlideShare ist ein Scribd-Unternehmen logo
1 von 11
Downloaden Sie, um offline zu lesen
Lecture 15 ALV Grid Control BCO5647 Applications Programming Techniques (ABAP)
Readings & Objectives ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Key Outcomes ,[object Object],[object Object]
Working with Methods Classes and Objects
Creating Objects and Calling Methods
Application Example: ALV Grid Control
Program with ALV Grid Control
Objects and Classes for ALV Grid Control To call the custom container controls and the ALV Grid Control, the following global classes (object types) are available in the  Class Builder : CL_GUI_CUSTOM_CONTAINER  and  CL_GUI_ALV_GRID
ALV Grid Control: Important Methods ,[object Object],[object Object],[object Object],[object Object]
Display the contents of an internal table on a Screen with ALV Grid Control REPORT sapmz_hf_alv_grid . TABLES: sflight. *-------------------------------------------------- * G L O B A L  I N T E R N  A L  T A B L E S *-------------------------------------------------- DATA: gi_sflight TYPE TABLE OF sflight. *-------------------------------------------------- * G L O B A L  D A T A *-------------------------------------------------- DATA: g_wa_sflight LIKE sflight. * Declare reference variables to the ALV grid and the container DATA:  go_grid TYPE REF TO cl_gui_alv_grid, go_custom_container  TYPE REF TO cl_gui_custom_container. START-OF-SELECTION. SET SCREEN '101'. *&------------------------------------------------* *&  Module  USER_COMMAND_0101  INPUT *&------------------------------------------------* MODULE user_command_0101 INPUT. CASE sy-ucomm. WHEN 'EXIT'. LEAVE TO SCREEN 0. ENDCASE. ENDMODULE.  " USER_COMMAND_0101  INPUT
Display the contents of an internal table on a Screen with ALV Grid Control *&  Module  STATUS_0101  OUTPUT *&------------------------------------------------* MODULE status_0101 OUTPUT. set pf-status 'GRID'. * Create objects IF go_custom_container IS INITIAL. CREATE OBJECT go_custom_container EXPORTING container_name = 'CONTAINER_1'. CREATE OBJECT go_grid EXPORTING i_parent = go_custom_container. PERFORM load_data_into_grid. ENDIF. ENDMODULE.  " STATUS_0101  OUTPUT *&------------------------------------------------* *&  Form  load_data_into_grid *&------------------------------------------------* FORM load_data_into_grid. * Read data from table SFLIGHT SELECT * FROM sflight INTO TABLE gi_sflight. * Load data into the grid and display them CALL METHOD go_grid->set_table_for_first_display EXPORTING i_structure_name = 'SFLIGHT' CHANGING  it_outtab  = gi_sflight. ENDFORM.  " load_data_into_grid

Weitere ähnliche Inhalte

Ähnlich wie Lecture15 abap on line

Alv object model simple 2 d table - the basics
Alv object model   simple 2 d table - the basicsAlv object model   simple 2 d table - the basics
Alv object model simple 2 d table - the basicsFaina Fridman
 
An easy reference for alv grid control (1)
An easy reference for alv grid control (1)An easy reference for alv grid control (1)
An easy reference for alv grid control (1)Faina Fridman
 
Alv object model simple 2 d table - event handling
Alv object model   simple 2 d table - event handlingAlv object model   simple 2 d table - event handling
Alv object model simple 2 d table - event handlinganil kumar
 
Object oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPObject oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPNoman Mohamed Hanif
 
Ground Breakers Romania: Explain the explain_plan
Ground Breakers Romania: Explain the explain_planGround Breakers Romania: Explain the explain_plan
Ground Breakers Romania: Explain the explain_planMaria Colgan
 
Part3 Explain the Explain Plan
Part3 Explain the Explain PlanPart3 Explain the Explain Plan
Part3 Explain the Explain PlanMaria Colgan
 
Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007paulguerin
 
Polymorphic Table Functions in 18c
Polymorphic Table Functions in 18cPolymorphic Table Functions in 18c
Polymorphic Table Functions in 18cAndrej Pashchenko
 
Advanced plsql mock_assessment
Advanced plsql mock_assessmentAdvanced plsql mock_assessment
Advanced plsql mock_assessmentSaurabh K. Gupta
 
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsNirav Shah
 
PostgreSQL 9.5 Features
PostgreSQL 9.5 FeaturesPostgreSQL 9.5 Features
PostgreSQL 9.5 FeaturesSaiful
 
SQL212.3 Introduction to SQL using Oracle Module 3
SQL212.3 Introduction to SQL using Oracle Module 3SQL212.3 Introduction to SQL using Oracle Module 3
SQL212.3 Introduction to SQL using Oracle Module 3Dan D'Urso
 
MariaDB Optimizer
MariaDB OptimizerMariaDB Optimizer
MariaDB OptimizerJongJin Lee
 
MySQL Query And Index Tuning
MySQL Query And Index TuningMySQL Query And Index Tuning
MySQL Query And Index TuningManikanda kumar
 

Ähnlich wie Lecture15 abap on line (20)

Alv object model simple 2 d table - the basics
Alv object model   simple 2 d table - the basicsAlv object model   simple 2 d table - the basics
Alv object model simple 2 d table - the basics
 
An easy reference for alv grid control (1)
An easy reference for alv grid control (1)An easy reference for alv grid control (1)
An easy reference for alv grid control (1)
 
Alv object model simple 2 d table - event handling
Alv object model   simple 2 d table - event handlingAlv object model   simple 2 d table - event handling
Alv object model simple 2 d table - event handling
 
Object oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPObject oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAP
 
ABAP Advanced List
ABAP Advanced ListABAP Advanced List
ABAP Advanced List
 
Ground Breakers Romania: Explain the explain_plan
Ground Breakers Romania: Explain the explain_planGround Breakers Romania: Explain the explain_plan
Ground Breakers Romania: Explain the explain_plan
 
Part3 Explain the Explain Plan
Part3 Explain the Explain PlanPart3 Explain the Explain Plan
Part3 Explain the Explain Plan
 
Part5 sql tune
Part5 sql tunePart5 sql tune
Part5 sql tune
 
Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007
 
Alv theory
Alv theoryAlv theory
Alv theory
 
Polymorphic Table Functions in 18c
Polymorphic Table Functions in 18cPolymorphic Table Functions in 18c
Polymorphic Table Functions in 18c
 
Advanced plsql mock_assessment
Advanced plsql mock_assessmentAdvanced plsql mock_assessment
Advanced plsql mock_assessment
 
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tips
 
Les10 Creating And Managing Tables
Les10 Creating And Managing TablesLes10 Creating And Managing Tables
Les10 Creating And Managing Tables
 
PostgreSQL 9.5 Features
PostgreSQL 9.5 FeaturesPostgreSQL 9.5 Features
PostgreSQL 9.5 Features
 
BAPI - Criação de Ordem de Manutenção
BAPI - Criação de Ordem de ManutençãoBAPI - Criação de Ordem de Manutenção
BAPI - Criação de Ordem de Manutenção
 
SQL212.3 Introduction to SQL using Oracle Module 3
SQL212.3 Introduction to SQL using Oracle Module 3SQL212.3 Introduction to SQL using Oracle Module 3
SQL212.3 Introduction to SQL using Oracle Module 3
 
SQL Tunning
SQL TunningSQL Tunning
SQL Tunning
 
MariaDB Optimizer
MariaDB OptimizerMariaDB Optimizer
MariaDB Optimizer
 
MySQL Query And Index Tuning
MySQL Query And Index TuningMySQL Query And Index Tuning
MySQL Query And Index Tuning
 

Mehr von Milind Patil

Abap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfilesAbap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfilesMilind Patil
 
Step by step abap_input help or lov
Step by step abap_input help or lovStep by step abap_input help or lov
Step by step abap_input help or lovMilind Patil
 
Step bystep abap_fieldhelpordocumentation
Step bystep abap_fieldhelpordocumentationStep bystep abap_fieldhelpordocumentation
Step bystep abap_fieldhelpordocumentationMilind Patil
 
Step bystep abap_field help or documentation
Step bystep abap_field help or documentationStep bystep abap_field help or documentation
Step bystep abap_field help or documentationMilind Patil
 
Abap slides user defined data types and data
Abap slides user defined data types and dataAbap slides user defined data types and data
Abap slides user defined data types and dataMilind Patil
 
Abap slide lock Enqueue data clusters auth checks
Abap slide lock Enqueue data clusters auth checksAbap slide lock Enqueue data clusters auth checks
Abap slide lock Enqueue data clusters auth checksMilind Patil
 
Step bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordStep bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordMilind Patil
 
Abap slide lockenqueuedataclustersauthchecks
Abap slide lockenqueuedataclustersauthchecksAbap slide lockenqueuedataclustersauthchecks
Abap slide lockenqueuedataclustersauthchecksMilind Patil
 
Abap slide exceptionshandling
Abap slide exceptionshandlingAbap slide exceptionshandling
Abap slide exceptionshandlingMilind Patil
 
Step bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordStep bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordMilind Patil
 
Lecture16 abap on line
Lecture16 abap on lineLecture16 abap on line
Lecture16 abap on lineMilind Patil
 
Lecture14 abap on line
Lecture14 abap on lineLecture14 abap on line
Lecture14 abap on lineMilind Patil
 
Lecture13 abap on line
Lecture13 abap on lineLecture13 abap on line
Lecture13 abap on lineMilind Patil
 
Lecture12 abap on line
Lecture12 abap on lineLecture12 abap on line
Lecture12 abap on lineMilind Patil
 
Lecture11 abap on line
Lecture11 abap on lineLecture11 abap on line
Lecture11 abap on lineMilind Patil
 
Lecture10 abap on line
Lecture10 abap on lineLecture10 abap on line
Lecture10 abap on lineMilind Patil
 
Lecture09 abap on line
Lecture09 abap on lineLecture09 abap on line
Lecture09 abap on lineMilind Patil
 

Mehr von Milind Patil (20)

Abap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfilesAbap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfiles
 
Step by step abap_input help or lov
Step by step abap_input help or lovStep by step abap_input help or lov
Step by step abap_input help or lov
 
Step bystep abap_fieldhelpordocumentation
Step bystep abap_fieldhelpordocumentationStep bystep abap_fieldhelpordocumentation
Step bystep abap_fieldhelpordocumentation
 
Step bystep abap_field help or documentation
Step bystep abap_field help or documentationStep bystep abap_field help or documentation
Step bystep abap_field help or documentation
 
Abap slides user defined data types and data
Abap slides user defined data types and dataAbap slides user defined data types and data
Abap slides user defined data types and data
 
Abap slides set1
Abap slides set1Abap slides set1
Abap slides set1
 
Abap slide class3
Abap slide class3Abap slide class3
Abap slide class3
 
Abap slide lock Enqueue data clusters auth checks
Abap slide lock Enqueue data clusters auth checksAbap slide lock Enqueue data clusters auth checks
Abap slide lock Enqueue data clusters auth checks
 
Step bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordStep bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecord
 
Abap slide lockenqueuedataclustersauthchecks
Abap slide lockenqueuedataclustersauthchecksAbap slide lockenqueuedataclustersauthchecks
Abap slide lockenqueuedataclustersauthchecks
 
Abap slide exceptionshandling
Abap slide exceptionshandlingAbap slide exceptionshandling
Abap slide exceptionshandling
 
Step bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordStep bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecord
 
Abap reports
Abap reportsAbap reports
Abap reports
 
Lecture16 abap on line
Lecture16 abap on lineLecture16 abap on line
Lecture16 abap on line
 
Lecture14 abap on line
Lecture14 abap on lineLecture14 abap on line
Lecture14 abap on line
 
Lecture13 abap on line
Lecture13 abap on lineLecture13 abap on line
Lecture13 abap on line
 
Lecture12 abap on line
Lecture12 abap on lineLecture12 abap on line
Lecture12 abap on line
 
Lecture11 abap on line
Lecture11 abap on lineLecture11 abap on line
Lecture11 abap on line
 
Lecture10 abap on line
Lecture10 abap on lineLecture10 abap on line
Lecture10 abap on line
 
Lecture09 abap on line
Lecture09 abap on lineLecture09 abap on line
Lecture09 abap on line
 

Kürzlich hochgeladen

Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Français Patch Tuesday - Avril
Français Patch Tuesday - AvrilFrançais Patch Tuesday - Avril
Français Patch Tuesday - AvrilIvanti
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialJoão Esperancinha
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 

Kürzlich hochgeladen (20)

Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Français Patch Tuesday - Avril
Français Patch Tuesday - AvrilFrançais Patch Tuesday - Avril
Français Patch Tuesday - Avril
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorial
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 

Lecture15 abap on line

  • 1. Lecture 15 ALV Grid Control BCO5647 Applications Programming Techniques (ABAP)
  • 2.
  • 3.
  • 4. Working with Methods Classes and Objects
  • 5. Creating Objects and Calling Methods
  • 7. Program with ALV Grid Control
  • 8. Objects and Classes for ALV Grid Control To call the custom container controls and the ALV Grid Control, the following global classes (object types) are available in the Class Builder : CL_GUI_CUSTOM_CONTAINER and CL_GUI_ALV_GRID
  • 9.
  • 10. Display the contents of an internal table on a Screen with ALV Grid Control REPORT sapmz_hf_alv_grid . TABLES: sflight. *-------------------------------------------------- * G L O B A L I N T E R N A L T A B L E S *-------------------------------------------------- DATA: gi_sflight TYPE TABLE OF sflight. *-------------------------------------------------- * G L O B A L D A T A *-------------------------------------------------- DATA: g_wa_sflight LIKE sflight. * Declare reference variables to the ALV grid and the container DATA: go_grid TYPE REF TO cl_gui_alv_grid, go_custom_container TYPE REF TO cl_gui_custom_container. START-OF-SELECTION. SET SCREEN '101'. *&------------------------------------------------* *& Module USER_COMMAND_0101 INPUT *&------------------------------------------------* MODULE user_command_0101 INPUT. CASE sy-ucomm. WHEN 'EXIT'. LEAVE TO SCREEN 0. ENDCASE. ENDMODULE. " USER_COMMAND_0101 INPUT
  • 11. Display the contents of an internal table on a Screen with ALV Grid Control *& Module STATUS_0101 OUTPUT *&------------------------------------------------* MODULE status_0101 OUTPUT. set pf-status 'GRID'. * Create objects IF go_custom_container IS INITIAL. CREATE OBJECT go_custom_container EXPORTING container_name = 'CONTAINER_1'. CREATE OBJECT go_grid EXPORTING i_parent = go_custom_container. PERFORM load_data_into_grid. ENDIF. ENDMODULE. " STATUS_0101 OUTPUT *&------------------------------------------------* *& Form load_data_into_grid *&------------------------------------------------* FORM load_data_into_grid. * Read data from table SFLIGHT SELECT * FROM sflight INTO TABLE gi_sflight. * Load data into the grid and display them CALL METHOD go_grid->set_table_for_first_display EXPORTING i_structure_name = 'SFLIGHT' CHANGING it_outtab = gi_sflight. ENDFORM. " load_data_into_grid

Hinweis der Redaktion

  1. SAP List Viewer (previously called ABAP List Viewer) is a set of function modules that are added to program code to enhance the appearance and functionality of lists (reports). LV can add functionality features to lists such as sorting, subtotals and interactivity with minimal programming effort. LV can enhance the appearance of list by adding column headings, vertical lines and color with no programming effort. LV has limited technical support but is widely used in industry. SLV can now be activated using ABAP Objects by creating object instantiations and call methods.
  2. At first glance, a class is very much like a function group since it contains data objects ( attributes ) and functions ( methods ). These components can be protected against outside access. This is usually done with the attributes and some methods. Then the protected components can only be accessed by public methods. Unlike function groups, classes can have multiple instances . This means that more than one runtime object can be created for each program in a class. In other words, a class contains the technical description of objects (instances). Therefore, all these objects have the same attributes and provide the same methods. However, they can be distinguished physically. Their attributes can have different features. Classes can be defined either locally within an executable program or Globally (in DD).
  3. To create instances of classes and to be able to address them, you need reference variables . These are pointers to these instances. Reference variables are defined using: DATA reference_name TYPE REF TO class_name . When the program starts, the data objects are created in the memory. However, since no instances have been created yet, the reference variables are still empty. At runtime, you can create any number of instances of classes using: CREATE OBJECT reference_name . You call methods of an instance using: CALL METHOD reference_name -> method_name . In contrast to a function module call, the function name is not sufficient here since, generally, several instances of a class exist for each program. Using the reference variable, here reference_name, followed by the object component selector -> , you instruct a specific instance to execute its method.
  4. The ALV Grid Control is used for displaying non-hierarchical data in table form. Several user functions are already implemented: On the screen, you can increase or decrease the column width or use the ‘Optimum Width’ function to adjust the column width to suit the data currently displayed. You can also change the column sequence by selecting a column and dragging it to a new position. Standard functions are available in the application toolbar for the control. The detail view displays the fields of the row, on which the cursor is positioned, in a modal dialog box. The sort function in the ALV Grid Control is available for as many columns as required. You can set complex sort criteria and sort columns in either ascending or descending order. You can use the Search function to search for a string (generic search without * ) in rows or columns within a selected area. You can use the Sum function to request totals for one or more numeric columns. You can use the Subtotal function to structure control level lists: Select the columns (non-numeric fields only) that you want to use and the corresponding control level totals are displayed. For Print and Download the whole list is always processed, not just the sections displayed on the screen.
  5. Before you start creating a ALV Grid Control, you should show class the menu path Environment ->Examples ->Control Examples in the Object Navigator. An Enjoy SAP control must always be embedded in an SAP container control. This manages the embedded controls and provides a physical area for displaying them. The container becomes the parent of the embedded control. Since containers are themselves controls, they can be nested within one another. In this way, you can work with controls in a flexible and modular manner. To be able to use an ALV Grid Control in your program, you require at least one container and one ALV grid instance.
  6. SET SCREEN '101'. To reserve an area of the screen for an EnjoySAP control, create a custom container area using the Screen Painter (choose Layout ). On the toolbar to the left of the editing area, choose Custom Control and specify the size and position of the area on the screen. Proceed as follows: Define the top left corner of the area by holding down the left mouse button. Drag the cursor diagonally down to the right to where you want the bottom right corner. Once you release the mouse button, the bottom right corner is fixed in position. You can change the size and position of the area at any time using the drag symbols that appear at the edge of the area. Enter a name for the new screen element (here: CONTAINER_1 ) DATA: go_grid TYPE REF TO cl_gui_alv_grid, go_custom_container TYPE REF TO cl_gui_custom_container. Two reference variables are required in the ABAP program: The reference variable that is to point to the grid control instance is called GO_GRID in this case, and is typed with the global class CL_GUI_ALV_GRID . The reference variable that is to point to the container control instance is called GO_CUSTOM_CONTAINER in this case, and is typed with the global class CL_GUI_CUSTOM_CONTAINER .
  7. CREATE OBJECT go_custom_container EXPORTING container_name = 'CONTAINER_1'. CREATE OBJECT go_grid EXPORTING i_parent = go_custom_container. You create control instances using the CREATE OBJECT statement. The control processing must be complete before the corresponding screen is displayed. Therefore, it should we recommend placed in the PBO module for this purpose. Creating an instance for the controls should take place only once, before the screen is first displayed. This is easily done by querying the content of one of the two reference variables. Since here the instantiation of the container control is implemented in the corresponding PBO module, you need only pass the name of the custom container area to the interface. When you instantiate the grid control, all you need to do is to pass the pointer to the container instance. In this way, the container control manages the technical link of the SAP Grid Control to the screen. CALL METHOD go_grid->set_table_for_first_display EXPORTING i_structure_name = 'SFLIGHT‘ CHANGING it_outtab = gi_sflight. To pass the contents of the internal table and the line type to the SAP Grid Control, you must call the method SET_TABLE_FOR_FIRST_DISPLAY . Pass the name of the internal table to the IT_OUTTAB parameter. Here the internal table has been typed with the transparent table SPFLIGHT as the line type. Therefore, you need only pass this name to the I_STRUCTURE_NAME parameter.