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: 

Sub-routines

Former Member
0 Kudos

Hi SAP gurus,

Can any one explain me the sub-routine using the formal parameters using and changing such as "PERFORM SAMPLE USING a CHANGING b" .

Please explain me with an simple example.

Vishnu.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

check this <a href="http://help.sap.com/saphelp_erp2005/helpdata/en/9f/db977635c111d1829f0000e829fbfe/frameset.htm">link</a>

4 REPLIES 4

Former Member
0 Kudos

check this <a href="http://help.sap.com/saphelp_erp2005/helpdata/en/9f/db977635c111d1829f0000e829fbfe/frameset.htm">link</a>

Former Member
0 Kudos

when refer passing,they using is the same as changing

but value passing is different,using is only value passing and changing is value and

resault passing,

maybe this can help you!

REPORT z_szq_test.

DATA:inter1 TYPE i,

inter2 TYPE i,

sum TYPE i.

START-OF-SELECTION.

inter1 = 2.

inter2 = 6.

PERFORM sum USING: inter1

inter2

sum.

WRITE:/ sum LEFT-JUSTIFIED.

CLEAR:sum.

PERFORM sum1 CHANGING inter1

inter2

sum.

WRITE:/ sum LEFT-JUSTIFIED.

----


  • FORM sum *

----


  • ........ *

----


  • --> P_INT1 *

  • --> P_INT2 *

  • --> P_SUM *

----


END-OF-SELECTION.

----


  • FORM sum *

----


  • ........ *

----


  • --> : *

  • --> P_INT1 *

  • --> P_INT2 *

  • --> P_SUM *

----


FORM sum USING: value(p_int1)

value(p_int2)

value(p_sum).

p_sum = p_int1 + p_int2.

ENDFORM.

----


  • FORM sum *

----


  • ........ *

----


  • --> : *

  • --> P_INT1 *

  • --> P_INT2 *

  • --> P_SUM *

----


FORM sum1 CHANGING value(p_int1)

value(p_int2)

value(p_sum).

p_sum = p_int1 + p_int2.

WRITE:/ 'the inner output',p_sum.

ENDFORM.

Former Member
0 Kudos

HI

Check the F1 help for Perform,

You will get the xplanation with examples .

Thanks

Praveen