Using this program you can bring the Indian current format into reports, smartforms, table update.
REPORT zamount_conversion.
DATA : result1(20).
PARAMETERS : num TYPE p DECIMALS 2.
DATA : num2 TYPE string.
DATA : col_amt(20) TYPE n,"15
col_b TYPE i,
num_1(20) TYPE c,"15
length TYPE i.
num_1 = num.
WRITE : 'default format :',num.
ULINE.
SKIP.
IF ( num >= 999999999 ).
WRITE num_1 USING EDIT MASK 'RR__,__,__,__,______' TO col_amt.
CONDENSE col_amt.
length = STRLEN( col_amt ).
IF length = 16.
REPLACE FIRST OCCURRENCE OF ',' IN col_amt WITH space.
WRITE :/'amount indian format:',col_amt.
ELSE.
WRITE :/'amount indian format:',col_amt.
ENDIF.
ELSEIF num < 999999999 AND num >= 9999999.
WRITE num_1 USING EDIT MASK 'RR__,__,__,______' TO col_amt.
CONDENSE col_amt .
length = STRLEN( col_amt ).
IF length = 13.
REPLACE FIRST OCCURRENCE OF ',' IN col_amt WITH space.
WRITE :/'amount indian format:',col_amt.
ELSE.
WRITE :/'amount indian format:',col_amt.
ENDIF.
ELSEIF num < 9999999 AND num >= 99999.
WRITE num_1 USING EDIT MASK 'RR__,__,______' TO col_amt.
CONDENSE col_amt .
length = STRLEN( col_amt ).
WRITE :/'amount indian format:',col_amt.
ELSEIF num < 99999.
DATA : dumy(10) TYPE c.
dumy = num .
CONDENSE dumy.
length = STRLEN( dumy ).
IF length <= 6.
WRITE :/'amount indian format:',num.
ELSE.
WRITE num_1 USING EDIT MASK 'RR__,______' TO col_amt.
WRITE :/'amount indian format:',col_amt.
ENDIF.
ENDIF.
ULINE.
Input Screen:
REPORT zamount_conversion.
DATA : result1(20).
PARAMETERS : num TYPE p DECIMALS 2.
DATA : num2 TYPE string.
DATA : col_amt(20) TYPE n,"15
col_b TYPE i,
num_1(20) TYPE c,"15
length TYPE i.
num_1 = num.
WRITE : 'default format :',num.
ULINE.
SKIP.
IF ( num >= 999999999 ).
WRITE num_1 USING EDIT MASK 'RR__,__,__,__,______' TO col_amt.
CONDENSE col_amt.
length = STRLEN( col_amt ).
IF length = 16.
REPLACE FIRST OCCURRENCE OF ',' IN col_amt WITH space.
WRITE :/'amount indian format:',col_amt.
ELSE.
WRITE :/'amount indian format:',col_amt.
ENDIF.
ELSEIF num < 999999999 AND num >= 9999999.
WRITE num_1 USING EDIT MASK 'RR__,__,__,______' TO col_amt.
CONDENSE col_amt .
length = STRLEN( col_amt ).
IF length = 13.
REPLACE FIRST OCCURRENCE OF ',' IN col_amt WITH space.
WRITE :/'amount indian format:',col_amt.
ELSE.
WRITE :/'amount indian format:',col_amt.
ENDIF.
ELSEIF num < 9999999 AND num >= 99999.
WRITE num_1 USING EDIT MASK 'RR__,__,______' TO col_amt.
CONDENSE col_amt .
length = STRLEN( col_amt ).
WRITE :/'amount indian format:',col_amt.
ELSEIF num < 99999.
DATA : dumy(10) TYPE c.
dumy = num .
CONDENSE dumy.
length = STRLEN( dumy ).
IF length <= 6.
WRITE :/'amount indian format:',num.
ELSE.
WRITE num_1 USING EDIT MASK 'RR__,______' TO col_amt.
WRITE :/'amount indian format:',col_amt.
ENDIF.
ENDIF.
ULINE.
Input Screen:
Output Screen: