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: 

Syntax problem by sending a itab AND a variable to a subroutine

Former Member
0 Kudos

Hi all,

Since I need to work with an import parameter from a function in a subroutine I need to pass it to this routine additional to an internal table which is already passed to the subroutine.

The current coding is:

PERFORM get_config TABLES i_mtnr_ppl_sorg CHANGING i_mtnr_ppl_sorg.

and

FORM GET_CONFIG TABLES i_sub_mtnr_sqv STRUCTURE i_mtnr_ppl_sorg CHANGING i_chg_mtnr_qsv.

Now I have been trying to do the following but it doesn't work:

PERFORM get_config TABLES i_mtnr_ppl_sorg CHANGING i_mtnr_ppl_sorg USING time_out.

FORM GET_CONFIG TABLES i_sub_mtnr_sqv STRUCTURE i_mtnr_ppl_sorg USING time_out CHANGING i_chg_mtnr_qsv.

anybody knows why?

Thanks for any comments

1 ACCEPTED SOLUTION

JozsefSzikszai
Active Contributor
0 Kudos

hi,

in the subroutine call you coded wrong order:

PERFORM get_config TABLES i_mtnr_ppl_sorg CHANGING i_mtnr_ppl_sorg USING time_out.

first USING parameters, than CHANGING parameters:

PERFORM get_config TABLES i_mtnr_ppl_sorg USING time_out CHANGING i_mtnr_ppl_sorg .

hope this helps

ec

3 REPLIES 3

JozsefSzikszai
Active Contributor
0 Kudos

hi,

in the subroutine call you coded wrong order:

PERFORM get_config TABLES i_mtnr_ppl_sorg CHANGING i_mtnr_ppl_sorg USING time_out.

first USING parameters, than CHANGING parameters:

PERFORM get_config TABLES i_mtnr_ppl_sorg USING time_out CHANGING i_mtnr_ppl_sorg .

hope this helps

ec

0 Kudos

Thanks for your replay Eric, but how does the compiler know that the changing variable belongs to the table name?

0 Kudos

>

Thanks for your replay Eric, but how does the compiler know that the changing variable belongs to the table name?

if you do everything right, it will know, you should not worry about that

oh, I just checked the variable names and I see you use the same table (?) for TABLES and CHANGING as well. This definetly does not make sense and won't work. You can use it only once.

And to go into deeper, the TABLES parameter is obsolete, so pls. avoid using it. Decide if you want to change the internal table inside the subroutine and acc. to the decision, you can put into USING and or CHANGING.