문제

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!

도움이 되었습니까?

해결책

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.

다른 팁

It is difficult to tell without more information like the full source code of your function module, function group, and class, but I'll take a guess: Most likely your type TLINE_T is not a global type, but is instead defined locally (and differently) in both the function group of the function module and in the class.

Try double-clicking on the type TLINE_T in both places and see where that brings you. If it brings you to a global type (which you should also be able to see in SE11) in both places, then I'm wrong and there is something else going on.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top