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

Subroutine Pool

Former Member
0 Likes
807

Hi friends,

Can we change two fields with one variable in subroutine pool...

what I mean is......

/:FORM ZFORM IN PROGRAM ZPROG

/:USING &VAR&

/:CHANGING &ABC&

/:CHANGING &CDE&

/:ENDPERFORM.

Can I call like this.......

1 ACCEPTED SOLUTION
Read only

bpawanchand
Active Contributor
0 Likes
772

hi

Yes because you are passing one variable to Form Subroutine

Use this type of declaration

FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY

OUT_PAR STRUCTURE ITCSY.

Regards

Pavan

Edited by: Pavan Bhamidipati on Jul 10, 2008 2:17 PM

7 REPLIES 7
Read only

bpawanchand
Active Contributor
0 Likes
773

hi

Yes because you are passing one variable to Form Subroutine

Use this type of declaration

FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY

OUT_PAR STRUCTURE ITCSY.

Regards

Pavan

Edited by: Pavan Bhamidipati on Jul 10, 2008 2:17 PM

Read only

Former Member
0 Likes
772

Hi,

No need to write CHANGING for two times, use the key work for single time, using the same key work in FORM is a syntax error.

ex:

FORM ZFORM IN PROGRAM ZPROG

USING V1

CHANGING V2 V3.

ENDFORM.

Is your question answered.

Read only

0 Likes
772

Hi Ravi,

You mean to say like this.....

/:USING &VAR&

/:CHANGING &ABC& &CDE&

Read only

0 Likes
772

Hi Hosmath,

Use as like the below

/:PERFORM ZFORM IN PROGRAM ZPROG

/:USING &V1&

/:CHANGING &A1&

/:CHANGING &A2&

/:ENDPERFORM.

Read only

Former Member
0 Likes
772

hi,

You can use this. You can include two or maor CHANGING parameters.

In the Called Sub routine there parametrs are stored in a Internal TAble and Return the Value in the internal table so we can give fields like this.

Hope this will help.

Regards

Sumit Agarwal

Read only

Former Member
0 Likes
772

Hi,

It will be

/:PERFORM ZFORM IN PROGRAM ZPROG

/:USING &VAR&

/:CHANGING &ABC&

/:CHANGING &CDE&

/:ENDPERFORM.

There Is no such rule for Changing parameters.

Regards,

Sujit

Read only

Former Member
0 Likes
772

Hosmath,

Please check this link

http://www.sap-basis-abap.com/abap/how-to-call-a-subroutine-form-sapscripts.htm

Yes you can change as many fields u want using the subroutine .

/:PERFORM ZFORM IN PROGRAM ZPROG
/:USING &VAR&
/:CHANGING &ASD&
/:CHANGING &ZXC&
/:CHANGING &QWE&
/:CHANGING &CDE&
/:CHANGING &TYU&
/:ENDPERFORM.

CHANGING is nothing but you are importing the values from the subroutine.

You are passing the value VAR and you are importing the other values.

Best reagrds,

raam