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

Modifying dynamic internal table values

Former Member
0 Likes
507

Hi Experts,

I have created one dynamic internal table for my requirement.

dynaic internal table contains .. columns like

COL1

COL2

COL3

Initially I have loaded the values in COL1

COL1 COL2 COL3

Material xxxxxx

date

|

|

After filling all value sin COL1, I need to populate the values in COL2 and COL3 and so on..

*data declaration

FIELD-SYMBOLS: <L_TABLE> TYPE STANDARD TABLE,

<L_LINE> TYPE ANY,

<L_FIELD> TYPE ANY.

DATA: IS_LVC_CAT TYPE LVC_S_FCAT,

IT_LVC_CAT TYPE LVC_T_FCAT.

DATA: ITAB TYPE REF TO DATA,

NEW_LINE TYPE REF TO DATA.

====

CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE

EXPORTING

IT_FIELDCATALOG = IT_LVC_CAT

IMPORTING

EP_TABLE = ITAB.

ASSIGN IT_AVAIL_FORMAT->* TO <L_TABLE>.

CREATE DATA NEW_LINE LIKE LINE OF <L_TABLE>.

ASSIGN NEW_LINE->* TO <L_LINE>.

ASSIGN COMPONENT 'COL1' OF STRUCTURE <L_LINE> TO <L_FIELD>.

<L_FIELD> = 'Material'.

INSERT <L_LINE> INTO TABLE <L_TABLE>.

ASSIGN COMPONENT 'COL1' OF STRUCTURE <L_LINE> TO <L_FIELD>.

<L_FIELD> = 'date'.

INSERT <L_LINE> INTO TABLE <L_TABLE>.

|

|

LOOP at XXX

ASSIGN COMPONENT W_COL OF STRUCTURE <L_LINE> TO <L_FIELD>.

<L_FIELD> = G_ZGARCD_ITEM-ZMOD.

MODIFY <L_TABLE> INDEX 1 FROM <L_FIELD>.

ENDLOOP.

I need to change COL2 and COl3 values by index or key.

pls help me.

Thanks in advance.

3 REPLIES 3
Read only

Former Member
0 Likes
472

Still need help on this.

Read only

0 Likes
472

Hi,

Since you are doing this modification inside the loop, try using index.

Regards,

Aravind J M

Read only

0 Likes
472

Solved by own.