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

Accessing fields in dynamic table?

Former Member
0 Likes
638

Hi!

There's a dynamic(?) table, with the following declaration, this table has a header line:

T_OUTTAB TYPE STANDARD TABLE.

In debugging there are a lot of fields, and I would like to use the values of these fields, and in some conditions maybe change the table entries.

In the source code I can't address the fields by their name, because I got a syntax error and cannot compile the ABAP, because the table has no structure.

I would like to get the actual structure of this table in runtime, change the value of some fields and write the changed entries back to the table within a LOOP.

The only problem is: HOW?

Thanx in advance

Tamá

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
605

check this link...

regds,

kiran

3 REPLIES 3
Read only

andreas_mann3
Active Contributor
0 Likes
605

hi,

use:

assign component z_index of structure T_OUTTAB to <FS>.

if sy-subrc = 0.

<FS> = izab-field15-

endif.

modify <outab>.

A.

Read only

Former Member
0 Likes
606

check this link...

regds,

kiran

Read only

Former Member
0 Likes
605

Hi,

the below code for using the dyanamic table...

i hope its useful.

FIELD-SYMBOLS: <i_tableft> TYPE STANDARD TABLE.

*Table for reference

DATA: new_tableft TYPE REF TO data.

CALL METHOD cl_alv_table_create=>create_dynamic_table

EXPORTING

it_fieldcatalog = i_fieldcatft

IMPORTING

ep_table = new_tableft

EXCEPTIONS

generate_subpool_dir_full = 1

OTHERS = 2.

  • If success, then create the internal tables.

IF sy-subrc = 0.

ASSIGN new_tableft->* TO <i_tableft>.

CREATE DATA new_lineft LIKE LINE OF <i_tableft>.

ASSIGN new_lineft->* TO <i_lineft>.

Regards,

Sarath