It was an interesting problem.
Here is a working snippet using recursion.
DATA gv_output TYPE string.
PARAMETERS p_num TYPE i.
PERFORM get_data USING p_num
CHANGING gv_output.
WRITE:/ gv_output.
* FORM to determine output in a recursive manner
FORM get_data USING pv_input TYPE i
CHANGING cv_output TYPE string.
DATA lv_div TYPE i.
DATA lv_rem TYPE i.
CHECK pv_input GT 0.
lv_div = pv_input DIV 26.
lv_rem = pv_input MOD 26.
IF lv_rem IS INITIAL.
lv_rem = 26.
SUBTRACT 1 FROM lv_div.
ENDIF.
SUBTRACT 1 FROM lv_rem.
CONCATENATE sy-abcde+lv_rem(1) cv_output INTO cv_output.
PERFORM get_data USING lv_div
CHANGING cv_output.
ENDFORM. "get_data
Add a comment