cancel
Showing results for 
Search instead for 
Did you mean: 

Rounding of decimals in Characteristic Value

sivashankar_b
Participant
0 Kudos

Hi all,

I have a requirement of Rounding decimals in Characteristic Value level.

For example,

If the characteristic value is 12.456 and required to be rounded off to 2nd decimal, then the result should be 12.46.

For this requirement i should not use ABAP Function Module. I should do it in SAP-VC.

Can anyone help me in this regard.

Regards,

B.Sivashankar

Accepted Solutions (1)

Accepted Solutions (1)

Ritz
Active Contributor
0 Kudos

B.Sivashankar,

yes you can easily do it using procedure , but i will appriciate if you can tell business requirement too.

why dont you ask user to input already rounded quantity? or you can use ABAP to round it .

let me explain you how to do it using a wrok around.

Create characterstic for which you need tghis value ,

ex NUMBER1 , data type number , decimal places 2

create another characterstic NUMBER2 , data type number, decimal places  3

create a dependency type procedure , with syntex below

$SELF.NUMBER1 = $SELF.NUMBER2

attach it to configuration profile of material.

now when you will assign 12.456 to NUMBER2 , characterstic NUMBER1 will display a value 12.46.

check and reply if it meet your requirement.

Thanks

Ritesh

sivashankar_b
Participant
0 Kudos

Ritesh,

Thank you for your reply.

Actually i had tried already with the steps u recommended.

But our requirement is we should not use any additional characteristics or ABAP function module.

Actually our Sales Person or Customer may enter their exact decimals.

For transferring this value (e.g) 12.456 as 12.46 to Routing operation description by using concatenation.

(e.g) Cut the Pipe 12.46 meters. This 12.46 will be passed from the characteristic.

Before passing this value, we will be using a function module to convert the NUM format to CHAR format.

Hence we require a solution to round off the decimals.

Regards,

B.Sivashankar.

Ritz
Active Contributor
0 Kudos

Sivashankar B wrote:

(e.g) Cut the Pipe 12.46 meters. This 12.46 will be passed from the characteristic.

Before passing this value, we will be using a function module to convert the NUM format to CHAR format.

then better idea is use some code in same functional module to do this conversion before passing actual values to routing .

Check and share if you find any other option.

Thanks

Ritesh

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

i am using the decimal value with data type and length is : dec 6,

i want to round this value, if .5 above then add +1 integer

i used ceil but it is not giving correct value,

and i check the ROUND also it is showing the same input value as output

can u give me suggestion plz

Ritz
Active Contributor
0 Kudos

B.Sivashankar,

i used ceil but it is not giving correct value,

and i check the ROUND also it is showing the same input value as output

can you please explain whats happeing while using Ceil or ROUND?

The easiest work aorund i already suggested you in my first reply.

if you dont want use this additional characterstic , go for a Function and attach it to your characterstic and it will work as per your wish.

below link will help you building a function.

http://help.sap.com/saphelp_erp60_sp/helpdata/en/92/58d455417011d189ec0000e81ddfac/frameset.htm

check out , it may help you.

Thanks

Ritesh