SAP Certification
SAP Download
SAP Companies India
SAP Books
SAP JOBS
SAP jobs in India
SAP ABAP jobs in India
SAP BASIS jobs in India
SAP BI jobs in India
SAP CRM jobs in India
SAP FICO jobs in India
SAP Fresher jobs in India
SAP HR jobs in India
SAP MM jobs in India
SAP PM jobs in India
SAP PP jobs in India
SAP SD jobs in India
SAP XI jobs in India
|
TABLES is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details.
Show Full Details
TABLES
Basic form TABLES dbtab.
Effect Makes the database table , view or structure dbtab known to the program. These objects are created by selecting Development -> ABAP/4 Dictionary . This transaction automatically defines an identical field string - the table work area - in the program. The names and the sequence of the fields of the table work area dbtab correspond exactly to the names and the sequence of the fields when declaring the database table or view in the ABAP/4 Dictionary . The ABAP/4 data type (see DATA ) and the length of the fields are derived from the data types in the ABAP/4 Dictionary as follows:
| Dict. data type |
ABAP/4 data type |
| ACCP |
-> N(6) |
| CHAR n |
-> C(n) |
| CLNT |
-> C(3) |
| CUKY |
-> C(5) |
| CURR n, m, s |
-> P((n + 2) / 2) DECIMALS m [NO-SIGN] |
| DEC n, m, s |
-> P((n + 2) / 2) DECIMALS m [NO-SIGN] |
| DATS |
-> D |
| FLTP |
-> F |
| INT1 |
-> No correspondence |
| INT2 |
-> No correspondence |
| INT4 |
-> I |
| LCHR n |
-> C(n) |
| LRAW n |
-> X(n) |
| LANG |
-> C(1) |
| NUMC n |
-> N(n) |
| PREC |
-> X(2) |
| QUAN n, m, s |
-> P((n + 2) / 2) DECIMALS m [NO-SIGN] |
| RAW n |
-> X(n) |
| TIMS |
-> T |
| UNIT n |
-> C(n) |
| VARC n |
-> C(n) | The fields of the table work area are set to the initial values for their ABAP/4 data types (see DATA ). For the ABAP/4 Dictionary data types INT1 and INT2 , whole number fields of length 1 or 2 are created with the initial value 0 in the table work area.
The length of the table work area is not just the sum of the lengths of the individual fields. Depending on how different fields have to be aligned (Alignment ), the structure can contain nameless "holes".
Example
TABLES SPFLI.
SELECT * FROM SPFLI. WRITE: / SPFLI-CARRID, SPFLI-CONNID. ENDSELECT.
Notes You can display the structure of the table work area in the ABAP/4 Editor by double-clicking on the table name.
The divisions for determining ABAP/4 field lengths are whole number divisions without rounding. The field of the table work area can accept numbers which contain one digit more than the ABAP/4 Dictionary data type allows. Such a situation results in a runtime error when writing to the database.
The table work area always has a global validity area. Even if the TABLES statement is specified in a FORM or FUNCTION , the work area is known when the subroutine has been defined. However, changes to the work area in a subroutine remain local to the FORM or FUNCTION . Therefore, it is advisable to specify the TABLES statement globally. You can keep changes to the table work area local to the subroutine with LOCAL .
Show Most Readed SAP Tutorials
Most readed SAP Tutorials
Show Latest Added SAP Tutorials
Latest Added SAP documents
|
"Site covers most of the SAP technical and functional tutorials, articles, interview questions and PDF study materials . List and details of SAP transaction codes ( tcodes ), Tables, report names, Bapi, ABAP programming syntax and keywords are also available in the site.
Information on SAP Certification and training, latest SAP jobs in India, ABAP interview questions are useful for SAP professionals seeking for a career in SAP as a fresher or experienced.ABAP tutorial downloads on BDC, LSMW, BAPI, ALE, IDOC, Smartforms, Sapscripts etc etc are also added.Now you can read from this page about TABLES ( SAP ABAP Keyword)" |