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: 

hi experts itab issue

Former Member
0 Kudos

hi guys

plz help me

here i hav shown u a piece of code in which

i am reading the content of table at index 19

in place of this i want to read the entry where test_fieldcata_alv-fieldname = 'key'.

means in place of this index 19 which is of field 'key'

i want to read the index dynamically.

bcoz if in future iwant to add ny other field it ill not b affected

Plz give me the code

Data: wa_test_fieldcata_alv like line of test_fieldcata_alv.

Data: wa1_test_fieldcata_alv like line of test_fieldcata_alv.

test_fieldcata_alv[] = gt_fieldcat_alv[].

loop at test_fieldcata_alv into wa_test_fieldcata_alv .

ENDLOOP.

READ TABLE test_fieldcata_alv INTO wa_test_fieldcata_alv INDEX 19.

wa_test_fieldcata_alv-col_pos = '8'.

MODIFY test_fieldcata_alv index 19 FROM wa1_test_fieldcata_alv .

insert wa_test_fieldcata_alv into test_fieldcata_alv index 6.

DELETE test_fieldcata_alv INDEX 20.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

try ur modify statement like this.

MODIFY test_fieldcata_alv FROM wa1_test_fieldcata_alv index 19.

as u have to use index keyword only after source as

modify itab from wa_itab index sy-index or n0 like 19,18.......

if helpful reward some points.

with regards,

Suresh.A

8 REPLIES 8

Former Member
0 Kudos

Clear wa_test_fieldcata_alv .

READ TABLE test_fieldcata_alv INTO wa_test_fieldcata_alv

with key fieldname = 'KEY' .

wa_test_fieldcata_alv-col_pos = '8'.

MODIFY test_fieldcata_alv FROM wa1_test_fieldcata_alv

where fieldname = wa_test_fieldcata_alv-fieldname.

Former Member
0 Kudos

READ TABLE test_fieldcata_alv INTO wa_test_fieldcata_alv <b>with key fieldname = 'KEY'.</b>wa_test_fieldcata_alv-col_pos = '8'.

MODIFY test_fieldcata_alv FROM wa1_test_fieldcata_alv .

0 Kudos

guys its giving dump wen i m using

MODIFY test_fieldcata_alv FROM wa1_test_fieldcata_alv .

0 Kudos

plz tel me wat i ill have to write to remove this error

0 Kudos

what is the error !!

Former Member
0 Kudos

Use

READ TABLE test_fieldcata_alv INTO wa_test_fieldcata_alv with key test_fieldcata_alv-fieldname = 'key'.

reward points if useful

Regards

Prax

Former Member
0 Kudos

thanx guys

Former Member
0 Kudos

hi,

try ur modify statement like this.

MODIFY test_fieldcata_alv FROM wa1_test_fieldcata_alv index 19.

as u have to use index keyword only after source as

modify itab from wa_itab index sy-index or n0 like 19,18.......

if helpful reward some points.

with regards,

Suresh.A