SlideShare a Scribd company logo
Using Events with ALV Tables
  in Web Dynpro for ABAP




   Release SAP NetWeaver 2004s
SAP List Viewer (ALV) in Web Dynpro Applications                                   Dec. 2005



Copyright
© Copyright 2005 SAP AG. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose
without the express permission of SAP AG. The information contained herein may be
changed without prior notice.

Some software products marketed by SAP AG and its distributors contain proprietary
software components of other software vendors.

Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft
Corporation.

IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400,
OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner,
WebSphere, Netfinity, Tivoli, and Informix are trademarks or registered trademarks of IBM
Corporation in the United States and/or other countries.

Oracle is a registered trademark of Oracle Corporation.

UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.

Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are
trademarks or registered trademarks of Citrix Systems, Inc.

HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World
Wide Web Consortium, Massachusetts Institute of Technology.

Java is a registered trademark of Sun Microsystems, Inc.

JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for
technology invented and implemented by Netscape.

MaxDB is a trademark of MySQL AB, Sweden.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and
services mentioned herein as well as their respective logos are trademarks or registered
trademarks of SAP AG in Germany and in several other countries all over the world. All other
product and service names mentioned are the trademarks of their respective companies.
Data contained in this document serves informational purposes only. National product
specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP
AG and its affiliated companies ("SAP Group") for informational purposes only, without
representation or warranty of any kind, and SAP Group shall not be liable for errors or
omissions with respect to the materials. The only warranties for SAP Group products and
services are those that are set forth in the express warranty statements accompanying such
products and services, if any. Nothing herein should be construed as constituting an
additional warranty.




Using Events with ALV Tables in Web Dynpro for ABAP                                            2
SAP List Viewer (ALV) in Web Dynpro Applications                                   Dec. 2005



Icons in Body Text

   Icon                      Meaning
                             Caution

                             Example

                             Note

                             Recommendation

                             Syntax



Additional icons are used in SAP Library documentation to help you identify different types of
information at a glance. For more information, see Help on Help → General Information
Classes and Information Classes for Business Information Warehouse on the first page of any
version of SAP Library.



Typographic Conventions

  Type Style                Description
  Example text              Words or characters quoted from the screen. These include field
                            names, screen titles, pushbuttons labels, menu names, menu paths,
                            and menu options.
                            Cross-references to other documentation.
  Example text              Emphasized words or phrases in body text, graphic titles, and table
                            titles.
  EXAMPLE TEXT              Technical names of system objects. These include report names,
                            program names, transaction codes, table names, and key concepts of a
                            programming language when they are surrounded by body text, for
                            example, SELECT and INCLUDE.
  Example text              Output on the screen. This includes file and directory names and their
                            paths, messages, names of variables and parameters, source text, and
                            names of installation, upgrade and database tools.
  Example text              Exact user entry. These are words or characters that you enter in the
                            system exactly as they appear in the documentation.
  <Example text>            Variable user entry. Angle brackets indicate that you replace these
                            words and characters with appropriate entries to make entries in the
                            system.
  EXAMPLE TEXT              Keys on the keyboard, for example, F2 or ENTER.




Using Events with ALV Tables in Web Dynpro for ABAP                                                 3
SAP List Viewer (ALV) in Web Dynpro Applications                                                                                            Dec. 2005



Table of Contents
      Copyright..........................................................................................................................................2
      Icons in Body Text ...........................................................................................................................3
      Typographic Conventions.................................................................................................................3
      Table of Contents .............................................................................................................................4
      Task ..................................................................................................................................................5
      Objectives.........................................................................................................................................5


            Copying an Existing Web Dynpro Component ....................................................... 6
      Procedure..........................................................................................................................................6


       Set CellEditor of a column in the ALV table to an editor that triggers an
   ON_CLICK event ................................................................................................................ 6
      CellEditors which are not editable (editable cell editors trigger ON_DATA_CHANGED event)
      and allow actions to be performed on them (Button, ToggleButton, LinkToAction) trigger the
      ON_CLICK event. Therefore it is necessary to set a column cell editor to one of these cell editors
      in order to trigger this event. ............................................................................................................6
      Use a button for column CARRID. ..................................................................................................6
      Use a link for column CONNID.......................................................................................................7


            Display Event Information ........................................................................................ 7
      Create new context node...................................................................................................................7
      Create event handler method onClick...............................................................................................8
      Display the event. .............................................................................................................................9


            Test Your Web Dynpro Application ........................................................................ 9
