{"id":2122,"date":"2019-02-27T00:47:38","date_gmt":"2019-02-27T00:47:38","guid":{"rendered":"https:\/\/www.se80.co.uk\/training-education\/?p=2122"},"modified":"2019-08-08T09:48:42","modified_gmt":"2019-08-08T09:48:42","slug":"cl_salv_table-alv","status":"publish","type":"post","link":"https:\/\/www.se80.co.uk\/training-education\/cl_salv_table-alv\/","title":{"rendered":"CL_SALV_TABLE example"},"content":{"rendered":"<p>Using CL_SALV_TABLE class to create a very simple ABAP ALV report that selects data from database table SFLIGHT and displays it to the user as an ALV grid via the cl_salv_table=>factory method. This is just a very basic output but demonstrates how you can display a grid report with s little as 12 lines of code, you could actually get it lower than this. <\/p>\n<pre>\r\n*& TITLE: Simple ALV report using CL_SALV_TABLE class\r\n*&-------------------------------*\r\n*& Report  ZALV_SIMPLE\r\n*&-------------------------------*\r\n*& Output very simple ALV report using CL_SALV_TABLE class\r\n*&-------------------------------*\r\nREPORT ZALV_SIMPLE.\r\n\r\nDATA: it_report TYPE TABLE OF sflight.\r\nDATA: salv_table TYPE REF TO   cl_salv_table.\r\n\r\n*------------------\r\nSTART-OF-SELECTION.\r\n\r\n* Select data from database table SFLIGHT\r\n  SELECT *\r\n   UP TO 20 ROWS\r\n    from SFLIGHT\r\n    INTO TABLE it_report.\r\n\r\n* Create an instance of the SALV table object\r\n  CALL METHOD cl_salv_table=>factory\r\n    EXPORTING\r\n      list_display = if_salv_c_bool_sap=>false\r\n    IMPORTING\r\n      r_salv_table = salv_table\r\n    CHANGING\r\n      t_table      = it_report.\r\n\r\n\r\n*----------------\r\nEND-OF-SELECTION.\r\n\r\n* Output ALV report to user\r\n  salv_table->display( ).\r\n\r\n<\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.se80.co.uk\/training-education\/wp-content\/uploads\/2019\/02\/CL_SALV_TABLE.png\" alt=\"CL_SALV_TABLE example\" width=\"445\" height=\"255\" class=\"alignnone size-full wp-image-2126\" srcset=\"https:\/\/www.se80.co.uk\/training-education\/wp-content\/uploads\/2019\/02\/CL_SALV_TABLE.png 445w, https:\/\/www.se80.co.uk\/training-education\/wp-content\/uploads\/2019\/02\/CL_SALV_TABLE-300x172.png 300w\" sizes=\"(max-width: 445px) 100vw, 445px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using CL_SALV_TABLE class to create a very simple ABAP ALV report that selects data from database table SFLIGHT and displays it to the user as an ALV grid via the cl_salv_table=>factory method. This is just a very basic output but demonstrates how you can display a grid report with s little as 12 lines of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2126,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[63,54],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>CL_SALV_TABLE Simple ALV report example using ABAP<\/title>\n<meta name=\"description\" content=\"Simple ABAP example to display and ALV report using the CL_SALV_TABLE SAP class. Select data from SFLIGHT and display to user using very few lines of code\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.se80.co.uk\/training-education\/cl_salv_table-alv\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CL_SALV_TABLE Simple ALV report example using ABAP\" \/>\n<meta property=\"og:description\" content=\"Simple ABAP example to display and ALV report using the CL_SALV_TABLE SAP class. Select data from SFLIGHT and display to user using very few lines of code\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.se80.co.uk\/training-education\/cl_salv_table-alv\/\" \/>\n<meta property=\"og:site_name\" content=\"SAP Help, Training and Education\" \/>\n<meta property=\"article:published_time\" content=\"2019-02-27T00:47:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-08-08T09:48:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.se80.co.uk\/training-education\/wp-content\/uploads\/2019\/02\/CL_SALV_TABLE.png\" \/>\n\t<meta property=\"og:image:width\" content=\"445\" \/>\n\t<meta property=\"og:image:height\" content=\"255\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"se80\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"se80\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/cl_salv_table-alv\/\",\"url\":\"https:\/\/www.se80.co.uk\/training-education\/cl_salv_table-alv\/\",\"name\":\"CL_SALV_TABLE Simple ALV report example using ABAP\",\"isPartOf\":{\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/#website\"},\"datePublished\":\"2019-02-27T00:47:38+00:00\",\"dateModified\":\"2019-08-08T09:48:42+00:00\",\"author\":{\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/#\/schema\/person\/ddc6a049c1b0790f62d70278be75e511\"},\"description\":\"Simple ABAP example to display and ALV report using the CL_SALV_TABLE SAP class. Select data from SFLIGHT and display to user using very few lines of code\",\"breadcrumb\":{\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/cl_salv_table-alv\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.se80.co.uk\/training-education\/cl_salv_table-alv\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/cl_salv_table-alv\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.se80.co.uk\/training-education\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CL_SALV_TABLE example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/#website\",\"url\":\"https:\/\/www.se80.co.uk\/training-education\/\",\"name\":\"SAP Help, Training and Education\",\"description\":\"Learn SAP\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.se80.co.uk\/training-education\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/#\/schema\/person\/ddc6a049c1b0790f62d70278be75e511\",\"name\":\"se80\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.se80.co.uk\/training-education\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3fd4e388f05bf3c763e46cd1f77afeb2?s=96&d=retro&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3fd4e388f05bf3c763e46cd1f77afeb2?s=96&d=retro&r=g\",\"caption\":\"se80\"},\"url\":\"https:\/\/www.se80.co.uk\/training-education\/author\/se80\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CL_SALV_TABLE Simple ALV report example using ABAP","description":"Simple ABAP example to display and ALV report using the CL_SALV_TABLE SAP class. Select data from SFLIGHT and display to user using very few lines of code","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.se80.co.uk\/training-education\/cl_salv_table-alv\/","og_locale":"en_US","og_type":"article","og_title":"CL_SALV_TABLE Simple ALV report example using ABAP","og_description":"Simple ABAP example to display and ALV report using the CL_SALV_TABLE SAP class. Select data from SFLIGHT and display to user using very few lines of code","og_url":"https:\/\/www.se80.co.uk\/training-education\/cl_salv_table-alv\/","og_site_name":"SAP Help, Training and Education","article_published_time":"2019-02-27T00:47:38+00:00","article_modified_time":"2019-08-08T09:48:42+00:00","og_image":[{"width":445,"height":255,"url":"https:\/\/www.se80.co.uk\/training-education\/wp-content\/uploads\/2019\/02\/CL_SALV_TABLE.png","type":"image\/png"}],"author":"se80","twitter_card":"summary_large_image","twitter_misc":{"Written by":"se80","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.se80.co.uk\/training-education\/cl_salv_table-alv\/","url":"https:\/\/www.se80.co.uk\/training-education\/cl_salv_table-alv\/","name":"CL_SALV_TABLE Simple ALV report example using ABAP","isPartOf":{"@id":"https:\/\/www.se80.co.uk\/training-education\/#website"},"datePublished":"2019-02-27T00:47:38+00:00","dateModified":"2019-08-08T09:48:42+00:00","author":{"@id":"https:\/\/www.se80.co.uk\/training-education\/#\/schema\/person\/ddc6a049c1b0790f62d70278be75e511"},"description":"Simple ABAP example to display and ALV report using the CL_SALV_TABLE SAP class. Select data from SFLIGHT and display to user using very few lines of code","breadcrumb":{"@id":"https:\/\/www.se80.co.uk\/training-education\/cl_salv_table-alv\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.se80.co.uk\/training-education\/cl_salv_table-alv\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.se80.co.uk\/training-education\/cl_salv_table-alv\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.se80.co.uk\/training-education\/"},{"@type":"ListItem","position":2,"name":"CL_SALV_TABLE example"}]},{"@type":"WebSite","@id":"https:\/\/www.se80.co.uk\/training-education\/#website","url":"https:\/\/www.se80.co.uk\/training-education\/","name":"SAP Help, Training and Education","description":"Learn SAP","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.se80.co.uk\/training-education\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.se80.co.uk\/training-education\/#\/schema\/person\/ddc6a049c1b0790f62d70278be75e511","name":"se80","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.se80.co.uk\/training-education\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3fd4e388f05bf3c763e46cd1f77afeb2?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3fd4e388f05bf3c763e46cd1f77afeb2?s=96&d=retro&r=g","caption":"se80"},"url":"https:\/\/www.se80.co.uk\/training-education\/author\/se80\/"}]}},"jetpack_featured_media_url":"https:\/\/www.se80.co.uk\/training-education\/wp-content\/uploads\/2019\/02\/CL_SALV_TABLE.png","_links":{"self":[{"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/posts\/2122"}],"collection":[{"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/comments?post=2122"}],"version-history":[{"count":4,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/posts\/2122\/revisions"}],"predecessor-version":[{"id":2128,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/posts\/2122\/revisions\/2128"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/media\/2126"}],"wp:attachment":[{"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/media?parent=2122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/categories?post=2122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.se80.co.uk\/training-education\/wp-json\/wp\/v2\/tags?post=2122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}