Tuesday, July 17, 2007

Data Declaration

Declare single value variable:
Variable can be declared by two ways, first by declaring based on data type, second by declared it refer to table field.


Data d_data1 TYPE type. " berdasarkan type data
Data d_data2 LIKE customer-customerno. " refer ke field tertentu

Data types:
C (character)
N (numeric)
D (date)
T (Time)
X (byte / hexadecimal)
I (integer)
P (packed number)
F (floating point number)

Internal Table
Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by line in memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays.
DATA: BEGIN OF t_report OCCURS 10,
field1 LIKE customer-customerno,
field2 TYPE I,
field3(20) TYPE C,
END OF t_report.

In above example, we define internal table contatin 3 fields, field-1 refer to field customer-customerno, field-2 type Integer, field-3 type character with field length 10 character. OCCURS 10 means that it reserve 10 line of memory at initialization, in run time memory will expand automatically when data exceed the limit.

3 comments:

seventyros said...

For a Excellent Online Resource for SAP EP and SAP Web Dynpro ABAP, Visit Learn SAP Online

ADmin said...

Essay writing is a much difficult task, but following certain steps would help make it easier for you here http://customwritings.ws. You just need to contact us and we assure you that your essay will be well-researched, informative and interesting at the same time.

yektek training said...

thanks for your post thank you