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

Conversion Exit for MENGE

Former Member
0 Likes
4,125

Hi,

I am looking for conversion exit to convert menge (Quantity) from 80.000 to

0000000080.000.

regards

arun

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,005

Hello,

Chekc this sample.



PARAMETERS: P_MENGE LIKE EKPO-MENGE.

DATA: LV_MENGE(20).
WRITE P_MENGE TO LV_MENGE.
SHIFT LV_MENGE RIGHT.
TRANSLATE LV_MENGE USING ' 0'.
WRITE: LV_MENGE.

Regards,

Vasanth

4 REPLIES 4
Read only

Former Member
0 Likes
2,006

Hello,

Chekc this sample.



PARAMETERS: P_MENGE LIKE EKPO-MENGE.

DATA: LV_MENGE(20).
WRITE P_MENGE TO LV_MENGE.
SHIFT LV_MENGE RIGHT.
TRANSLATE LV_MENGE USING ' 0'.
WRITE: LV_MENGE.

Regards,

Vasanth

Read only

Former Member
0 Likes
2,005

Check this as well.

In my opinion there is no conversion exit on menge .

We need to deal with this explicitly .

Execute the code .


DATA : brgew LIKE mara-brgew.

brgew = '12.063'.

DATA:val(18) TYPE c,
     in(13) TYPE n ,   " u can set ur desired length here 
     dec(6) TYPE c,
     a TYPE i.

a = trunc( brgew ).
in = a.
dec = frac( brgew ).

CONCATENATE in  dec+1(4) INTO val .

WRITE:/ val.

@vasanth

After longtime nice to see you back .

Regards,

Vijay

Read only

Former Member
0 Likes
2,005

Hi arun,

split lv_qty at '.' into lv_qty13
                                 lv_qty3.

 CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
             EXPORTING
                  INPUT  = lV_qty13
             IMPORTING
                  OUTPUT = lV_qty13.

   concatenate lv_qty13 lv_qty3 into lv_qty
                                        separated by '.'.

Finally lv_qty will have your required value. plz use the above code. If your problem is solved reward points. don't forget.

Thanks,

Suma.

Read only

Former Member
0 Likes
2,005

I think we cannot move the decimal to this .

DATA : brgew LIKE mara-brgew.  " std reference
concatenate '000123'  '000' into brgew separated by '.'.

vijay.