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

help with code

Former Member
0 Likes
680

Hi all,

Iam getting two warning saying at the lines with write statment

Statement not acessible and even when i activate it with warnings i don't get any o/p i tried in debugging after first form find_sum its just comes out

data : num1 type i ,

num2 type i.

num1 = 7.

num2 = 10.

perform find_sum using num1 num2.

form find_sum using num1 type i num2 type i.

num1 = num1 + num2.

endform.

write num1. "out put will be 7 itself.

*********changing**********

perform find_sum1 changing num1 num2.

form find_sum1 changing num1 num2.

num1 = num1 + num2.

endform.

write num1. "out put will be 17.

Thanks

Kajol

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
658

Change the code as below,

data : num1 type i ,

num2 type i.

num1 = 7.

num2 = 10.

<b>perform find_sum using num1 num2.

write num1. "out put will be 7 itself.

write num1. "out put will be 17.</b>

perform find_sum1 changing num1 num2.

form find_sum using num1 type i num2 type i.

num1 = num1 + num2.

endform.

*********changing**********

form find_sum1 changing num1 num2.

num1 = num1 + num2.

endform.

Now u will not get warnings.

Reward if helpful.

4 REPLIES 4
Read only

Former Member
0 Likes
659

Change the code as below,

data : num1 type i ,

num2 type i.

num1 = 7.

num2 = 10.

<b>perform find_sum using num1 num2.

write num1. "out put will be 7 itself.

write num1. "out put will be 17.</b>

perform find_sum1 changing num1 num2.

form find_sum using num1 type i num2 type i.

num1 = num1 + num2.

endform.

*********changing**********

form find_sum1 changing num1 num2.

num1 = num1 + num2.

endform.

Now u will not get warnings.

Reward if helpful.

Read only

Former Member
0 Likes
656

You should move the write statement directly after the perform statement and before the actual form.

perform find_sum using num1 num2.

write num1. "out put will be 7 itself.

form find_sum using num1 type i num2 type i.

num1 = num1 + num2.

endform.

Read only

Former Member
0 Likes
656

hi,

U need to use the write statements within the form and endform.

Try it.

Read only

0 Likes
656

Thanks all