2006 Dec 28 10:51 AM
Hello,
I am trying to modify a report for a dynamic approach, but I am stuck with a problem.
I have this line:
INSERT LINES OF lt_celltab INTO table <dyn_field>.
The error is <dyn_field> is not an internal table.
In the debugger, the status of <dyn_field> is Table(initial). How can I insert the lines of lt_celltab into <dyn_field?
2006 Dec 28 11:10 AM
This will solve your problem,
Declare your Field symbol as below
FIELD-SYMBOLS: <fs_scarr> TYPE STANDARD TABLE.
Here is a complete example,
REPORT zkb_test5.
DATA: i_scarr TYPE TABLE OF scarr,
w_scarr TYPE scarr.
DATA: dref_scarr TYPE REF TO data.
FIELD-SYMBOLS: <fs_scarr> TYPE STANDARD TABLE.
SELECT * FROM scarr INTO TABLE i_scarr.
CREATE DATA dref_scarr TYPE TABLE OF scarr.
ASSIGN dref_scarr->* TO <fs_scarr>.
APPEND LINES OF i_scarr TO <fs_scarr>.
IF sy-subrc NE 0.
WRITE / 'Error'.
ELSE.
WRITE / 'Success'.
ENDIF.
Regards
Kathirvel
Hello,
I am trying to modify a report for a dynamic approach, but I am stuck with a problem.
I have this line:
INSERT LINES OF lt_celltab INTO table <dyn_field>.
The error is <dyn_field> is not an internal table.
In the debugger, the status of <dyn_field> is Table(initial). How can I insert the lines of lt_celltab into <dyn_field?
2006 Dec 28 10:54 AM
Hi,
Try with APPEND command instead of INSERT.
APPEND LINES OF lt_celltab INOT TABLE <dyn_field>.
Regards,
Satya.
2006 Dec 28 10:55 AM
hi George,
Usually Field Symbols (varibales in <>) are used to access single row of ITAB and do processing and send it back to ITAB etc.
What would you need to do that.
You can just use a string table if you want
Regards,
VIvek
2006 Dec 28 11:08 AM
Hello,
You could also have a field symbol which is type table.
For this you should have declared the field symbol as
<fs> type standard/sorted table
or
<fs> type <DDIC table type>
or
<fs> type standard table of <DDIC transparent table>
2006 Dec 28 11:10 AM
This will solve your problem,
Declare your Field symbol as below
FIELD-SYMBOLS: <fs_scarr> TYPE STANDARD TABLE.
Here is a complete example,
REPORT zkb_test5.
DATA: i_scarr TYPE TABLE OF scarr,
w_scarr TYPE scarr.
DATA: dref_scarr TYPE REF TO data.
FIELD-SYMBOLS: <fs_scarr> TYPE STANDARD TABLE.
SELECT * FROM scarr INTO TABLE i_scarr.
CREATE DATA dref_scarr TYPE TABLE OF scarr.
ASSIGN dref_scarr->* TO <fs_scarr>.
APPEND LINES OF i_scarr TO <fs_scarr>.
IF sy-subrc NE 0.
WRITE / 'Error'.
ELSE.
WRITE / 'Success'.
ENDIF.
Regards
Kathirvel
2006 Dec 28 2:33 PM
Thyank you all.
I solved the problem by declaring the field symbol as sorted table.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |