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 Structure during Run Time

Former Member
0 Likes
658

Hello Experts,

I have an internal table. Internal table contains one filed whcih is NAME and NAME contains some FILED NAME like: NAME2, STRAS, LAND1, STATE etc.

I want to create one structure in runt time and structure fileds should be internal table field name.

Dynamicly i want to create.

So how can i create?

Regards,

Ranveer

4 REPLIES 4
Read only

Former Member
0 Likes
609

DATA: dy_table      TYPE REF TO data.


  CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
      it_fieldcatalog = gt_fcat[] " fieldcatalog with your specific structure
    IMPORTING
      ep_table        = dy_table. " your internal table which is created in runtime

" now you need to create a line or structure
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
609

>

> I want to create one structure in runt time and structure fields should be internal table field name.

Very well. But what about the data types of these fields, where is it defined ?

Read only

Former Member
0 Likes
609

Sorry Guys.

This is not a solution.

Read only

Former Member
0 Likes
609

well, first you need to fill the fieldcatalog. then you will get a dynamic itab. Once you get your dinamic itab you need to create a structure.

DAta : ls_itab like line of gt_itab " which is you get a min ago dynamically.

I didn't write down all the coding coz I wanted to give you a clue so you can find it on your own.

thanks, and it works believe me.