‎2006 Nov 03 6:29 AM
Hi experts,
I have two internal tables.
data: g_mseg type mseg.
data: t_mseg like mseg occurs 0 with header line.
I have data in g_mseg table.
How can i transfer g_mseg data into t_mseg table?
Thanks
kaki
‎2006 Nov 03 6:33 AM
Hi
G_MSEG here is structure and T_MSEG is internal table, both having the same structure.
You can use below statement:
append g_mseg to t_mseg.Kind Regards
Eswar
‎2006 Nov 03 6:35 AM
hi kaki,
g_mseg is like a work area, its not an internal table.
t_mseg is an internal table.
Just use the statement append
append g_mseg to t_mseg.
Regards
- Gopi
‎2006 Nov 03 6:39 AM
U have decalred g_mseg in this way <b>g_mseg type mseg</b>, so this is not internal table but it is a structure.
Then you can have only one record at a time in g_mseg. To append the data u can do it in thsi way.
DATA: g_mseg TYPE mseg.
DATA: t_mseg LIKE mseg OCCURS 0 WITH HEADER LINE.
SELECT SINGLE * FROM mseg INTO g_mseg
WHERE mblnr = '0049000000'.
IF sy-subrc = 0.
APPEND g_mseg TO t_mseg.
IF sy-subrc = 0.
ENDIF.
ENDIF.
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers
‎2006 Nov 03 6:39 AM
Hi kaki,
g_mseg is a work area, not an internal table where as
t_mseg is an internal table.Bothr having same structures.
use append statemnt .
append g_mseg to t_mseg.
regards,
nagaraj