‎2007 Apr 27 9:38 AM
hi,
function module for converting digit to total no of digit in number..
for example 5 -
> 10000
6 -
> 100000
7 -
> 1000000
11 -
> 10000000000
number will be int only.
‎2007 Apr 27 9:46 AM
Hello Deepak,
I don't know is there a FM for ur requirement.
But try this code:
REPORT ZV_TEST41 .
PARAMETERS: P_INDEX LIKE SY-INDEX.
DATA: CHAR(15).
DO P_INDEX TIMES.
IF SY-INDEX = 1.
CONCATENATE '1' '0' INTO CHAR.
ELSE.
CONCATENATE CHAR '0' INTO CHAR.
ENDIF.
ENDDO.
WRITE: CHAR.
REgards,
VAsanth
‎2007 Apr 27 9:40 AM
‎2007 Apr 27 9:44 AM
Hi Deepak
just execute this code it will give you the exact output
Parameter: w_int type i default 5.
data w_val type i.
*there is a simple way to achieve this
w_int = w_int - 1.
w_val = 10 ** w_int.
write : w_val.
Regards Rk
Message was edited by:
Rk Pasupuleti
‎2007 Apr 27 9:46 AM
Hello Deepak,
I don't know is there a FM for ur requirement.
But try this code:
REPORT ZV_TEST41 .
PARAMETERS: P_INDEX LIKE SY-INDEX.
DATA: CHAR(15).
DO P_INDEX TIMES.
IF SY-INDEX = 1.
CONCATENATE '1' '0' INTO CHAR.
ELSE.
CONCATENATE CHAR '0' INTO CHAR.
ENDIF.
ENDDO.
WRITE: CHAR.
REgards,
VAsanth
‎2007 Apr 27 10:26 AM
‎2007 Apr 27 9:47 AM
Are you looking for some CONVERSION_EXIT_*_OUTPUT ?
Try , SE37 > Enter "CONVERSION_EXIT_*" press F4 Key,
identify the FM you need.
Regards,
Vishal
‎2007 Apr 27 10:31 AM
or you can use the power operator.
REPORT ZTEST.
data: v_num type i.
parameter p_num(2) type n.
if p_num > 1.
p_num = p_num - 1.
v_num = 10 ** p_num.
endif.
write: v_num.