sapdev logo background
sapdev logo sapdev logo
Comments

SAP REPEAT FUNCTIONS documentation, setup help and example usage



Return to SAP documentation index


ARTICLE

repeat - Repeat Function

Syntax
... repeat( val = text occ = occ ) ...

Effect
This function returns a character string that contains the content of text as many times as specified in occ . If text is an empty string or if occ contains the value 0, an empty string is returned.
occ is a numerical expression position of type i . If the value of occ is negative, an exception of the class CX_SY_STRG_PAR_VAL is raised.
The return code has the type string .

Note
The parameter occ has a different meaning here than in functions used for searching.

Example
The function repeat is used to create a string with ten blanks.
result = repeat( val = ` ` occ = 10 ).



Runtime Exceptions

Catchable Exceptions
CX_SY_STRG_PAR_VAL
Reason for error: Occurrences in occ are less than 0.
Runtime error: STRG_ILLEGAL_PAR
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved








comments powered by Disqus