ABAP语法讲解五(WHERE语句).docVIP

  • 303
  • 0
  • 约 4页
  • 2017-05-29 发布于浙江
  • 举报
ABAP语法讲解五(WHERE语句)

WHERE Clause Variants: 1. ... WHERE cond 2. ... FOR ALL ENTRIES IN itab WHERE cond Effect If you specify a WHERE clause in the SELECT, OPEN CURSOR, UPDATE or DELETE statement, the system only selects records from the table or tables in the FROM clause that meet the logical condition cond in it. When you use OPEN SQL statements, the system uses automatic client handling by default. This means that, for a client-specific table, only data from the current client is processed. Specifying a condition for the client field in the WHERE clause does not make sense, and causes an error in the syntax check. If you switch off the automatic client handlign using the ... CLIENT SPECIFIED addition in the FROM clause, the client field is treated like a normal field, and you can then specify conditions for it normally in the WHERE clause. Notes If you have transparent tables that you often access without using the full primary key, or where you often sort the data in a sequence that is different to that of the primary key, you should consider creating a corresponding index. If you do not specify a WHERE condition in a selection, the system processes all table records in the current client. Variant 1 ... WHERE cond Effect Only selects the records that meet the WHERE condition cond. Example Displaying all Lufthansa flights: DATA: WA_SPFLI TYPE SPFLI. SELECT * FROM SPFLI INTO WA_SPFLI ?????? WHERE CARRID = LH. ??WRITE: / WA_SPFLI-CITYFROM, WA_SPFLI-CITYTO. ENDSELECT. Variant 2 ... FOR ALL ENTRIES IN itab WHERE cond Effect Only selects the records that meet the logical condition cond when each replacement symbol itab-f is replaced with the value of component f of the internal table itab for at least one line of the table. SELECT ... FOR ALL ENTRIES IN itab WHERE cond returns the union of the solution sets of all SELECT statements that would result if you wrote a separate statement for each line of the internal table replacing the symbol itab-f with the corr

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档