Author Bio ...................................................................................................................10




Using Events with ALV Tables in Web Dynpro for ABAP                                                                                                              4
SAP List Viewer (ALV) in Web Dynpro Applications                                        Dec. 2005




     Using Events with ALV Tables in Web Dynpro
This tutorial shows you how to use events inside an ALV table in Web Dynpro.



Task
The starting point of this tutorial is the solution application of tutorial“Programming the ALV
Configuration Model in Web Dynpro for ABAP.”
The task of this tutorial is to use the ON_CLICK event. This event is triggered when an action
on a column holding a non editable cell editor (Button, ToggleButton, LinkToAction) is
performed (ButtonClick, LinkClick).



Objectives
By the end of this tutorial, you will be able to:
 !    Display additional information, if a cell is selected


Knowledge
      Knowledge of ABAP OO programming language
      Basic knowledge of programming Web Dynpro applications
      Basic knowledge of ABAP workbench
      Knowledge of the tutorial “Simple example for using the ALV inside Web Dynpro for
      ABAP”.
      Knowledge of the tutorial “Programming the ALV configuration model inside Web
      Dynpro for ABAP”




Using Events with ALV Tables in Web Dynpro for ABAP                                                 5
SAP List Viewer (ALV) in Web Dynpro Applications                                 Dec. 2005




         Copying an Existing Web Dynpro Component
In the system there is a master copy of a Web Dynpro component called
WDT_FLIGHTLIST_CONFIG. You can copy this component as described below.



Procedure
Copying the Web Dynpro Component.
   ...




  1. Start the ABAP Workbench (se80) and select the Web Dynpro component
     WDT_FLIGHTLIST_CONFIG.
  2. Open the context menu of WDT_FLIGHTLIST_CONFIG and copy the Web Dynpro
     component to Z00_WDT_FLIGHTLIST_EVENT.
  3. Open the context menu of the new component Z00_WDT_FLIGHTLIST_EVENT and
     create a Web Dynpro application Z00_WDT_FLIGHTLIST_EVENT.
  4. Select the interface view by using F4 help. Choose MAIN.
  5. Select a plug name by using F4 help and choose default.
  6. Activate the new Web Dynpro component.




    Set CellEditor of a column in the ALV table to an
editor that triggers an ON_CLICK event
CellEditors which are not editable (editable cell editors trigger ON_DATA_CHANGED event)
and allow actions to be performed on them (Button, ToggleButton, LinkToAction) trigger the
ON_CLICK event. Therefore it is necessary to set a column cell editor to one of these cell
editors in order to trigger this event.

Use a button for column CARRID.
   One example for a clickable UI element is a button. We are going to use a button cell
   editor for the column CARRID. When the button is clicked on the event ON_CLICK will be
   triggered.
   Navigate on the methods tab of view ResultView and add the following code at the end of
   method WDDOINIT:


         WDDOINIT()
         [..]

         * Display button in column carrid
           DATA: lr_button TYPE REF TO cl_salv_wd_uie_button.

           lr_column = l_value->if_salv_wd_column_settings~get_column( 'CARRID'
         ).
           CREATE OBJECT lr_button.
           lr_button->set_text_fieldname( 'CARRID' ).
           lr_column->set_cell_editor( lr_button ).

         endmethod.




Using Events with ALV Tables in Web Dynpro for ABAP                                          6
SAP List Viewer (ALV) in Web Dynpro Applications                                             Dec. 2005


