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: 

convertion

Former Member
0 Kudos
358

i am fetching some feilds from QAMV or PLMK (Characteristic specifications for inspection processing)

the feilds are SOLLWERT,TOLERANZOB, TOLERANZUN all are basically FLTP data type .

i am getting output as 1.8199999999999999E01 , 1.8000000000000000E01

i want to convert this to char value to print the equivalent value.

try to send the procedure or FM.

regards

vijay

6 REPLIES 6

rahulkavuri
Active Contributor
0 Kudos
142

hi use this FM

<b>HRCM_AMOUNT_TO_STRING CONVERT

CALL FUNCTION 'HRCM_AMOUNT_TO_STRING_CONVERT'

EXPORTING

BETRG = T_CURRPR

IMPORTING

STRING = T_CHAR.</b>

please award points if found helpful

0 Kudos
142

hi

this is not the amount feild

this feild will hold Upper Specification Limit,Lower Tolerance Limit.

try to give the FM now.

regards

vijay

0 Kudos
142
data: v_f type f value '1.8000000000000000E+01' .

write v_f exponent 0 decimals 0.

anversha_s
Active Contributor
0 Kudos
142

Hi vijay,

try this.

use this FM HRCM_STRING_TO_AMOUNT_CONVERT

pass the string , thousand separator,decimal separator, if it is currecy pass currecy key WAERS.

*********

DATA: v_qtr_field(7).
DATA: v_qtr_field2(7).
DATA: w_low_limit LIKE bkpf-monat,
      w_low_next  LIKE bkpf-monat,
      t_trans_values-dmbe2 LIKE glt0-hslvt,
w_amount LIKE glt0-hslvt,
w_max_period.
 
w_low_limit = 02.
w_max_period = 3.
CONCATENATE 'HSL' w_low_limit INTO v_qtr_field.
w_low_next = w_low_limit + 1.
CONCATENATE 'HSL' w_low_next INTO v_qtr_field2.
 
DO w_max_period TIMES
VARYING w_amount FROM v_qtr_field NEXT v_qtr_field2.
  t_trans_values-dmbe2 = t_trans_values-dmbe2 + w_amount.
ENDDO.

Regards

Anver

if hlped pls mark points

Former Member
0 Kudos
142

Hi,

Use the statement as below...

WRITE: <Field> EXPONENT 0 DECIMALS 0 TO <Some variable>.

Even i have the same issue and i used the above statement.

Regards,

Ram

Pls reward points if helpful....

0 Kudos
142

thanks a lot

regards

vijay