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

Rounding Thousand

Former Member
0 Likes
524

create function module with following steps

Step1. V_IN TYPE WERTV8

FLAG TYPE CHAR1

Step2. V_OUT TYPE WERTV8

Step3.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(V_IN) TYPE ZCAP_DRAWN

*" REFERENCE(FLAG) TYPE CHAR1

*" EXPORTING

*" REFERENCE(V_OUT) TYPE ZCAP_DRAWN

*"----


DATA: V_1 TYPE P,

V_2 TYPE P.

DATA: V_DELTA1 TYPE P,

V_DELTA2 TYPE P.

V_1 = V_IN DIV 1000.

V_DELTA1 = ABS( V_1 * 1000 - V_IN ).

*Sharad Dixit

V_2 = V_1 + 1.

V_DELTA2 = V_2 * 1000 - V_IN.

IF FLAG = SPACE.

IF V_DELTA1 < V_DELTA2.

V_OUT = V_1 * 1000.

ELSE.

V_OUT = V_2 * 1000.

ENDIF.

ELSE.

V_OUT = V_1 * 1000.

ENDIF.

Modeator Message: Ask a question with complete details. Search before you post a FAQ.

Edited by: kishan P on Feb 18, 2011 4:11 PM

2 REPLIES 2
Read only

Former Member
0 Likes
486

Would be more helpful if you say what you getting now and what you looking for?

Edited by: BrightSide on Feb 18, 2011 9:43 AM

Read only

Former Member
0 Likes
486

Actually I was looking for rounding thousand

I have a currency field:

where I can values -


Need to show the values

Input Field Output Field

1100.00 -- 1000.00

1600.00 -- 2000.00

5465.00 -- 5000.00

5999.00 -- 6000.00

11003.00 -- 11000.00

26798.00 -- 27000.00