Skip to Content
0
Former Member
Dec 06, 2006 at 09:56 PM

Dynamic data declaration

92 Views

I posted same thread into "Dictionary section"

Hi,

I have a following issue 😔 - I am not sure whether this is possible - so I need your feedback/expertise.

I have a custom table (example ZABC) with several fields in it - one of them being TABNAME . Content of that table ZABC is

MANDT TABNAME FIELDNAME ZCHECK

800 KNA1 KUNNR

800 KNA1 NAME1 X

800 KNA1 NAME2 X

800 KNA1 KUNNR

800 KNVV BZIRK X

800 KNAS KUNNR

800 KNAS STCEG

etc.

There is no rule how many entries will be in this ZABC table - I guess it will be less than 20 - but this is not business rule. Also do not know how many different "tables" could be specified.

Fields MANDT and ZCHECK fields are not important at this stage.

The challenge I have is to fetch data for only those fields from their specified physical tables (KNA1, KNVV, KNAS) in internal tables.

In this case I would need to have 3 internal tables one for KNA1, one for KNAS and one for KNVV.

I need to keep those "internal" table with content throughout the entire program for certain validation.

I know that I should dynamically define those internal tables but I have issues not knowing how many tables will be defined in ZABC table and I personally do not want to declare "<fs_itab> TYPE ANY TABLE" 20 or so times as fs_itab1 - fs_itab20.

Is there any way I can dynamically create as many internal tables as needed and keep their content throughout program run-time.

Regards

Goran