Tables using LIKE may only reference flat structures

Niklas picture Niklas · Nov 8, 2013 · Viewed 8.9k times · Source

I wanna have a table parameter in a RFC function module of type CGPL_TEXT1, which uses the domain type TEXT40, which is a char 40.

I tried to create it:

IT_PARTS_DESCRIPTION LIKE CGPL_TEXT1

But I keep getting this error

tables using like may only reference flat structures

I am also not able to use TYPE. If I do so, I get this error:

Flat types may only be referenced using LIKE for table parameters

Answer

vwegert picture vwegert · Nov 8, 2013

Don't go there. For RFC-enabled function modules, always use a structure as a line type for your table. The RFC protocol itself also supports unstructured tables, but many adapters don't. So you should

  • declare a data dictionary structure Z_MY_PARTS_DATA with a single field DESCRIPTION TYPE CGPL_TEXT2
  • declare a data dictionary table type Z_MY_PARTS_TABLE using this structure
  • use that table type in your function module.