Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dynamic internal table operations

Former Member
0 Likes
535

Hi,

I have an issue with dynamic internal table wherein I need to write a select statement with For All Entries on dynamic internal table and populating the record into another dynamic internal table.

I am trying with the code below but its not working.

SELECT (FLD)

FROM (T_TABLE)

INTO CORRESPONDING FIELDS OF TABLE <DYN1_TABL>

FOR ALL ENTRIES IN <DYN_TABL>

WHERE KEY_FNAME = <DYN_TABL>-KEY_FNAME.

FLD is the dynamic field.

T_TABLE is the dynamic database table.

DYN1_TABL is the dynamic internal table

DYN_TABL is the dynamic internal table

KEY_FNAME is the dynamic key field of T_TABLE.

Pls help me on this issue.

Response with code snippets will be appreciated.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
465

refer below demo program

DEMO_SELECT_DYNAMIC_COLUMNS Specifying Columns Dynamically

DEMO_SELECT_DYNAMIC_CONDITIONS Dynamic Conditions

DEMO_SELECT_DYNAMIC_DATABASE Specifying a Database Table Dynamically

3 REPLIES 3
Read only

Former Member
0 Likes
466

refer below demo program

DEMO_SELECT_DYNAMIC_COLUMNS Specifying Columns Dynamically

DEMO_SELECT_DYNAMIC_CONDITIONS Dynamic Conditions

DEMO_SELECT_DYNAMIC_DATABASE Specifying a Database Table Dynamically

Read only

0 Likes
465

Thanks for your reply Nikki but my issue is to reference a field in dynamic internal table to be used with 'For All Entries' satement.

like for static we use

For All Entries in Itab where <fieldname> = itab-<fieldname>

I was looking for the same statement for dynamic tables

Read only

0 Likes
465

Hi,

I hope you must be creating Dynamic internal table using Field Catalog. If so then the check if KEY field in Field catalog has been checked. Then move this fieldname to and variable and try to use it.

I guess this might work but not sure.

Thanks,

Prashanth