‎2007 Jan 30 9:19 AM
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á
‎2007 Jan 30 9:24 AM
‎2007 Jan 30 9:23 AM
hi,
use:
assign component z_index of structure T_OUTTAB to <FS>.
if sy-subrc = 0.
<FS> = izab-field15-
endif.
modify <outab>.
A.
‎2007 Jan 30 9:24 AM
‎2007 Jan 30 9:30 AM
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