Monday, December 30, 2019

Repeating Values

Repeating Values


ABAP HANA 7.51 : Repeating Values
ABAP 7.51 provides new keyword REPEAT which can be used to repeating output. This can be effectively used in some of the scenario and reduce LOOPs and lines of code.
Sample Source Code – Variant 1:
Repeat_Var1_source
Output – Variant 1:
Repeat_Var1_output
Sample Source Code – Variant 2:
Repeat_Var2_source
Output – Variant 2:
Repeat_Var2_output
Sample Source Code – Variant 3 : Case of Error handling
Repeat take 2 arguments. Second argument “occ” has to be always positive value. In case when this can’t be handled, code throws an exception called “cx_sy_strg_par_val”.

Repeat_Var3_source
Error handing

Output – Variant 3:
Repeat_Var3_output

No comments:

Post a Comment