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

using and chaning in perform statement

Former Member
0 Likes
460

Hi,

can anyone explain the purpose of using and changing in perform statemnt

the using and changing fields in the corresponding form statemnts differs from the one in perform statment.

Can anyone explain me with a simple statement

Thanks

Kajol

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
430

Hi kajol,

Check the code below:

Imagine you need to change the date of v_datum and send the result to v_datum_ok.

data: v_datum(10) type c value '10/02/2007',

v_datum_ok type dats.

PERFORM F_TEST USING v_datum CHANGING v_datumok.

Below is the form code:

FORM F_TEST USING P_DATUM CHANGING P_DATUM_OK.

data: v_day(2) type c,

v_month(2) type c,

v_year(4) type c.

split P_datum at '/' into v_day v_month v_year.

concatenate v_year v_month v_day into p_datum_ok.

ENDFORM. "F_TEST

Hi,

can anyone explain the purpose of using and changing in perform statemnt

the using and changing fields in the corresponding form statemnts differs from the one in perform statment.

Can anyone explain me with a simple statement

Thanks

Kajol

2 REPLIES 2
Read only

Former Member
0 Likes
430

From the ABAP Guide:

For calling by reference, USING and CHANGING are equivalent. For documentation purposes,

you should use USING for input parameters which are not changed in the subroutine, and

CHANGING for output parameters which are changed in the subroutine.

Read only

Former Member
0 Likes
431

Hi kajol,

Check the code below:

Imagine you need to change the date of v_datum and send the result to v_datum_ok.

data: v_datum(10) type c value '10/02/2007',

v_datum_ok type dats.

PERFORM F_TEST USING v_datum CHANGING v_datumok.

Below is the form code:

FORM F_TEST USING P_DATUM CHANGING P_DATUM_OK.

data: v_day(2) type c,

v_month(2) type c,

v_year(4) type c.

split P_datum at '/' into v_day v_month v_year.

concatenate v_year v_month v_day into p_datum_ok.

ENDFORM. "F_TEST