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

move dynamic internal table to static internal table

Former Member
0 Likes
1,609

Hi all, actully i want to move data from dynamically table to static table.

one person provide me this code, this is right but i'm facing a problem ,i'm getting a error that lt_static is unknown.

so pls tell me how to define that lt_static struture like <lt_dynamic>.

sure rewards,

regards,

if the two tables have exactly the same structure.

lt_static = <lt_dynamic>

If they don't.

LOOP AT <lt_dynamic> ASSIGNING <ls_dynamic>.

MOVE-CORRESPONDING <ls_dynamic> TO ls_static.

INSERT ls_static INTO TABLE lt_static.

ENDLOOP.

You can access individual fields, if move-corresponding isn't sufficient, by using ASSIGN COMPONENT fieldname/number OF STRUCTURE <ls_dynamic> TO <l_field>.

5 REPLIES 5
Read only

Former Member
0 Likes
785

Hi,

write:

data: it_static type lt_dynamic,

is_static like line of it_static.

Regards,

Sujit

Read only

Former Member
0 Likes
785

Hi,

What ever validation's you wish to do you must do in the dynamic table. If you are shure of the structure of the internal table then why go for dynamic internal table.

The system would not support your assignment.

Regards,

Ram.

Read only

Former Member
0 Likes
785

Hi Posim,

i'm not sure for any internal table structure, beco,z i'm using a function module and whatever i collect in dynamiv table i have to pass this through fm parameters and we can not pass dynamin table directlly to fm . so that firstlly i have to pass this dynamicaaly table data to a internal table (whose struture is same as dynmically table struture at runtime).

regards,

Read only

Former Member
0 Likes
785

thanks

Read only

0 Likes
785

Hi

can you please suggest me, the brief outline of how exactly i can transfer dynamic internal table data into a static internal table

and display it in the function module......if possible some sample code also

really appreciable

regards

sam