Cold_Class
Cold_Class

Reputation: 3494

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' ).

Upvotes: 1

Views: 94

Answers (1)

Sandra Rossi
Sandra Rossi

Reputation: 13656

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:

  • Is "TABLES X" really necessary or can you use the dynamic variant of "DATA X TYPE X" (CREATE DATA) instead? TABLES is required for some Dynpro features, Logical Database, memory sharing.
  • Why is it needed to compile the program although running it would badly fail?
  • Can't you define transport routes to force objects to go in different transport requests? (assign these objects to dedicated Packages -> to Transport Layers)

Upvotes: 4

Related Questions