Original post address: http://fuhesap.com/SAP/179.html
Shift STR Left deleting leading '0 '.
If layout does not display the preceding 0 format: & field (ZC )&
If layout does not display the 0 format after the decimal point: & field (. 0 )&
Go, no.
Report z_m.
Data curr type C.
Curr = '000000 '.
While sy-subrc = 0.
Replace ',' with ''into curr.
Endwhile.
Condense curr no-gaps.
Remove the backend 0.
Data p_number (20) value '56. 500 '.
Call function 'string _ reverse'
Exporting
String = p_number
Lang = '1'
Importing
Rstring = p_number
Exceptions
Too_small = 1
Others = 2
.
If sy-subrc <> 0.
Message ID SY-MSGID type SY-MSGTY number SY-MSGNO
With SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
Endif.
Shift p_number Left deleting leading '0 '.
Call function 'string _ reverse'
Exporting
String = p_number
Lang = '1'
Importing
Rstring = p_number
Exceptions
Too_small = 1
Others = 2
.
If sy-subrc <> 0.
Message ID SY-MSGID type SY-MSGTY number SY-MSGNO
With SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
Endif.
Write:/p_number.