2007 Mar 12 6:57 PM
Hi,
I need to update the internal table as described below,
Assume that i have 10 columns in my internal table and i need to modifying the column value in row, which is dynamic.
for example, i'm writing it in Subroutine and it has 3 formal parameter
1) Key field value
2) Column name
3) Value of the column
in my subroutine i need to write code to modify the row, which should handle the columns dynamically.
Samples,
7th record i need to modify the 4th column value.
4th record i need to modify the 9th column value.
Please guide me to handle this requirement.write me if i'm not clear.
...Nandha
2007 Mar 12 7:05 PM
For the column check the ASSIGN statement:
No system here, but I think it is:
ASSIGN COMPONENT <index> OF STRUCTURE <structure> TO <field-symbol>.
For the row:
READ TABLE <itab> INDEX <index> INTO <work area>.
--> For your 1. example you could write:
READ TABLE <itab> INDEX 7 INTO <work area>.
ASSIGN COMPONENT 4 OF STRUCTURE <work area> TO <field-symbol>.
<field symbol> now points to the 4th column of the 7th row.
Guenther
For the column check the ASSIGN statement:
No system here, but I think it is:
ASSIGN COMPONENT <index> OF STRUCTURE <structure> TO <field-symbol>.
For the row:
READ TABLE <itab> INDEX <index> INTO <work area>.
--> For your 1. example you could write:
READ TABLE <itab> INDEX 7 INTO <work area>.
ASSIGN COMPONENT 4 OF STRUCTURE <work area> TO <field-symbol>.
<field symbol> now points to the 4th column of the 7th row.
Guenther
2007 Mar 12 7:05 PM
For the column check the ASSIGN statement:
No system here, but I think it is:
ASSIGN COMPONENT <index> OF STRUCTURE <structure> TO <field-symbol>.
For the row:
READ TABLE <itab> INDEX <index> INTO <work area>.
--> For your 1. example you could write:
READ TABLE <itab> INDEX 7 INTO <work area>.
ASSIGN COMPONENT 4 OF STRUCTURE <work area> TO <field-symbol>.
<field symbol> now points to the 4th column of the 7th row.
Guenther
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |