Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parameter is not type-compatible with formal parameter when method is called from FM

A static public class method, zcl_abc=>dosomething, has an importing parameter

it_lines type TLINE_T optional

And there is a FM called zfm_dosame. It has a parameter

TABLES IT_LINES TYPE TLINE_T OPTIONAL

zfm_dosame calls zcl_abc=>dosomething and tries to pass it_lines to it_lines. However, syntax error:

IT_LINES is not type-compatible with formal parameter IT_LINES.

This error drives me crazy. I have no idea how come... Please help!

like image 239
Dustin Sun Avatar asked Dec 28 '25 06:12

Dustin Sun


1 Answers

The TABLES part of a function interface creates internal tables with header line at runtime. So in order to pass the entire table, instead of just one work area, you should pass IT_LINES[] instead of IT_LINES to the method you're calling.

like image 96
René Avatar answered Dec 30 '25 23:12

René



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!