abapdynpro

Dynamically assign "TABLES table_wa." to a structure


In my /XXX/MY_FUNCTION_GROUP function group include - /XXX/MY_FUNCTION_GROUPTOP - there's a table work area defined like this: (see syntax)

FUNCTION-POOL /XXX/MY_FUNCTION_GROUP.

TABLES /xxx/my_structure.

My problem is that depending on the SAP system in which this program is imported the structure /xxx/my_structure may not exist which would lead to a syntax error.

Is there a way to make the structure dynamic?


So far I tried this, but that syntax is invalid:

TABLES ( '/xxx/my_structure' ).

Solution

  • There's no dynamic variant of TABLES.

    But you can find many workarounds depending on your context/needs.

    Questions you could ask yourself to help you find these workarounds: