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

Function module help requried

Former Member
0 Likes
788

Hi Guys,

I develop a function module to sum of two float values.

so in import parameters i declare two variables with float data types in function modue as below

number1 type float

number2 type float

other variable to hold sum of two above variables as below

result type float

in source code

result = number1 + number2.

but if i pass values of two variables(number1,number2) as 5 , 5

result = 1.000000(where as result shoudl be 10.0000)

and also i can't pass more than one digit value for variables

pls suggest me where can i declare float variables size in import and export tabs of fucntion moduel.

6 REPLIES 6
Read only

Former Member
0 Likes
769

Hi,

Use any existing data element to define the import export parameters. There are so many standard data elements...

Hope this helps.

Regards,

Bharati

Read only

Former Member
0 Likes
769

Hi,

I can't use standard data elements.

i want to declare it as folat only.

so please suggest me where can i declare size of variable in import and export tabs in function module

Read only

Former Member
0 Likes
769

Check your result - it should be 1.0000000000000000E+01

Rob

Read only

0 Likes
769

yes, result i'm getting 1,000000000000000E+01(as suppose to show it as 10)

Edited by: venkat venkata on Jan 7, 2009 7:27 PM

Read only

0 Likes
769

Then don't declare it as float!

Or after it is returned, assign it to a non-float field!!

Rob

Edited by: Rob Burbank on Jan 7, 2009 1:30 PM

Read only

0 Likes
769

Hi,

Result is absoluteky fine, either you can add some different format in write statement for the desirable output or you can assign the total to non float variable and test the result as explained above.

Various output options can be

write: sum exponenet 1 decimal 2

etc.

Do f1 on write for various other options.

Pooja