Você está na página 1de 29

1

INTO Clause to specify the target variable to which the data record is to be copied. Left-justified, the target area must be structured like the table row or the specified required fields of the row

INTO Clause the target structure variable should be of the same structure as that of the field list -only the corresponding field types have to match, not the field names -the names of the target structure fields are not taken into account (ONLY for this syntax) ALTERNATE SPECIFICATION INTO (field_1, .., field_n)

If the target list has a different structure/order of fields than the fields that are being retrieved from the DB, then we use this command Only the fields with the SAME NAME in the target structure are filled up The target field types should be of the same type as the fields being read from DB, if not, a complex type conversion happens (Like in a MOVE statement). This might result in the incomplete (data cut of) transport of data to the target fields

Advantages of this variant


The target structure need not be left justified in the same way as the field list This construction is easy to maintain, since extending the field list or target structure does not require other changes to be made to the program

The INTO TABLE clause helps to copy the multiple rows of the DB into an itab directly instead of row-by-row This is not a type of LOOP Processing and hence and ENDSELECT statement is not required/allowed With the Array Fetch, any existing rows in the internal table are overwritten. If you want to append the rows instead, then use the APPENDING TABLE addition

10

11

12

13

14

15

16

17

18

19

If a join expression is used, the SELECT command circumvents SAP buffering. a maximum of 24 join expressions that join 25 database tables or views with each other can be specified after FROM. INNER JOIN: The inner join joins the columns of every selected line on the left- hand side with the columns of all lines on the right-hand side that jointly fulfil the join_cond condition. A line in the resulting set is created for every such line on the righthand side. The content of the column on the left-hand side may be duplicated in this case. If none of the lines on the right-hand side fulfils the join_cond condition, no line is created in the resulting set LEFT OUTER JOIN: The outer join basically creates the same resulting set as the inner join, with the difference that at least one line is created in the resulting set for every selected line on the left-hand side, even if no line on the righthand side fulfils the join_cond condition. The columns on the right-hand side that do not fulfil the join_cond condition are filled with null values

20

21

22

LDB: Logical databases are special ABAP programs that retrieve data and make it available to application programs. The most common use of logical databases is still to read data from database tables by linking them to executable ABAP programs. call logical databases using the function module LDB_PROCESS. This allows you to call several logical databases from any ABAP program, nested in any way. A logical database provides a particular view of database tables in the R/3 System. It is always worth using logical databases if the structure of the data that you want to read corresponds to a view available through a logical database. Use tcode SE36 to create LDB BAPI-Methods of business objects with READ function, for example

23

24

25

26

27

28

29

Você também pode gostar