Use a link for column CONNID
    Another example for a clickable UI element is a link. Be careful: There are two kinds of
    links available: “link to url” and “link to action”. Only the “link to action” is able to trigger an
    event in the ALV. Therefore we are going to use a “link to action” cell editor for the
    column CONNID. When a link in this column is clicked on the event ON_CLICK will be
    triggered.
    Navigate on the methods tab of view ResultView and add the following code at the end of
    method WDDOINIT:


        WDDOINIT()
        [..]

        * Display link in column connid
          DATA: lr_link TYPE REF TO cl_salv_wd_uie_link_to_action.

          lr_column = l_value->if_salv_wd_column_settings~get_column( 'CONNID'
        ).
          CREATE OBJECT lr_link.
          lr_link->set_text_fieldname( 'CONNID' ).
          lr_column->set_cell_editor( lr_link ).

        endmethod.




      Display Event Information
The event that is raised e.g. through a button click in the ALV table shall be displayed in a
second table on the RESULTVIEW.

Create new context node.
    First we need a new context node to hold the information on the last event.
    Navigate on the context tab of view ResultView an add the new node
    EVENT_PROPERTIES. Set the cardinality to 0..n.
    Add the attributes NAME and VALUE (both of type string) to the newly created context
    node EVENT_PROPERTIES.




Using Events with ALV Tables in Web Dynpro for ABAP                                                        7
SAP List Viewer (ALV) in Web Dynpro Applications                                      Dec. 2005




Create event handler method onClick.
Second we need to store the event information in the new context node
EVENT_PROPERTIES.
Navigate to the methods tab of view ResultView and create event handler method onClick for
the On_CLICK event of the ALV component:




   Implement event handler method ONCLICK with the following functionality:
       •   Fill an internal table with the following information: selected column, selected
           index, attribute name and attribute value
       •   Bind the internal table to context node EVENT_PROPERTIES

       ONCLICK()
       method ONCLICK .

         data: lr_node type ref to if_wd_context_node,
               lt_event_properties type
       if_resultview=>elements_event_properties,
               ls_event_properties type
       if_resultview=>element_event_properties.

           field-symbols: <l_value> type any.

       * fill internal table
         ls_event_properties-name = 'COLUMN_ID'.
         ls_event_properties-value = r_param->column.
         append ls_event_properties to lt_event_properties.

           ls_event_properties-name = 'INDEX'.
           ls_event_properties-value = r_param->index.
           append ls_event_properties to lt_event_properties.

           ls_event_properties-name = 'ATTRIBUTE'.
           ls_event_properties-value = r_param->attribute.
           append ls_event_properties to lt_event_properties.

           assign r_param->value->* to <l_value>.
           ls_event_properties-name = 'VALUE'.
           ls_event_properties-value = <l_value>.
           append ls_event_properties to lt_event_properties.

       * navigate to context node EVENT_PROPERTIES
         lr_node = wd_context->get_child_node( 'EVENT_PROPERTIES' ).

       * bind internal table to context node



Using Events with ALV Tables in Web Dynpro for ABAP                                               8
SAP List Viewer (ALV) in Web Dynpro Applications                                   Dec. 2005


          lr_node->bind_table( lt_event_properties ).

        endmethod.




Display the event.

The additional information, regarding the event properties, should be displayed in a WD table
control. In the tabstrip “Layout” of the view RESULTVIEW, add a table control to the view
elements. Use the context menu to bind the data node EVENT_PROPERTIES to the table
control. This will automatically create the required columns and their bindings.




      Test Your Web Dynpro Application
        The result will look like the following:




Using Events with ALV Tables in Web Dynpro for ABAP                                             9
SAP List Viewer (ALV) in Web Dynpro Applications                                  Dec. 2005




Author Bio
            Claudia Dangers is a senior development consultant in SAP's Software
            Technology and Development department. Since she joined SAP in 1999 she
            has worked on numerous projects and gained practical experience in ABAP and
            BSP development, in the creation of concepts, in coaching and code reviews,
            and as a sub-project lead and training instructor. Claudia is very interested in
            new technologies. Currently she is dealing with Web Dynpro ABAP, kernel-
            based BADI's and the Switch and Enhancement Framework.




Using Events with ALV Tables in Web Dynpro for ABAP                                            10

More Related Content

What's hot

How to conf_mopz_22_slm
How to conf_mopz_22_slmHow to conf_mopz_22_slm
How to conf_mopz_22_slm
raghavendrarao gaddipati
 
