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: 

help with code

Former Member
0 Kudos
209

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

Former Member
0 Kudos
187

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

Former Member
0 Kudos
188

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.

Former Member
0 Kudos
185

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.

Former Member
0 Kudos
185

hi,

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

Try it.

0 Kudos
185

Thanks all