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: 

What type of program is correct for perform routine_1(z_prog)?

former_member202077
Participant
0 Kudos

Hi Experts,

 
1) PERFORM routine_1(in_Z_Prog) using xyz
                    changing my_flag.

%%%%%

2) Report in_z_prog

3) FORM routine_1 using p_xyz
            changing p_my_flag. 

I guess, the REPORT in_z_prog should be EXECUTABLE TYPE program, right (because when I double clicked on 1st statement, system automatically choosen)? or else, as its Function Module/Function Group/Main Prog. so should I choose MODULE POOL prog for this my_program?

Thank you

1 ACCEPTED SOLUTION

Sougata
Active Contributor
0 Kudos

Executable program.

Also a good idea to call it like this:

PERFORM routine_1(in_Z_Prog) 
            USING    xyz
            CHANGING my_flag
         IF FOUND.

So that it does not short-dump if the routine is not found in the external program.

Cheers,

Sougata.

9 REPLIES 9

Sougata
Active Contributor
0 Kudos

Executable program.

Also a good idea to call it like this:

PERFORM routine_1(in_Z_Prog) 
            USING    xyz
            CHANGING my_flag
         IF FOUND.

So that it does not short-dump if the routine is not found in the external program.

Cheers,

Sougata.

0 Kudos

Thank you for your tip.

But, u know if I double click on that PERFORM name to create it, strangely system is considering IF FOUND is as CHANGING params!! like below

 PERFORM routine_1(in_Z_Prog) 
            USING    xyz
            CHANGING my_flag
         IF FOUND. 

If i double click on routine_1,

 Report in_Z_Prog.
      FORM routine_1
            USING  p_xyz
            CHANGING p_my_flag
                       p_IF 
                       p_FOUND. 

or am doing some thing wrong?

Thank you

Former Member
0 Kudos

Do Not create it by double click.

Simple create a perform in Report in_Z_Prog.


      FORM routine_1
            USING  p_xyz
            CHANGING p_my_flag.

    ENDFORM.

0 Kudos

Thank you.

Actually, after double clicking I removed the below 2 params from CHANGING,

p_IF

p_FOUND.

just curious, why system is considering these as params?

Thank you

0 Kudos

Hi ,

after double clicking it will never create a subroutine, instead it will open the reference program with the same perform, here there is no need to create a routine, instead we can use the same with out writing the same code again and again...this is the reusability.

Regards,

Venkat Appikonda

0 Kudos

Sorry I did not get you!

In my case, both are (in_Z_prog and routine_1) are brabd new.

So, first i double click on in_Z_prog, after assigning transport then i dbl clicked the routine_1, at this point am talking!! system created p_IF and p_FOUND paranms under CHANGING?

Thank you

Former Member
0 Kudos

Hi,

Did you tried giving the Parameters inside the paranthesis () , If not please try it. It should work.

Regards,

Prabakaran.S

former_member203501
Active Contributor
0 Kudos

Hi ,

Generally we use the executable program to call an external perform , can you please explain in detail what exactly do you want?

Regards,

Venkat Appikonda.

Former Member
0 Kudos

in_z_program can be a Report or Subroutine Pool.