Skip to Content
0
Jan 26, 2016 at 04:36 PM

Parse Field Using Field-Symbols

67 Views

Hello,

I have looked at a number of discussions and I don't not find what I am looking for. What I trying to do is parse a field using a table structure dynamically to move data to another corresponding field in another structure.

Here is the code I have...

FIELD-SYMBOLS:
<structure> TYPE ANY,
<structurex> TYPE ANY,
<field> TYPE ANY,
<fieldx> TYPE ANY.

DATA: ls_DFIES TYPE DFIES.

CLEAR: cv_VARKEY.

** - Get Key Structure
READ TABLE it_DFIES INTO ls_DFIES INDEX 1.

** - Assign Structure to FIELD_SYMBOL
ASSIGN ls_DFIES-TABNAME TO <structure>. <structure> = is_MPX_CTL_VARKEY.
ASSIGN ls_DFIES-TABNAME TO <structurex>. <structurex> = cv_VARKEY.

DO iv_INDEX TIMES.
ASSIGN COMPONENT sy-TABIX OF STRUCTURE <structure> TO <field>.
ASSIGN COMPONENT sy-TABIX OF STRUCTURE <structurex> TO <fieldx>.
<fieldx> = <field>.
ENDDO.


I thought the ASSIGN for cause the <structure> to have the structure of the table. Then I could move the value of the field to be parsed. But it is not working. I could use some help.


Thank you in advance.


Best Regards, Dean.