kk luo
kk luo

Reputation: 599

Smartform error "Flat types may only be referenced using LIKE for table parameters"

I created a table ZPDETAIL01 in se11 and activated it. In smartforms' Form Interface I create a table parameter zdetail in the tables tab, with type assignment as TYPE and associated type as ZPDETAIL01. When I check it ,an error occurred,"ZPDETAIL01 Flat types may only be referenced using LIKE for table parameters"

Is this error of my table itself or my parameter setting? Thx.

I changed the type assignment to LIKE and problem solved. But I wonder why in the search help button I can't find the LIKE option, only TYPE and TYPE REF.

Upvotes: 2

Views: 1778

Answers (1)

Sandra Rossi
Sandra Rossi

Reputation: 13629

Simply a flaw in the UI. If it's allowed then it should be listed as a possible value.

But I guess SAP just didn't care to correct those little things of this obsolete technology (i.e. Smart Forms... now prefer Adobe forms or third-party solutions). Note that the list of values come from the table RSFBTYPEIN, and probably LIKE was previously defined in this table but as LIKE became obsolete for typing import and export parameters in function modules, SAP probably removed it: majority wins over minority. Just a guess.

If you wish, you may open a ticket at SAP support to make it corrected.

Behaviors in ABAP 7.52 SP01 (tests done with DDIC objects: flat table SCARR, non-flat table SOTR_TEXTU, table type BAPIRETTAB):

Typing   Associated type    Button           Error message
------   ----------------   --------------   -------------------------------------------
TYPE     Flat struc/table   Check            SCARR Flat types may only be referenced 
                                             using LIKE for table parameters
TYPE     Flat struc/table   Activate         Only table types may be used as the 
                                             reference type for a table parameter
TYPE     Non-flat str/tab.  Check/Activate   Only table types may be used as the 
                                             reference type for a table parameter
TYPE     Table type         Check/Activate   None
LIKE     Flat struc/table   Check/Activate   None

LIKE     Non-flat str/tab.  Check/Activate   None but short dump at runtime (because of
                                             syntax error in FM: "&1" must be a flat 
                                             structure. Internal tables, strings, references, 
                                             and structures cannot be used as components.)
LIKE     Table type         Check            Type BAPIRETTAB is not allowed in this context
LIKE     Table type         Activate         Tables using LIKE may only reference flat structures

As you see, there's a bigger problem than just not displaying LIKE, there's a short dump in one case!

Note that I didn't test TYPE REF TO, but I doubt a TABLES parameter can use it.

Upvotes: 1

Related Questions