XLSX Upload - IN SAP GUI and WDA
XLSX Upload - IN SAP GUI and WDAXLSX Upload - IN SAP GUI and WDA
XLSX Upload - IN SAP GUI and WDA
Benu Mariantony
 
Extended withholdingtaxconfiguration
Extended withholdingtaxconfigurationExtended withholdingtaxconfiguration
Extended withholdingtaxconfiguration
Venkat Emani
 
Abap package concept
Abap package conceptAbap package concept
Abap package concept
Tobias Trapp
 
Step by step procedure for loading of data from the flat file to the master d...
Step by step procedure for loading of data from the flat file to the master d...Step by step procedure for loading of data from the flat file to the master d...
Step by step procedure for loading of data from the flat file to the master d...
Prashant Tyagi
 
Ac409c27 5a7c-0010-82c7-eda71af511fa
Ac409c27 5a7c-0010-82c7-eda71af511faAc409c27 5a7c-0010-82c7-eda71af511fa
Ac409c27 5a7c-0010-82c7-eda71af511fa
Nagendra Babu
 
Funds management configuration sap ag
Funds management configuration sap agFunds management configuration sap ag
Funds management configuration sap ag
Lluckyy
 
RPE - Template formating, style and stylesheet usage
RPE - Template formating, style and stylesheet usageRPE - Template formating, style and stylesheet usage
RPE - Template formating, style and stylesheet usage
GEBS Reporting
 
ACaclchr
ACaclchrACaclchr
ACaclchr
Sanjeev Malik
 
B1 intercompany sizing guide
B1 intercompany sizing guideB1 intercompany sizing guide
B1 intercompany sizing guide
walldorf_share
 
Leshp
LeshpLeshp
How to hana_sso_kerberos
How to hana_sso_kerberosHow to hana_sso_kerberos
How to hana_sso_kerberos
raghavendrarao gaddipati
 
SAP BI 7.0 Info Providers
SAP BI 7.0 Info ProvidersSAP BI 7.0 Info Providers
SAP BI 7.0 Info Providers
Garuda Trainings
 

What's hot (13)

How to conf_mopz_22_slm
How to conf_mopz_22_slmHow to conf_mopz_22_slm
How to conf_mopz_22_slm
 
XLSX Upload - IN SAP GUI and WDA
XLSX Upload - IN SAP GUI and WDAXLSX Upload - IN SAP GUI and WDA
XLSX Upload - IN SAP GUI and WDA
 
Extended withholdingtaxconfiguration
Extended withholdingtaxconfigurationExtended withholdingtaxconfiguration
Extended withholdingtaxconfiguration
 
Abap package concept
Abap package conceptAbap package concept
Abap package concept
 
Step by step procedure for loading of data from the flat file to the master d...
Step by step procedure for loading of data from the flat file to the master d...Step by step procedure for loading of data from the flat file to the master d...
Step by step procedure for loading of data from the flat file to the master d...
 
Ac409c27 5a7c-0010-82c7-eda71af511fa
Ac409c27 5a7c-0010-82c7-eda71af511faAc409c27 5a7c-0010-82c7-eda71af511fa
Ac409c27 5a7c-0010-82c7-eda71af511fa
 
Funds management configuration sap ag
Funds management configuration sap agFunds management configuration sap ag
Funds management configuration sap ag
 
RPE - Template formating, style and stylesheet usage
RPE - Template formating, style and stylesheet usageRPE - Template formating, style and stylesheet usage
RPE - Template formating, style and stylesheet usage
 
ACaclchr
ACaclchrACaclchr
ACaclchr
 
B1 intercompany sizing guide
B1 intercompany sizing guideB1 intercompany sizing guide
B1 intercompany sizing guide
 
Leshp
LeshpLeshp
Leshp
 
How to hana_sso_kerberos
How to hana_sso_kerberosHow to hana_sso_kerberos
How to hana_sso_kerberos
 
SAP BI 7.0 Info Providers
SAP BI 7.0 Info ProvidersSAP BI 7.0 Info Providers
SAP BI 7.0 Info Providers
 

Similar to Link to action

Sap screen personas performance optimization guide v0.96
Sap screen personas performance optimization guide v0.96Sap screen personas performance optimization guide v0.96
Sap screen personas performance optimization guide v0.96
Peter Spielvogel
 
