SAP ABAP Data Element O2ITERATION (BSP Element: Iteration over Element Content)
Hierarchy
SAP_BASIS (Software Component) SAP Basis Component
   BC-BSP (Application Component) Business Server Pages
     SBSP_DEVTAGLIB (Package) Development Environment Objects for Taglib Support
Basic Data
Data Element O2ITERATION
Short Description BSP Element: Iteration over Element Content  
Data Type
Category of Dictionary Type D   Domain
Type of Object Referenced     No Information
Domain / Name of Reference Type CHAR1    
Data Type CHAR   Character String 
Length 1    
Decimal Places 0    
Output Length 1    
Value Table      
Further Characteristics
Search Help: Name    
Search Help: Parameters    
Parameter ID   
Default Component name    
Change document    
No Input History    
Basic direction is set to LTR    
No BIDI Filtering    
Field Label
  Length  Field Label  
Short 10 Iteration 
Medium 19 Iteration 
Long 26 Iteration over Content 
Heading  
Documentation

Definition

Activate this option if the BSP element iterates over its content, that is implements a loop.

Use

You must also redefine the interface method DO_AT_ITERATION of the element handler class. In this method, which is executed at the end of an iteration, the return parameter RC controls whether the loop is ended(RC=CO_ELEMENT_DONE) or passed again(RC=CO_ELEMENT_CONTINUE).

Dependencies

Example

The <do> element is to run through its content as often as is specified in the "repeat" attribute:

<xyz:do repeat="10"> 
Hello World!
</xyz:do>

The implementation could read as follows (in the interface method DO_AT_BEGINNING, the "count" variable is to be initialized with the value of "repeat"):

METHOD IF_BSP_ELEMENT~DO_AT_ITERATION. 
IF count <> 0.
SUBTRACT 1 FROM count.
rc = CO_ELEMENT_CONTINUE.
ELSE.
rc = CO_ELEMENT_DONE.
ENDIF.
ENDMETHOD.
History
Last changed by/on SAP  20040312 
SAP Release Created in 620