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

perform error

sergio_cifuentes
Participant
0 Likes
937

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
Read only

naimesh_patel
Active Contributor
0 Likes
863

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
Read only

ferry_lianto
Active Contributor
0 Likes
863

Hi,

Please try this.


...

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

...

Regards,

Ferry Lianto

Read only

naimesh_patel
Active Contributor
0 Likes
864

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

Read only

0 Likes
863

Thanks, it works.

Read only

Former Member
0 Likes
863

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

Read only

Former Member
0 Likes
863

use 'tables' instead of 'changing'.

regards.

Read only

ferry_lianto
Active Contributor
0 Likes
863

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

Read only

0 Likes
863

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