Master guide cdmc
Master guide cdmcMaster guide cdmc
Master guide cdmc
rvegesna1
 
Sap basis installation on win nt oracle 4.6d
Sap basis installation on win nt oracle 4.6dSap basis installation on win nt oracle 4.6d
Sap basis installation on win nt oracle 4.6d
FelipeHernndez75
 
sap
sapsap
Sap r3 installation on windows oracle database
Sap r3 installation on windows   oracle databaseSap r3 installation on windows   oracle database
Sap r3 installation on windows oracle database
ricardopabloasensio
 
Sap r3 installation on windows oracle database
Sap r3 installation on windows   oracle databaseSap r3 installation on windows   oracle database
Sap r3 installation on windows oracle database
ricardopabloasensio
 
PLM 200.pdf
PLM 200.pdfPLM 200.pdf
PLM 200.pdf
Midhun Mohan
 
Lam config-131007234330-phpapp01
Lam config-131007234330-phpapp01Lam config-131007234330-phpapp01
Lam config-131007234330-phpapp01
MaheshMamidi3
 
Sap replication server
Sap replication serverSap replication server
Sap replication server
Cristina Esquivel
 
Badi
BadiBadi
Badi
raj bp
 
F05fba45 0b5f-2c10-a697-f36efa24e899
F05fba45 0b5f-2c10-a697-f36efa24e899F05fba45 0b5f-2c10-a697-f36efa24e899
F05fba45 0b5f-2c10-a697-f36efa24e899
Deepa Bisht
 
Investment Management (IM).pdf
Investment Management (IM).pdfInvestment Management (IM).pdf
Investment Management (IM).pdf
SomnathBhattacharjee23
 
How to guide-fiori-mm_en_xx
How to guide-fiori-mm_en_xxHow to guide-fiori-mm_en_xx
How to guide-fiori-mm_en_xx
Lokesh Modem
 
How to call an enterprise service from jsf
How to call an enterprise service from jsfHow to call an enterprise service from jsf
How to call an enterprise service from jsf
Soufiane Boujamaoui
 
How to use abap cds for data provisioning in bw
How to use abap cds for data provisioning in bwHow to use abap cds for data provisioning in bw
How to use abap cds for data provisioning in bw
Luc Vanrobays
 
Sap netweaver gateway_2.0_sap_net_weaver
Sap netweaver gateway_2.0_sap_net_weaverSap netweaver gateway_2.0_sap_net_weaver
Sap netweaver gateway_2.0_sap_net_weaver
Nagendra Babu
 
Testing SAP HANA applications with SAP LoadRunner by HP
Testing SAP HANA applications with SAP LoadRunner by HPTesting SAP HANA applications with SAP LoadRunner by HP
Testing SAP HANA applications with SAP LoadRunner by HP
SAP Solution Extensions
 
Accessibility guideline web_dynpro_external_version
Accessibility guideline web_dynpro_external_versionAccessibility guideline web_dynpro_external_version
Accessibility guideline web_dynpro_external_version
adatta12
 
Ecc ad ldap
Ecc ad ldapEcc ad ldap
Ecc ad ldap
Shobha Nand Kumar
 
Variant Configuration. LO VC.PDF
Variant Configuration. LO VC.PDFVariant Configuration. LO VC.PDF
Variant Configuration. LO VC.PDF
RafaelOrea1
 

Similar to Link to action (20)

Sap screen personas performance optimization guide v0.96
Sap screen personas performance optimization guide v0.96Sap screen personas performance optimization guide v0.96
Sap screen personas performance optimization guide v0.96
 
Master guide cdmc
Master guide cdmcMaster guide cdmc
Master guide cdmc
 
Sap basis installation on win nt oracle 4.6d
Sap basis installation on win nt oracle 4.6dSap basis installation on win nt oracle 4.6d
Sap basis installation on win nt oracle 4.6d
 
sap
sapsap
sap
 
Sap r3 installation on windows oracle database
Sap r3 installation on windows   oracle databaseSap r3 installation on windows   oracle database
Sap r3 installation on windows oracle database
 
