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: 

subroutine parameter issue

Former Member
0 Kudos

below is the code presented in the link: http://help.sap.com/saphelp_nw04/helpdata/en/9f/db979d35c111d1829f0000e829fbfe/frameset.htm

i do not see any difference in the usage of <b>USING </b>and <b>CHANGING </b>after executing that code. can someone tell me the difference. pls? newbie here. thanks for the help.

_____________________


data: A1 type P decimals 3,
      A2 type I,
      A3 type D,
      A4 type SPFLI-CARRID,
      A5(1) type C.

A1 = '1.23'.
A2 = 21.
A3 = '32.1'.
A5 = 'x'.

perform SUBR using A1 A2 A3 A4 A5.
perform SUBR changing A1 A2 A3 A4 A5.
perform SUBR using A1 A2 A3
             changing A4 A5.

form SUBR using
            VALUE(F1) type P
            VALUE(F2) type I
            F3        like A3
          changing
            VALUE(F4) type SPFLI-CARRID
            F5.

            write: / F1 , F2, F3, F4, F5 .
endform.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi jabbar.

variables which are written under USING can not be changed in form statement. only the variables which are written under CHANGING can be changed.

ex:-

a4 = '901.10'.

form SUBR using

VALUE(F1) type P

VALUE(F2) type I

F3 like A3

changing

VALUE(F4) type SPFLI-CARRID

F5.

f4 = '190.23'.

write: / F1 , F2, F3, F4, F5 .

endform.

3 REPLIES 3

Former Member
0 Kudos

hi jabbar.

variables which are written under USING can not be changed in form statement. only the variables which are written under CHANGING can be changed.

ex:-

a4 = '901.10'.

form SUBR using

VALUE(F1) type P

VALUE(F2) type I

F3 like A3

changing

VALUE(F4) type SPFLI-CARRID

F5.

f4 = '190.23'.

write: / F1 , F2, F3, F4, F5 .

endform.

Former Member
0 Kudos

Hi Jabbar,

Both USING and CHANGING serve the same purpose.It is only fordevelopers understanding.SAP advises to use changing only when the variable is getting changed inside FORM

Raghu

Former Member
0 Kudos

<b>thanks guys! </b>i gave points.