ABAP/4 Defining Data Defining Data: –Data statement –Parameters statement –Tables statement –Constants statement –Data statement to define field strings –User defined Data types –Type-pools
ABAP/4 Defining Data Defining Variables: –Data statement data f1(2) type c. data f2 like f1. data : max_value type I value 100, cur_date type d value ‘ ’ –Parameters statement Special type of variable that will accept input from user. –Parameters p1(2) type c. –Parameters cur_date type d default ‘ ’ obligatory.
ABAP/4 Defining Data Data types –Character and Numeric Character Data types Data Type Internal Description Default Internal Length Max Internal Length Valid Values Default Initial Value ccharacter165535Any charBlank nNumeric text ddate8 (fixed) ttime6 (fixed) xhexadecimal165535Any
ABAP/4 Defining Data Data types –Character and Numeric Numeric Data types Use integers for simple computations, counters, indexes etc Floating point for very large values or many decimal places. Data Type Internal Description Default Internal Length Max Length/ Dec Valid Values Default Initial Value Iinteger4(fixed)- / to PPacked decimal 816 / FFloating point 822 / 15* -E-307 to 1E
ABAP/4 Defining Data Defining constants: –Identical to a variable except that its value cannot be changed. –Constants c1(2) type c value ‘AA’. –Constants c2 like c1 value ‘BB’ Defining Field strings: Type of variable, equivalent structure in DDIC but is defined within ABAP program Has global and local visibility. –Data: begin of totals, region(7) value ‘unknown’, debits(15) type p, count type I, end of totals. Totals-debits = 100. Totals-counts = 10.
ABAP/4 Defining Data Using Tables statement to define a field string. Has global and external visibility no matter where it is placed in the program. –Tables ztxlfa1. –Ztxlfa1-name1 = ‘Bugsy’. –Ztxlfa1-land1 = ‘US’. User defined types: –Types : dollars(16) type p decimals 2. –Data : petty_cash type dollars, – Pay_outs type dollars, – lump_sums type dollars.
ABAP/4 Defining Data Using Type groups (Type-pool) to define types or constants. –Data Dictionary object that contains one or more types or constants statements. –Multiple programs can share a type group.