Sap r3 installation on windows oracle database
Sap r3 installation on windows   oracle databaseSap r3 installation on windows   oracle database
Sap r3 installation on windows oracle database
 
PLM 200.pdf
PLM 200.pdfPLM 200.pdf
PLM 200.pdf
 
Lam config-131007234330-phpapp01
Lam config-131007234330-phpapp01Lam config-131007234330-phpapp01
Lam config-131007234330-phpapp01
 
Sap replication server
Sap replication serverSap replication server
Sap replication server
 
Badi
BadiBadi
Badi
 
F05fba45 0b5f-2c10-a697-f36efa24e899
F05fba45 0b5f-2c10-a697-f36efa24e899F05fba45 0b5f-2c10-a697-f36efa24e899
F05fba45 0b5f-2c10-a697-f36efa24e899
 
Investment Management (IM).pdf
Investment Management (IM).pdfInvestment Management (IM).pdf
Investment Management (IM).pdf
 
How to guide-fiori-mm_en_xx
How to guide-fiori-mm_en_xxHow to guide-fiori-mm_en_xx
How to guide-fiori-mm_en_xx
 
How to call an enterprise service from jsf
How to call an enterprise service from jsfHow to call an enterprise service from jsf
How to call an enterprise service from jsf
 
How to use abap cds for data provisioning in bw
How to use abap cds for data provisioning in bwHow to use abap cds for data provisioning in bw
How to use abap cds for data provisioning in bw
 
Sap netweaver gateway_2.0_sap_net_weaver
Sap netweaver gateway_2.0_sap_net_weaverSap netweaver gateway_2.0_sap_net_weaver
Sap netweaver gateway_2.0_sap_net_weaver
 
Testing SAP HANA applications with SAP LoadRunner by HP
Testing SAP HANA applications with SAP LoadRunner by HPTesting SAP HANA applications with SAP LoadRunner by HP
Testing SAP HANA applications with SAP LoadRunner by HP
 
Accessibility guideline web_dynpro_external_version
Accessibility guideline web_dynpro_external_versionAccessibility guideline web_dynpro_external_version
Accessibility guideline web_dynpro_external_version
 
Ecc ad ldap
Ecc ad ldapEcc ad ldap
Ecc ad ldap
 
Variant Configuration. LO VC.PDF
Variant Configuration. LO VC.PDFVariant Configuration. LO VC.PDF
Variant Configuration. LO VC.PDF
 

Recently uploaded

Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
jpupo2018
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 

Recently uploaded (20)

Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 

