cancel
Showing results for 
Search instead for 
Did you mean: 

round up price

Former Member
0 Kudos

Hi everyone,

I have to round up the price in condition.

I did the following setting.

(i)Maintain round up in condition type

(ii)Also maintain round up in pricing procedure

After above setting my price is rounding up for second digit,Like,

In place of 1.76,i am getting 1.8

But i want 2 in place of 1.8 (there should be no digit after decimal)

For above requirement,What setting I should do.

Regards

prabudh

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Try using function SD_VALUE_ROUND_WITH_RULE.

It is extremely easy to use, fill in a value type p.

You get back a value type p.

Only extra input is the rule.This you can find in table TVFRDR.

these are the possibilities:

In your case you would need to fill rule '0205'

RRULE BEZEI

0000 Round up/down to 0.01

0001 Round up/down to 0.05

0002 Round up/down to 0.10

0003 Round up/down to 0.25

0004 Round up/down to 0.50

0005 Round up/down to 1.00

0006 Round up/down to 5.00

0007 Round up/down to 10.00

0008 Round up/down to 25.00

0009 Round up/down to 50.00

0010 Round up/down to 100.00

0011 Round up/down to 250.00

0012 Round up/down to 500.00

0013 Round up/down to 1000.00

0100 Round down to 0.01

0101 Round down to 0.05

0102 Round down to 0.10

0103 Round down to 0.25

0104 Round down to 0.50

0105 Round down to 1.00

0106 Round down to 5.00

0107 Round down to 10.00

0108 Round down to 25.00

0109 Round down to 50.00

0110 Round down to 100.00

0111 Round down to 250.00

0112 Round down to 500.00

0113 Round down to 1000.00

0200 Round up to 0.01

0201 Round up to 0.05

0202 Round up to 0.10

0203 Round up to 0.25

0204 Round up to 0.50

0205 Round up to 1.00

0206 Round up to 5.00

0207 Round up to 10.00

0208 Round up to 25.00

0209 Round up to 50.00

0210 Round up to 100.00

0211 Round up to 250.00

0212 Round up to 500.00

0213 Round up to 1000.00

This should take care of your problem.

Former Member
0 Kudos

Modify the routine with the help of Abaper & apply the same to the Condition type in pricing procedure.

-


Include RV64A601

  • rounding rule for closest interger value

FORM FRM_KONDI_WERT_601.

  • data: da_xkwerx(15).

  • unpack xkwert to da_xkwerx.

*

  • move '00' to da_xkwerx+13.

*

*

*

  • pack da_xkwerx to xkwert.

data : lgort1 like lips-lgort .

data : d1(13) , d6(13) .

data : d2 type p decimals 2 .

data : d3 type p decimals 0 .

data : d4 type p decimals 2 .

data d5(2) .

data : d8(3) .

unpack xkwert to d1 .

d2 = d1 .

d3 = d2 .

unpack d3 to d6.

d5 = d6+11(2) .

if d5 >= 50 .

d8 = 100 - d5 .

d1 = d6 + d8 .

else .

d1 = d6 - d5 .

endif .

*pack d1 to xkwert .

select single lgort into lgort1 from lips where

vbeln = komp-vgbel and

posnr = komp-vgpos .

IF SY-SUBRC = 0 .

if lgort1 = 'JSTO'.

d1 = 0 .

pack d1 to xkwert.

else .

pack d1 to xkwert.

endif .

ELSE .

pack d1 to xkwert.

ENDIF .

-


This will definately resolve the issue. It is tried & tested on many occasions.

Regards,

Rajesh Banka

Former Member
0 Kudos

DearPrabudh,

You do not need to put up any ABAP Query for rounding off.

SAP has provided a standard condition type by name DIFF for the purpose of rounding. By using this condition type, the system will automatically round up if it is above .50 paise and rounds down if it is below .50

<b>Primarily the configuration is to be done th below way</b>.

In your Pricing Procedure, put the condition type <b>DIFF</b>, in a step above the step of total value. And give Requirement Type- <b>13</b> , calculation type- <b>16,</b> Base Type- <b>4.</b>

Please reward if it helps. I am confident it will surely help you.

regards,

Sridhar.P.

Former Member
0 Kudos

MAKE THE ROUNDING RULE IN THE CONFIGURATION OF THE CONDITION TYPE TO COMMERCIAL SO THAT U CAN GET THA VALUE TO 2 ISTEAD OF 1.8.

CHEERS

KIRAN

Former Member
0 Kudos

Gr8 Kiran,

Have u ever tried.... with my knowledge you need to write a routine to make 2/-.. bascially rounding rule takes in points.. as u said 1.76 makes 1.8... ask your abaper to make that 2/-...

reward if it helps

Ramki

Former Member
0 Kudos

i am really sorry ramki ur not suppose to misguid e people like me who feel SAP as bread and butter, i think u have given me the same answer yesterday

Former Member
0 Kudos

Dont be emotional man... iam sorry if u understood that way... we have not spoken abt decimals.. as of my knowledge, we just discussed that it makes round up, round down or commercial.. but not discussed abt decimals.. i hope now you are clear..

Love..

Ramki