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: 

perform error

sergio_cifuentes
Participant
0 Kudos

Hi, i get the error "Different number of parameters in FORM and PERFORM (routine: GET_TARCOST, number of formal parameters: 8, number of actual parameters: 3)."

when i do a perform like this:

TYPES: BEGIN OF ty_refer,

dec TYPE p DECIMALS 5,

END OF ty_refer.

DATA: v_vallit TYPE STANDARD TABLE OF ty_refer WITH HEADER LINE.

<b>PERFORM get_tarcost USING ti_mast-matnr ti_mast-werks CHANGING v_vallit.</b>

the definition of the form get_tarcost is:

FORM get_tarcost USING p_matnr LIKE mkal-matnr

p_werks LIKE mkal-werks

CHANGING p_vallit TYPE STANDARD TABLE OF ty_refer WITH HEADER LINE.

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

Try like this:

REPORT  ZTEST_NP.

TYPES: BEGIN OF TY_REFER,
DEC TYPE P DECIMALS 5,
END OF TY_REFER.

TYPES: T_REFER TYPE STANDARD TABLE OF TY_REFER.  " << table type.

DATA: L_MATNR TYPE MARA-MATNR,
      L_WERKS TYPE MARC-WERKS.
DATA: V_VALLIT TYPE STANDARD TABLE OF TY_REFER WITH HEADER LINE.

PERFORM GET_TARCOST 
USING L_MATNR L_WERKS CHANGING V_VALLIT[].  " << table with header line


FORM GET_TARCOST USING P_MATNR LIKE MKAL-MATNR
P_WERKS LIKE MKAL-WERKS
CHANGING P_VALLIT TYPE T_REFER.  "< << refer to T_REFER

ENDFORM.                    "get_tarcost

Regards,

Naimesh Patel

7 REPLIES 7

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please try this.


...

PERFORM GET_TARCOST USING TI_MAST-MATNR TI_MAST-WERKS TABLES V_VALLIT.

...

Regards,

Ferry Lianto

naimesh_patel
Active Contributor
0 Kudos

Try like this:

REPORT  ZTEST_NP.

TYPES: BEGIN OF TY_REFER,
DEC TYPE P DECIMALS 5,
END OF TY_REFER.

TYPES: T_REFER TYPE STANDARD TABLE OF TY_REFER.  " << table type.

DATA: L_MATNR TYPE MARA-MATNR,
      L_WERKS TYPE MARC-WERKS.
DATA: V_VALLIT TYPE STANDARD TABLE OF TY_REFER WITH HEADER LINE.

PERFORM GET_TARCOST 
USING L_MATNR L_WERKS CHANGING V_VALLIT[].  " << table with header line


FORM GET_TARCOST USING P_MATNR LIKE MKAL-MATNR
P_WERKS LIKE MKAL-WERKS
CHANGING P_VALLIT TYPE T_REFER.  "< << refer to T_REFER

ENDFORM.                    "get_tarcost

Regards,

Naimesh Patel

0 Kudos

Thanks, it works.

Former Member
0 Kudos

Hi,

try like this

PERFORM get_tarcost USING ti_mast-matnr ti_mast-werks CHANGING v_vallit.

the definition of the form get_tarcost is:

FORM get_tarcost USING p_matnr type mkal-matnr

p_werks type mkal-werks

CHANGING p_vallit TYPE TABLE OF ty_refer.

Reward if it helps,

Satish

Former Member
0 Kudos

use 'tables' instead of 'changing'.

regards.

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please try this also.


TYPES: BEGIN OF ty_refer,
         dec TYPE p DECIMALS 5,
       END OF ty_refer.

TYPES: t_refer TYPE TABLE OF ty_refer.
 
DATA: v_vallit TYPE t_refer.

PERFORM get_tarcost USING ti_mast-matnr ti_mast-werks v_vallit.

...

Regards,

Ferry Lianto

0 Kudos

thanks, but it doesn't work (using the same definition of "get_tarcost").