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

regarding dynamic internal table

Former Member
0 Likes
439

HI,

How to create dynamic internal table bsed on select options.

for examle if i give site as 1111 & 2222 . i want internal table with 2 fields.

Regards,

Sky

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
408

Hi,

Check the following thread. A detailed explanation of dynamic internal tables along with examples are given.

[]

Regards,

Vik

3 REPLIES 3
Read only

Former Member
0 Likes
409

Hi,

Check the following thread. A detailed explanation of dynamic internal tables along with examples are given.

[]

Regards,

Vik

Read only

Former Member
0 Likes
408

hi,

what you can do is, have all fields in your internal table(say 10 fields).

and based on your condition 1111 or 2222 you can fill the required fields.

Regards

Sajid

Read only

Former Member
0 Likes
408

Hi,

see following example.



PARAMETERS : p_table(10) TYPE C.

  DATA: w_tabname TYPE w_tabname,            

        w_dref TYPE REF TO data,             

        w_grid TYPE REF TO cl_gui_alv_grid. 

  FIELD-SYMBOLS: <t_itab> TYPE ANY TABLE. 

  w_tabname = p_table. 

  CREATE DATA w_dref TYPE TABLE OF (w_tabname).

  ASSIGN w_dref->* TO <t_itab>.

 Populating Dynamic internal table 

  SELECT *

    FROM (w_tabname) UP TO 20 ROWS

    INTO TABLE <t_itab>.

 Displaying dynamic internal table using Grid. 

  CREATE OBJECT w_grid

    EXPORTING i_parent = cl_gui_container=>screen0. 

  CALL METHOD w_grid->set_table_for_first_display

    EXPORTING

      i_structure_name = w_tabname

    CHANGING

      it_outtab        = <t_itab>. 

  CALL SCREEN 100.

Best regards,

pravin