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: 

Rounding off net weight value.

Former Member
0 Kudos
815

Hi experts,

I want to round off the quantity value to the next integer value.

I am using the FM 'J_1I6_ROUND_TO_NEAREST_AMT' as follows...

call function 'J_1I6_ROUND_TO_NEAREST_AMT'

exporting

i_amount = gross_weight

i_amount1 = net_weight

importing

e_amount = gross_weight

e_amount1 = net_weight.

i want to round off the gross weight and net weight values.

In Global definitions, these are given as of type VEKP-BRGEW. The field BRGEW is of datatype QUAN (length - 15 and decimal -3 )

But when i tried executing i am getting dump .... saying

"The function module interface allows you to specify only

fields of a particular type under "I_AMOUNT".

The field "GROSS_WEIGHT" specified here is a different field type"

Please help me solve this and please let me know how to round off these fields.

Regards

Ammu

1 ACCEPTED SOLUTION

nabheetscn
Active Contributor
0 Kudos
356

Make sure the data type of the function module parameters as well as the your variable are of same type. It is happening.I_AMOUNT is of different type type as compared of GROSS_AMOUNT. Declare a local variable of type GROSS_AMOUNT type and assign the I_AMOUNT to it and pass to FM>

Nabheet

9 REPLIES 9

nabheetscn
Active Contributor
0 Kudos
357

Make sure the data type of the function module parameters as well as the your variable are of same type. It is happening.I_AMOUNT is of different type type as compared of GROSS_AMOUNT. Declare a local variable of type GROSS_AMOUNT type and assign the I_AMOUNT to it and pass to FM>

Nabheet

former_member195402
Active Contributor
0 Kudos
356

Hi,

the both fm parameters you fill have a currency data element of length 13, while you pass a quantity data element of length 15.

You can't use this fm for your fields.

Regards,

Klaus

0 Kudos
356

Hi Klaus,

Do you know any FM which can be used for these fields or any other way where i can round off the values, as mentioned.

Regards,

Ammu

Former Member
0 Kudos
356

Hi,

My requirement is that the quantity should always be rounded off to the next higher integer.

ie when the weight = 12.111, it should be rounded off to 13.

Please advice.

Regards,

Ammu

0 Kudos
356

Once your dump is gone it will do round off.

Nabheet

Former Member
0 Kudos
356

Hi

Thanks a lot everybody.

I just used ceil function.

Regards,

Ammu

0 Kudos
356

Hi Nair,

I actual new to this , can u please let me know the difference b/w ceil and floor function .

thanks

siva

0 Kudos
356

Hi Siva,

Ceil gives the Smallest integer value not smaller than the argument.

and

Floor gives the Largest integer value not larger than the argument.

Regards,

Ammu

Former Member
0 Kudos
356

Hi,

Can somebody please let me know how to truncate the zeros also in decimal ?

I dont want the decimal itself.

As in, now the value is getting diplayed as 416.000

I want just 416.

Regards,

Ammu