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

How to create dynamic work area which is like dynamic internal table?

Former Member
0 Kudos
1,061
  CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
      i_style_table             = 'X'
      it_fieldcatalog           = it_fcat
*       i_length_in_byte = 'X'
    IMPORTING
      ep_table                  = gt_dyn_table
    EXCEPTIONS
      generate_subpool_dir_full = 1
      OTHERS                    = 2.
  IF sy-subrc EQ 0.
* Assign the new table to field symbol
    ASSIGN gt_dyn_table->* TO <gfs_dyn_table>.
* Create dynamic work area for the dynamic table
    CREATE DATA gw_line LIKE LINE OF  <gfs_dyn_table>.
    CREATE DATA gw_line1 LIKE LINE OF <gfs_dyn_table>.
    ASSIGN gw_line->* TO <gfs_line>.
    ASSIGN gw_line1->* TO <gfs_line1>.
  ENDIF.
<br>

I have created a dynamic intenal table and created work area for that and assigned field symbols for work area.

Now all the fields in <gfs_line> will be type c(10) so I'm loosing data while populating work area.

3 REPLIES 3
Read only

SimoneMilesi
Active Contributor
0 Kudos
798

Hi Naveed.

If you share your code, we can give you some hints.

At the moment, i do not understand what you did, how you did and which is the problem 😕

Read only

RaymondGiuseppi
Active Contributor
0 Kudos
798

How to create/I have created... What did you already perform, which RTTS (RTTC actually) class did you already try?

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
0 Kudos
798

The answer to the question in the title is clear:

You use RTTI to get the line type of the "dynamic internal table" and RTTC to create the corresponding "dynamic work area".

It is unclear what you want to express with the rest of the post.