‎2009 Feb 10 5:02 AM
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.
‎2009 Feb 10 5:16 AM
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
‎2009 Feb 10 5:16 AM
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
‎2009 Feb 10 5:35 AM
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
‎2009 Feb 10 4:16 PM
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