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: 

incompatible parameter type in call to show_html

abo
Active Contributor
0 Kudos
data: lt_html TYPE html_table.
cl_abap_browser=>show_html( html = lt_html ).

This code gave me an error because lt_html is not the same type as the html parameter.

In the end, I got it to work by referencing the class before the type, like this:

data: lt_html TYPE CL_ABAP_BROWSER=>html_table.
cl_abap_browser=>show_html( html = lt_html ).

Is this normal? True one has "html_line" as row type and the other has "w3html" but, at the end of the day, both are 255 chars.

Could this depend on something else, like key specification for the table?

1 ACCEPTED SOLUTION

Ryan-Crosby
Active Contributor
0 Kudos

Hi Andrea,

The types are incompatible because W3HTML has a component named LINE, and the HTML_TABLE type declared in class CL_ABAP_BROWSER has a component named TABLE_LINE making them incompatible.

Regards,

Ryan Crosby

3 REPLIES 3

Ryan-Crosby
Active Contributor
0 Kudos

Hi Andrea,

The types are incompatible because W3HTML has a component named LINE, and the HTML_TABLE type declared in class CL_ABAP_BROWSER has a component named TABLE_LINE making them incompatible.

Regards,

Ryan Crosby

abo
Active Contributor

Thank you both, ryan.crosby2 and sandra.rossi . Thing is, the type handling is... not very consistent, imho.

The following code can be activated in my company dev system but won't on either A4H or NPL minisap demos because html_table is not present (go figure!):

data: local_def TYPE html_table,
class_def type CL_ABAP_BROWSER=>html_table.
local_def = class_def. "OK local_def[] = class_def[]. "OK

So, yeah, this is what I had in mind when I posted: parameter passing has stricter checks than direct assignment.

Sandra_Rossi
Active Contributor

Yes. The parameter type is complete, so it must be the exact same type.