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 data from gs_data to gt_data

Former Member
0 Likes
1,414

hi all,

i have this:

data: begin of gs_data,

row_selected(1),

bukrs like bsis-bukrs,

hkont like bsis-hkont,

zuonr like bsis-zuonr,

end of gs_data,

gt_data like table of gs_data.

and i want to move data from gs_data to gt_data.

is anyone can help me please?

thanks,

dana.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,174

Use Append statement.. For furthur help,place cursor on Append statement and then press f1 you will get how to use append statement..

hi all,

i have this:

data: begin of gs_data,

row_selected(1),

bukrs like bsis-bukrs,

hkont like bsis-hkont,

zuonr like bsis-zuonr,

end of gs_data,

gt_data like table of gs_data.

and i want to move data from gs_data to gt_data.

is anyone can help me please?

thanks,

dana.

6 REPLIES 6
Read only

Former Member
0 Likes
1,174
Example
TYPES: BEGIN OF COMPANIES_TYPE, 
        NAME(10), SALES TYPE I, 
      END   OF COMPANIES_TYPE. 

DATA COMPANIES TYPE STANDARD TABLE OF COMPANIES_TYPE 
          INITIAL SIZE 3, 
     WA_COMPANIES TYPE COMPANIES_TYPE. 

WA_COMPANIES-NAME = 'big'. 
WA_COMPANIES-SALES = 90. 
APPEND WA_COMPANIES TO COMPANIES. 

WA_COMPANIES-NAME = 'small'. 
WA_COMPANIES-SALES = 10. 
APPEND WA_COMPANIES TO COMPANIES. 

WA_COMPANIES-NAME = 'too small'. 
WA_COMPANIES-SALES =  5. 
APPEND WA_COMPANIES TO COMPANIES. 

WA_COMPANIES-NAME = 'middle'. 
WA_COMPANIES-SALES = 50. 
APPEND WA_COMPANIES TO COMPANIES SORTED BY SALES.
Read only

Former Member
0 Likes
1,174

do this.

loop at gs_data.

<b>gt_data[] = gs_data[].</b>

endloop.

now to check the content .

loop at gt_data.

write:/ gt_data-bukrs.

...

endloop.

regards,

vijay

Read only

Former Member
0 Likes
1,174

Hi,

You cannot move data from structure to internal table. But you can append.

append gs_data to gt_data.

Regards

Bhupal Reddy

Read only

Former Member
0 Likes
1,175

Use Append statement.. For furthur help,place cursor on Append statement and then press f1 you will get how to use append statement..

Read only

Former Member
0 Likes
1,174

try one of this

gt_data[] = gs_data[].

or

append lines of gs_data to gt_data.

or

loop at gs_data.

move-corresponding gs_data to gt_data.

append gt_data.

endloop.

regards

shiba dutta

Message was edited by:

SHIBA DUTTA

Message was edited by:

SHIBA DUTTA

Read only

Former Member
0 Likes
1,174

thank you very much.

the problem was solved.