Remove suffix 0 in SAP

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.