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

fm

Former Member
0 Likes
389

hi friends ,

I created a simple function module so the import and export parameters are integers .

So when i enter any char or spl symbols it should raise the exeception .

any clues plz .........

thanks

deepti

2 REPLIES 2
Read only

Former Member
0 Likes
368

Hi Deepthi,

When you are defining it as integer and if you pass any char to the Import -export parameter you will get run time error.

To show error message using FM, define them of Char type and check in the FM if any char is passed show the error.

Regards,

Atish

Read only

0 Likes
368

When you are defining it as integer and if you pass any char to the Import -export parameter you will get run time error.

To show error message using FM, define them of Char type and check in the FM if any char is passed show the error.

hi..

In the source try to catch the input this passed and check whether its an interger or not

if its not an interger the raise the exception.

check this code hope this wld provide u some clue but this fm is for division and i have raised the exception when we use divide by 0

IF num2 = 0 .

  • RAISE num2_zero .

MESSAGE e001(zarc) WITH 'division by zero not possible' RAISING

num2_zero .

ENDIF.

result = num1 / num2.

ENDFUNCTION.