Skip to Content
Jan 20, 2021 at 12:13 PM

RFC and dynamic SQL

75 Views Last edit Jan 20, 2021 at 01:40 PM 2 rev

I've got an RFC enabled function module, which uses a dynamic where clause, like

       DATA(Where) = `somefield EQ zcl_someclass=>c_constant-value`.
       SELECT * FROM table INTO internal_Table WHERE (where).    
    CATCH cx_sy_dynamic_osql_error INTO DATA(sql_error).
      e_error-message = sql_error->get_text( ) && ` : ` && sql_error->get_longtext( ).
      e_error-type = 'E'.

I'm calling it with a destinations that's just to another client in the same instance. It throws an exception - it does not like zcl_someclass=>c_constant-value. It says that the value can't be established.

This is in a 7.31 system. I'll be testing in a 752 system when I get some time.

Has anyone noticed this strange behaviour, or have an explanation? It only happens with an RFC. Locally, it works fine.