Ansicht
Dokumentation

ABENCOND_ITERATION_REDUCE_ABEXA - COND ITERATION REDUCE ABEXA

ABENCOND_ITERATION_REDUCE_ABEXA - COND ITERATION REDUCE ABEXA

ABAP Short Reference   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.
SAP E-Book

Creating Values with FOR and REDUCE

This example demonstrates conditional iterations with the operator REDUCE.

Source Code

Execute

Description

This example demonstrates the following simple iterations, which can be used to construct elementary data objects and directly display them in a constructor expression using the reduction operator REDUCE:

  • The first expression constructs a value of the type i for which the total of the iteration variable n is calculated. n is numeric, which means that THEN does not have to be specified. Each iteration step increases the value of n by 1.
  • The second expression uses the same iteration as the first, but constructs a text string to which each iteration step appends the character representation of n.
  • Like the second expression, the third expression constructs a text string, but uses the addition THEN explicitly to decrement the iteration variable instead of incrementing it.
  • Finally, the fourth expression shows that the iteration variable does not have to be numeric. In this case, THEN must be specified explicitly with a suitable expression. Here, a text string is made longer until it has reached a specific size.





PERFORM Short Reference   General Data in Customer Master  
This documentation is copyright by SAP AG.

Length: 1754 Date: 20240426 Time: 144059     sap01-206 ( 39 ms )