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

create_dynamic_table returns no value

Former Member
0 Likes
332

Hi Coomunity,

new_table at CALL METHOD cl_alv_table_create=>create_dynamic_table

hasn' t any value is totaly empty. What can be the reason for that.

I am confused. Pls help

Regards

sas

data:  it type table of string,
       wa     type  string.

move 'john' To wa.
append wa TO it.
move 'hans' To wa.
append wa TO it.
move 'hugo' To wa.
append wa TO it.
move 'jim' To wa.
append wa TO it.

data new_table type ref to data.

data new_line type ref to data.  " ------- >>>> Declare this....

DATA: it_fieldcat TYPE lvc_t_fcat.
DATA: wa_fieldcat TYPE lvc_s_fcat.

FIELD-SYMBOLS: <outtab> TYPE ANY TABLE,
                            <l_line>  TYPE ANY.


LOOP AT it INTO wa.
wa_fieldcat-FIELDNAME = wa.
append wa_fieldcat TO it_fieldcat.
ENDLOOP.


CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fieldcat
        IMPORTING
          ep_table        = new_table.

ASSIGN new_table->* TO <outtab>.
CREATE DATA new_line LIKE LINE OF <outtab>.
ASSIGN new_line->* TO <l_line> .

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
309

I run your code and has been created sucessfully with the following fields

ie


john(10) type c
hans(10) type c
hugo(10) type c
jim(10) type c

Hi Coomunity,

new_table at CALL METHOD cl_alv_table_create=>create_dynamic_table

hasn' t any value is totaly empty. What can be the reason for that.

I am confused. Pls help

Regards

sas

data:  it type table of string,
       wa     type  string.

move 'john' To wa.
append wa TO it.
move 'hans' To wa.
append wa TO it.
move 'hugo' To wa.
append wa TO it.
move 'jim' To wa.
append wa TO it.

data new_table type ref to data.

data new_line type ref to data.  " ------- >>>> Declare this....

DATA: it_fieldcat TYPE lvc_t_fcat.
DATA: wa_fieldcat TYPE lvc_s_fcat.

FIELD-SYMBOLS: <outtab> TYPE ANY TABLE,
                            <l_line>  TYPE ANY.


LOOP AT it INTO wa.
wa_fieldcat-FIELDNAME = wa.
append wa_fieldcat TO it_fieldcat.
ENDLOOP.


CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fieldcat
        IMPORTING
          ep_table        = new_table.

ASSIGN new_table->* TO <outtab>.
CREATE DATA new_line LIKE LINE OF <outtab>.
ASSIGN new_line->* TO <l_line> .

1 REPLY 1
Read only

former_member194669
Active Contributor
0 Likes
310

I run your code and has been created sucessfully with the following fields

ie


john(10) type c
hans(10) type c
hugo(10) type c
jim(10) type c