fields, According tp the fileds required from the Corresponding database tabless!. T"#$% & '$(I) *+ ,T"- +1 T"#$ ,.ef. Datatype- , +/ T"#$ ,.ef. Datatype- , +0 T"#$ ,.ef. Datatype- , 1 $)D *+ ,T"-. )*T$& T"#$% is to define user defined Datatype. 1. Declare Internal Table i.e. Array of abo2e structure.DATA ,ITA'- T"#$ TA'3$ *+ ,T"-. EXAMPLE: Declare an ITA' to maintain data from table T441 Company Code Data! )*T$& 5hile Declaring ,ITA'-, refer the corresponding database table i.e. T441 here. 1 / 0 6 7 8 9 : ; 1 4 1 1 1 / 1 0 1 6 1 7 1 8 1 9 *Declare the required datatypes
TYPES : BEGIN OF TY_T00!
B"#$S TYPE B"#$S! %&'(pa)y &'de
B"T*T TYPE B"T*T! %&'(ap)y Na(e
O$T0 TYPE O$T0! %&ity
+,ND TYPE +,ND! %&'u)try #ey
END OF TY_T00-
*Declare I)ter)al Ta.le /r'( a.'0e structure
D,T, IT_T00 TYPE T,B+E OF TY_T00- %ynta< to select the Data from Database table into Internal table& %$3$CT ,+1-, ,+/-, ,+0-, 11.. I)T* TA'3$ ,ITA'- +.*= ,D'T- 5>$.$ ,Condition if Any-. )*T$& =a?e sure that the structure order! of the fields in the %$3$CT and Internal table should be same, because the content if 1 st filed in %$3$CT is transferred to the 1 st filed of ,ITA'- and similarly / nd , 0 rd etc. EXAMPLE: Display the 3ist of (erman Companies@s Details Company Code, name, city, Country! from T441. 1 / 0 6 7 8 9 : ; 1 4 1 1 1 / 1 0 1 6 1 7 1 8 1 9 1 *Declare the $equired Datatype
23E$E +,ND 4 5DE5- %Ger(a)y &'de )*T$& After the %$3$CT data from database table is transferred to Internal table. ADisplay data in Internal Table A%ince data in Internal table is %orted record by record, AccessingBDisplaying Data from Internal table is also record by recoord. %o that there is a special loop which starts with the 1 st
record and ends with the second record of ,ITA'- by default.. ACeep the Internal table in a 3**#, 3**# points to the first record by default and collect it into ,5A- and process #rint! the data from ,5A-. $a<mple using D'AC table. 1 / 0 6 7 $EPO$T 67,1P$OG$,189-