Application Development 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: 

Field Symbol

Former Member
0 Kudos

hi all...

i made one internal table using following code

FIELD-SYMBOLS : <DTAB> TYPE STANDARD TABLE ,

<DWA> TYPE ANY ,

<FLD> TYPE ANY.

CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE

EXPORTING

IT_FIELDCATALOG = IFC

I_LENGTH_IN_BYTE = 'X'

IMPORTING

EP_TABLE = DY_TABLE.

ASSIGN DY_TABLE->* TO <DTAB>.

CREATE DATA DY_LINE LIKE LINE OF <DTAB>.

ASSIGN DY_LINE->* TO <DWA>.

now i want to loop at <DTAB>

So, i wrote

LOOP AT <DTAB> ASSIGNING <DWA>.

"withing this loop i want to modify the value of one field, say, FLD1.

" so i have to write like <DWA>-FLD1 = VAL1. -


> HOW TO WRITE THIS STATEMENT.

MODIFY <DTAB> FROM <DWA> TRANSPORITNG FLD1.

ENDLOOP.

Also tell me if my FLD1 is also dynamic, means, it is in variable. than how to write the code???

2 REPLIES 2

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi,

check this code..

p_field = 'FIELD1'.
LOOP AT <table> ASSIGNING <wa>.
ASSIGN COMPONENT p_field OF STRUCTURE <wa> TO <val>.
<val> = 'Avinash'.
MODIFY TABLE <table> FROM <wa>.
ENDLOOP.