Ansicht
Dokumentation
ABENFOR_COND - FOR COND
General Data in Customer Master Vendor Master (General Section)This documentation is copyright by SAP AG.
FOR, cond
... $[USING KEY keyname$]
$[FROM idx1$] $[TO idx2$] $[STEP n$]
$[WHERE ( log_exp )$|(cond_syntax)$] ...
Effect
As with LOOP AT itab, the following is possible for each expression FOR ... IN itab and FOR GROUPS ... OF of a constructor expression:
- USING KEY can be used to specify the table key with which the table is evaluated.
- FROM and TO can be used as upper and lower limits to restrict the lines in the table index used.
- STEP can be used to define the step size and loop order for processing the internal table.
- WHERE can be used to specify static or dynamic conditions for column content.
The syntax and semantics are exactly the same as in LOOP AT itab, apart from the fact that a statically specified logical expression log_exp in the WHERE condition must always be placed in parentheses.
In the expression FOR ... IN GROUP group, only static WHERE conditions can be specified for cond.
Notes
- The local auxiliary variables of the expression visible in this position can be used for idx1, idx2, and in the logical expression of the WHERE condition.
- The pseudo component table_line can be used in the logical expression of the WHERE condition.
Example
The example shows how the same result can be achieved with a WHERE condition in an iteration expression and the filter operator FILTER. The shorter filter expression is usually more suitable in this case.
CPI1466 during Backup TXBHW - Original Tax Base Amount in Local Currency
This documentation is copyright by SAP AG.
Length: 2703 Date: 20240419 Time: 205315 sap01-206 ( 37 ms )