‎2007 Nov 13 9:22 PM
Hi All,
Could any one explain me the purpose of using the following additions in a fm :
1.' Using and changing'
Ex : form get_data using mat1 changing mat2.
2.'Changing'
Ex. form get_data changing material.
3.'Using' .
Ex: form get_data using material.
Please explain me in detail with good examples for each of the above.
I appeciate your help.
Regards,
Vishwanath.
‎2007 Nov 13 9:28 PM
Hi vish,
1.' Using and changing'
Ex : form get_data using mat1 changing mat2.
ANS: you are passing mat1 value to subroutine, subroutine will do some process with mat1 value and pass the changed value to mat2, so changed mat2 value will comes out from routine.
2.'Changing'
Ex. form get_data changing material.
ANS: subroutine get_data will do some process and changes the material value.
3.'Using' .
Ex: form get_data using material.
ANS: Here you are passing the material to do some process in subroutine.
Hope you got my point.
Reward points if it helps,
Satish
‎2007 Nov 13 9:30 PM
Hi,
Within the subroutine you can modify the formal parameters irrespective of whether they are USING or CHANGING parameters. This is nothing else but messy coding.
The ABAP keyword documentation gives a good example of how to use USING and CHANGING parameters:
The following five PERFORM statements mean the same but only the fourth is recommended, since it is the only one that documents the interface of the subroutine called.
DATA: a1 TYPE string,
a2 TYPE string,
a3 TYPE string,
a4 TYPE string.
PERFORM test USING a1 a2 a3 a4.
PERFORM test CHANGING a1 a2 a3 a4.
PERFORM test USING a1 CHANGING a2 a3 a4.
PERFORM test USING a1 a2 CHANGING a3 a4.
PERFORM test USING a1 a2 a3 CHANGING a4.
...
FORM test USING p1 TYPE string
p2 TYPE string
CHANGING value(p3) TYPE string
value(p4) TYPE string.
...
ENDFORM.
Regards,
Ferry Lianto
‎2007 Nov 13 9:53 PM
Hi Ferry,
Could you explain with simple and complete example so that I can copy and debug the same.
Regards,
Vishu.
‎2007 Nov 14 2:30 AM
Hi
Check this Demo program in your System .
Hope this helps .
DEMO_MOD_TECH_FB_STRING_SPLIT .
Thanks
Praveen