‎2006 Jul 19 6:34 AM
Hi,
How to declare a internal table and work area for the internal table without using occurs n and using types.I have to select fields from differnet tables and put in an internal tables.
tables are mseg,mkpf
‎2006 Jul 19 6:40 AM
*internal table declaration
data: itab_mseg like table of mseg,
itab_mkpf like table of mkpf.
*work area declaration
data: wa_mseg like mseg,
wa_mkpf like mkpf.
Cheers,
Abdul Hakim
‎2006 Jul 19 6:40 AM
*internal table declaration
data: itab_mseg like table of mseg,
itab_mkpf like table of mkpf.
*work area declaration
data: wa_mseg like mseg,
wa_mkpf like mkpf.
Cheers,
Abdul Hakim
‎2006 Jul 19 6:40 AM
ex----
types : begin of ty_tab,
matnr type matnr,
end of ty_tab.
data : it_tab type standard table of ty_tab,
wa_tab type ty_tab.
The above type declaration is better.Also try to use fieldsymbols which increase the perforamnce
‎2006 Jul 19 6:41 AM
Hi,
data: it_mseg type table of mseg,
it_mkpf type table of mkpf.
data: wa_mseg type mseg,
wa_mkpf type mkpf.or declare types
types: brgin of ty_itab,
include your fields here....
end of ty_itab.
data: itab type table of ty_itab,
wa_itab type ty_itab.Regards
vijay
‎2006 Jul 19 6:42 AM
Hi ,
The syntax is:
TYPES : BEGIN OF t_table.
INCLUDE STRUCTURE mseg.
TYPES : END OF t_table .
data: i_table type standard table of t_table.
Regards,
Sumit.
‎2006 Jul 19 6:42 AM
Amit,
1. DATA : WA_ITAB LIKE (Same TYPE as that of the internal table).
2. DATA : wa_itab like line of internal table.
loop at itab into wa_itab.
endloop.
Regards,
Ravi
Note : Please mark all the helpful answers
‎2006 Jul 19 6:42 AM
hi
types : begin of t_itab,
matnr type matnr,
end of ty_tab.
data : t_itab type standard table of t_itab,
wa_tab type t_itab.
Naveen
‎2006 Jul 19 6:44 AM
Hi Amit
TYPES: BEGIN OF LINE,
COLUMN1 TYPE I,
COLUMN2 TYPE I,
COLUMN3 TYPE I,
END OF LINE.
TYPES ITAB TYPE SORTED TABLE OF LINE WITH UNIQUE KEY COLUMN1
Reward point if helpful.
Regards
Abhishek
‎2006 Jul 19 6:44 AM
HI Amit,
Define :
TYPES: BEGIN OF WA_MSEG_MKPF,
field1 type mseg-field1,
field2 type mseg-field2,
field3 type mkpf-field3,
field4 type mkpf-field4,
END OF WA_MSEG_MKPF.
DATA: ITAB_MSEG_MKPF TYPE TABLE OF WA_MSEG_MKPF.CHEERS,
Vijay Raheja
‎2006 Jul 19 6:44 AM
Hi amit teja,
You can define your internal table as:
data: begin of itab,
matnr like mara-matner,
vbeln like mseg-vbeln,
....
...
end of itab.
or you can use type table of mara,
here you can use mara,mseg DDiC table and now you can select data with useig join(inner / outer ) fetch data or selecting fields from mara and mseg and move-corresponding fields mara to itab.
move-corresponding from mseg into itab.
regards.
Ankur garg.
Message was edited by: Ankur Garg
‎2006 Jul 19 6:44 AM
hi,
TYPES: begin of w_tab,
vbeln type vbeln,
end of w_tab.
TYPES t_tab type standard table of w_tab.
Regards,
Subha.
‎2006 Jul 19 6:44 AM
Hi,
Do like this.
data: begin of work_area,
field1 type tab1-field1,
field2 type tab2-field2,
end of work_area.
data: itab type table of work_area with header line.
Regards,
SP.
‎2006 Jul 19 6:46 AM
hi amit,
u can use 'Innerjoin' or 'For all entries' and fill the internal table.
'Innerjoin': put all fields in a select and use 'into corresponding fields'
'For all entries': if u, using more than 1 internal table.
try it out,
cheers,
Aditya.
‎2006 Jul 19 6:55 AM
hi amit,
u can declare like that-->
types: begin of wa_itab,
MBLNR like mseg-MBLNR,
MJAHR like mkpf-MJAHR,
end of wa_itab.
data: itab type table of wa_itab.
if it will help u than give reward points.
with regards
chetan vishnoi