Application Development and Automation 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: 
Read only

decimal places conversion

Former Member
0 Likes
759

Hello !

I have a field namend s_vmeng (Call Quantity in Sales Unit of Measure).

Its length is 15 and decimal places are 3.

When I insert e.g 345 into s_vmeng it converts automatically

to 345,000. How can I reach that my input remains 345.

I konw I can divide into 1000. But my question is

where can I do this division. Within select-options declaration ore

else where other ?

Regrads

Ilhan

SELECT-OPTIONS:

s_vmeng FOR VMENG NO-EXTENSION NO INTERVALS.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
659

hi,


at selection-screen.
 s_vmeng-low =  s_vmeng-low / 1000.
 modify s_vmeng.

5 REPLIES 5
Read only

Former Member
0 Likes
660

hi,


at selection-screen.
 s_vmeng-low =  s_vmeng-low / 1000.
 modify s_vmeng.

Read only

Former Member
0 Likes
659

Hello,


data: wa_input  type i,      
      wa_output type i.
 
wa_input = '1.000'.
 
CALL FUNCTION 'ROUND'  
  EXPORTING    
    INPUT              = wa_input 
  IMPORTING   
    OUTPUT             = wa_output
  EXCEPTIONS
   INPUT_INVALID       = 1
   OVERFLOW            = 2
   TYPE_INVALID        = 3
   OTHERS              = 4.
 
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:/ wa_output.


Regards,

Vasanth

Read only

Former Member
0 Likes
659

its correct only

345,000

since this is a packed decimal it will display decimals as .000 in ur system it may be , for the separator .

345 is displaying to u as 345,000

this is <b>000</b> decimals 3 .

No need to divide for this stuff .

If u have assigned a character variable for this then it would have displayed 345 alone but since its dataype packed its displaying with decimals

???

Execute the code...

<b>tables : ekpo.

select-options : s_vmeng for ekpo-menge .

initialization .

s_vmeng-low = '345'.

append s_vmeng.</b>

regards,

vijay.

Read only

Former Member
0 Likes
659

hi IIhan

use function module in

DATA: vmeng(5) TYPE p DECIMALS 3,

vcmeng(8) TYPE c.

SELECT-OPTIONS : s_vmeng FOR vmeng NO-EXTENSION NO INTERVALS .

AT SELECTION-SCREEN .

vcmeng = s_vmeng-low.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = vcmeng

IMPORTING

output = vcmeng.

START-OF-SELECTION.

WRITE: / vcmeng.

**Reward all the helpful answers***

With Regards

Navin Khedikar

Read only

Former Member
0 Likes
659

HI

Sorry for first one Please check it

DATA: vmeng(15) TYPE p DECIMALS 3.

SELECT-OPTIONS : s_vmeng FOR vmeng NO-EXTENSION NO INTERVALS .

AT SELECTION-SCREEN .

s_vmeng-low = s_vmeng-low / 1000.

MODIFY s_vmeng.

**Reward all the helpful answers***

With Regards

Navin Khedikar