Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

unable to delete trailing zeros after using the SHIFT DELETE logic

Former Member
0 Kudos

Hi Techies,

i have to requirement where i need to convert amount using : CUURENCY_SAP_BAPI .

Explained everything in the image .

1 ACCEPTED SOLUTION

custodio_deoliveira
Active Contributor
0 Kudos

It's not deleting because they are not  "trailing zeros". If you need only 2 decimals try:

WRITE tram_amt TO lv_string DECIMALS 2 LEFT-JUSTIFIED.


And define lv_string as char20, not as STRING.


Regards,

Custodio

3 REPLIES 3

custodio_deoliveira
Active Contributor
0 Kudos

It's not deleting because they are not  "trailing zeros". If you need only 2 decimals try:

WRITE tram_amt TO lv_string DECIMALS 2 LEFT-JUSTIFIED.


And define lv_string as char20, not as STRING.


Regards,

Custodio

0 Kudos

Hi 

shadab_maldar
Active Participant
0 Kudos

hi ajay,

Instead of shift deleting define the variable as below and pass the value in it.

DATA: lv_string TYPE char10 VALUE '251.2500',

       lv_str TYPE p DECIMALS 2.

       lv_str = lv_string.