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

changing or using?

Former Member
0 Likes
523

Hi all,

Is any one of them obsolete/not preferred when writing a subroutine?

Thanks,

Charles.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
489

USING is preferred. CHANGING is obsolete.

USING performs both operations.

4 REPLIES 4
Read only

Former Member
0 Likes
490

USING is preferred. CHANGING is obsolete.

USING performs both operations.

Read only

Former Member
0 Likes
489

USING is preferred in subroutines.

For more info, please refer below link:

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db984635c111d1829f0000e829fbfe/content.htm

Thanks,

Santos

Read only

Former Member
0 Likes
489

HI,

You can you any of them, but its better if you are going to pass any value to a FM and return back the changed value use it through CHANGING, if you just want to pass it to the FM, use USING.

Regards

Subramanian

Read only

Former Member
0 Likes
489

The link provided by Santos gives the detail.

In summary:

- If the form definition has a parameter USING VALUE(p_var1) then any changes will NOT be passed back to the caller.

- Any other parameter definitions will result in changes being passed back to the caller.

- For readability, if the form is going to pass back a changed value for a parameter, then you should use a CHANGING parameter.

- The TABLES parameter is obsolete. You should use a using/changing parameter with a table type.

Regards

Michael