Link to action

  • 1. Using Events with ALV Tables in Web Dynpro for ABAP Release SAP NetWeaver 2004s
  • 2. SAP List Viewer (ALV) in Web Dynpro Applications Dec. 2005 Copyright © Copyright 2005 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, and Informix are trademarks or registered trademarks of IBM Corporation in the United States and/or other countries. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. Using Events with ALV Tables in Web Dynpro for ABAP 2
  • 3. SAP List Viewer (ALV) in Web Dynpro Applications Dec. 2005 Icons in Body Text Icon Meaning Caution Example Note Recommendation Syntax Additional icons are used in SAP Library documentation to help you identify different types of information at a glance. For more information, see Help on Help → General Information Classes and Information Classes for Business Information Warehouse on the first page of any version of SAP Library. Typographic Conventions Type Style Description Example text Words or characters quoted from the screen. These include field names, screen titles, pushbuttons labels, menu names, menu paths, and menu options. Cross-references to other documentation. Example text Emphasized words or phrases in body text, graphic titles, and table titles. EXAMPLE TEXT Technical names of system objects. These include report names, program names, transaction codes, table names, and key concepts of a programming language when they are surrounded by body text, for example, SELECT and INCLUDE. Example text Output on the screen. This includes file and directory names and their paths, messages, names of variables and parameters, source text, and names of installation, upgrade and database tools. Example text Exact user entry. These are words or characters that you enter in the system exactly as they appear in the documentation. <Example text> Variable user entry. Angle brackets indicate that you replace these words and characters with appropriate entries to make entries in the system. EXAMPLE TEXT Keys on the keyboard, for example, F2 or ENTER. Using Events with ALV Tables in Web Dynpro for ABAP 3
  • 4. SAP List Viewer (ALV) in Web Dynpro Applications Dec. 2005 Table of Contents Copyright..........................................................................................................................................2 Icons in Body Text ...........................................................................................................................3 Typographic Conventions.................................................................................................................3 Table of Contents .............................................................................................................................4 Task ..................................................................................................................................................5 Objectives.........................................................................................................................................5 Copying an Existing Web Dynpro Component ....................................................... 6 Procedure..........................................................................................................................................6 Set CellEditor of a column in the ALV table to an editor that triggers an ON_CLICK event ................................................................................................................ 6 CellEditors which are not editable (editable cell editors trigger ON_DATA_CHANGED event) and allow actions to be performed on them (Button, ToggleButton, LinkToAction) trigger the ON_CLICK event. Therefore it is necessary to set a column cell editor to one of these cell editors in order to trigger this event. ............................................................................................................6 Use a button for column CARRID. ..................................................................................................6 Use a link for column CONNID.......................................................................................................7 Display Event Information ........................................................................................ 7 Create new context node...................................................................................................................7 Create event handler method onClick...............................................................................................8 Display the event. .............................................................................................................................9 Test Your Web Dynpro Application ........................................................................ 9 Author Bio ...................................................................................................................10 Using Events with ALV Tables in Web Dynpro for ABAP 4
  • 5. SAP List Viewer (ALV) in Web Dynpro Applications Dec. 2005 Using Events with ALV Tables in Web Dynpro This tutorial shows you how to use events inside an ALV table in Web Dynpro. Task The starting point of this tutorial is the solution application of tutorial“Programming the ALV Configuration Model in Web Dynpro for ABAP.” The task of this tutorial is to use the ON_CLICK event. This event is triggered when an action on a column holding a non editable cell editor (Button, ToggleButton, LinkToAction) is performed (ButtonClick, LinkClick). Objectives By the end of this tutorial, you will be able to: ! Display additional information, if a cell is selected Knowledge Knowledge of ABAP OO programming language Basic knowledge of programming Web Dynpro applications Basic knowledge of ABAP workbench Knowledge of the tutorial “Simple example for using the ALV inside Web Dynpro for ABAP”. Knowledge of the tutorial “Programming the ALV configuration model inside Web Dynpro for ABAP” Using Events with ALV Tables in Web Dynpro for ABAP 5
  • 6. SAP List Viewer (ALV) in Web Dynpro Applications Dec. 2005 Copying an Existing Web Dynpro Component In the system there is a master copy of a Web Dynpro component called WDT_FLIGHTLIST_CONFIG. You can copy this component as described below. Procedure Copying the Web Dynpro Component. ... 1. Start the ABAP Workbench (se80) and select the Web Dynpro component WDT_FLIGHTLIST_CONFIG. 2. Open the context menu of WDT_FLIGHTLIST_CONFIG and copy the Web Dynpro component to Z00_WDT_FLIGHTLIST_EVENT. 3. Open the context menu of the new component Z00_WDT_FLIGHTLIST_EVENT and create a Web Dynpro application Z00_WDT_FLIGHTLIST_EVENT. 4. Select the interface view by using F4 help. Choose MAIN. 5. Select a plug name by using F4 help and choose default. 6. Activate the new Web Dynpro component. Set CellEditor of a column in the ALV table to an editor that triggers an ON_CLICK event CellEditors which are not editable (editable cell editors trigger ON_DATA_CHANGED event) and allow actions to be performed on them (Button, ToggleButton, LinkToAction) trigger the ON_CLICK event. Therefore it is necessary to set a column cell editor to one of these cell editors in order to trigger this event. Use a button for column CARRID. One example for a clickable UI element is a button. We are going to use a button cell editor for the column CARRID. When the button is clicked on the event ON_CLICK will be triggered. Navigate on the methods tab of view ResultView and add the following code at the end of method WDDOINIT: WDDOINIT() [..] * Display button in column carrid DATA: lr_button TYPE REF TO cl_salv_wd_uie_button. lr_column = l_value->if_salv_wd_column_settings~get_column( 'CARRID' ). CREATE OBJECT lr_button. lr_button->set_text_fieldname( 'CARRID' ). lr_column->set_cell_editor( lr_button ). endmethod. Using Events with ALV Tables in Web Dynpro for ABAP 6
  • 7. SAP List Viewer (ALV) in Web Dynpro Applications Dec. 2005 Use a link for column CONNID Another example for a clickable UI element is a link. Be careful: There are two kinds of links available: “link to url” and “link to action”. Only the “link to action” is able to trigger an event in the ALV. Therefore we are going to use a “link to action” cell editor for the column CONNID. When a link in this column is clicked on the event ON_CLICK will be triggered. Navigate on the methods tab of view ResultView and add the following code at the end of method WDDOINIT: WDDOINIT() [..] * Display link in column connid DATA: lr_link TYPE REF TO cl_salv_wd_uie_link_to_action. lr_column = l_value->if_salv_wd_column_settings~get_column( 'CONNID' ). CREATE OBJECT lr_link. lr_link->set_text_fieldname( 'CONNID' ). lr_column->set_cell_editor( lr_link ). endmethod. Display Event Information The event that is raised e.g. through a button click in the ALV table shall be displayed in a second table on the RESULTVIEW. Create new context node. First we need a new context node to hold the information on the last event. Navigate on the context tab of view ResultView an add the new node EVENT_PROPERTIES. Set the cardinality to 0..n. Add the attributes NAME and VALUE (both of type string) to the newly created context node EVENT_PROPERTIES. Using Events with ALV Tables in Web Dynpro for ABAP 7
  • 8. SAP List Viewer (ALV) in Web Dynpro Applications Dec. 2005 Create event handler method onClick. Second we need to store the event information in the new context node EVENT_PROPERTIES. Navigate to the methods tab of view ResultView and create event handler method onClick for the On_CLICK event of the ALV component: Implement event handler method ONCLICK with the following functionality: • Fill an internal table with the following information: selected column, selected index, attribute name and attribute value • Bind the internal table to context node EVENT_PROPERTIES ONCLICK() method ONCLICK . data: lr_node type ref to if_wd_context_node, lt_event_properties type if_resultview=>elements_event_properties, ls_event_properties type if_resultview=>element_event_properties. field-symbols: <l_value> type any. * fill internal table ls_event_properties-name = 'COLUMN_ID'. ls_event_properties-value = r_param->column. append ls_event_properties to lt_event_properties. ls_event_properties-name = 'INDEX'. ls_event_properties-value = r_param->index. append ls_event_properties to lt_event_properties. ls_event_properties-name = 'ATTRIBUTE'. ls_event_properties-value = r_param->attribute. append ls_event_properties to lt_event_properties. assign r_param->value->* to <l_value>. ls_event_properties-name = 'VALUE'. ls_event_properties-value = <l_value>. append ls_event_properties to lt_event_properties. * navigate to context node EVENT_PROPERTIES lr_node = wd_context->get_child_node( 'EVENT_PROPERTIES' ). * bind internal table to context node Using Events with ALV Tables in Web Dynpro for ABAP 8
  • 9. SAP List Viewer (ALV) in Web Dynpro Applications Dec. 2005 lr_node->bind_table( lt_event_properties ). endmethod. Display the event. The additional information, regarding the event properties, should be displayed in a WD table control. In the tabstrip “Layout” of the view RESULTVIEW, add a table control to the view elements. Use the context menu to bind the data node EVENT_PROPERTIES to the table control. This will automatically create the required columns and their bindings. Test Your Web Dynpro Application The result will look like the following: Using Events with ALV Tables in Web Dynpro for ABAP 9
  • 10. SAP List Viewer (ALV) in Web Dynpro Applications Dec. 2005 Author Bio Claudia Dangers is a senior development consultant in SAP's Software Technology and Development department. Since she joined SAP in 1999 she has worked on numerous projects and gained practical experience in ABAP and BSP development, in the creation of concepts, in coaching and code reviews, and as a sub-project lead and training instructor. Claudia is very interested in new technologies. Currently she is dealing with Web Dynpro ABAP, kernel- based BADI's and the Switch and Enhancement Framework. Using Events with ALV Tables in Web Dynpro for ABAP 10