SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software SAP ABAP Programming and HANA Database Tutorials
Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Windows, Windows Phone, SAP and ABAP, like SAP UI5, Screen Personas, etc.




Install SAP Free


ABAP Code to Display SAP Table Contents


Here is a simple sample ABAP code and ABAP program source code which displays the contents of an SAP table on screen.

REPORT ZTEST_SAPLANE.

DATA:
  gs_saplane TYPE saplane,
  gt_saplane TYPE TABLE OF saplane.

SELECT * FROM saplane INTO TABLE gt_saplane.

LOOP AT gt_saplane INTO gs_saplane.
  WRITE: /
    gs_saplane-PLANETYPE,
    gs_saplane-SEATSMAX,
    gs_saplane-PRODUCER.
ENDLOOP.
EXIT.

In the above ABAP code the SAP table SAPLANE is being used.
The ABAP code is making a selection using SELECT command in order to select table contents.
In the ABAP LOOP AT command, using the ABAP WRITE statement we display table contents one row at a time.
Table display in ABAP can be managed by similar codes in small SAP tables where table data is not causing too much LOOP.

abap-code-to-display-sap-table-contents-output





You can also limit the number of rows or number of SAP table lines by using the UP TO n ROWS syntax within SELECT ABAP code.
This is equal to SELECT TOP n syntax in T-SQL on SQL Server.

SELECT * FROM saplane
  INTO TABLE gt_saplane UP TO 3 ROWS.






SAP Resources

SAP Tutorial

SAP Forums

SAP Tools

SAP Transaction Codes Table








Copyright © 2004 - 2019 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems