2008 Nov 07 8:16 AM
Hi,
this is my problem: I want to set the length of data in a subroutine according to a parameter passed as argument:
FORM string2table TABLES table
USING line_length
CHANGING string.
" conversion
" working area
DATA table_line(line_length) TYPE c.
...
ENDFORMbut I get an error about the declaration of data: I want to use this function for creating table of any length of line. Is impossible to have something like this?
thanks
Gabriele
Hi,
this is my problem: I want to set the length of data in a subroutine according to a parameter passed as argument:
FORM string2table TABLES table
USING line_length
CHANGING string.
" conversion
" working area
DATA table_line(line_length) TYPE c.
...
ENDFORMbut I get an error about the declaration of data: I want to use this function for creating table of any length of line. Is impossible to have something like this?
thanks
Gabriele
2008 Nov 07 8:19 AM
Hello,
Try in this way it will work.
Field-symbols: <table_line> type ANY
FORM string2table TABLES table
USING line_length
CHANGING string.
" conversion
" working area
DATA table_line(line_length) TYPE c.
Assign line_length to <table_line>.
Now the field symbol will take the lenght of the line_length.
...
ENDFORM
2008 Nov 07 8:31 AM
Hi you can try this
FORM string2table TABLES table TYPE ANY
USING line_length TYPE ANY
CHANGING string TYPE ANY.
" conversion
" working area
DATA table_line(line_length) TYPE c.
...
ENDFORM
2008 Nov 07 9:02 AM
thanks ... you put me on the correct way for the answer. This is is how I solved:
FORM string2table TABLES table
USING line_length
CHANGING string.
" line of the table
FIELD-SYMBOLS: <table_line> TYPE ANY.
" get type of line
DATA ref_wa TYPE REF TO data.
CREATE DATA ref_wa LIKE LINE OF table.
ASSIGN ref_wa->* TO <table_line>.
...
ENDFORM.Edited by: Gabriele Montori on Nov 7, 2008 10:02 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |