2008 Jul 29 10:48 AM
Hi friends,
can anyon tell me how to create a table type through syntex in SE 38 . I have one structure . Now I need to create one table type . Can anyone help me regarding that ?
Hi friends,
can anyon tell me how to create a table type through syntex in SE 38 . I have one structure . Now I need to create one table type . Can anyone help me regarding that ?
2008 Jul 29 10:50 AM
Let's say your structure is named "my_struct".
Try coding
TYPES: table_type TYPE STANDARD TABLE OF my_struct.Hope it helps.
Avraham
Edited by: Avraham Kahana on Jul 29, 2008 12:51 PM
2008 Jul 29 10:50 AM
DATA: BEGIN OF ITAB OCCURS 0.
INCLUDE STRUCTURE MARA.
DATA: END OF ITAB .
OR
TYPES: BEGIN OF TY_ITAB ,
MATNR LIKE MARA-MATNR,
MEINS LIKE MARA-MEINS,
END OF TY_ITAB .
DATA: ITAB TYPE STANDARD TABLE OF TY_ITAB WITH HEADER LINE .
2008 Jul 29 10:50 AM
Hi,
Please go through the following link, It gives detailed procedure of creating a Table Type from ABAP coding,
[http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb340d358411d1829f0000e829fbfe/content.htm]
2008 Jul 29 10:51 AM
hi,
data : begin of fs_data,
matnr like mara-matnr,
end of fs_data.
data : t_data type standard table of fs_data .
2008 Jul 29 10:52 AM
if your structure name is ty_itab
data it_table type standard table of ty_itab.
2008 Jul 29 10:52 AM
Hi,
Table type is nothing but an internal table.
We can declare it as
types:
it_tab type standard table of spfli.
2008 Jul 29 10:53 AM
Hi Gaurab,
say zstruc is ur sturcture in the program,proceed as below:
data:lt_table type standard table of zstruc,
wa_table type zstruc.
Here,
lt_table = internal table
wa_table = work area
Based on the type of table you need you can replace "STANDARD" in the above code with "SORTED" & "HASHED"
Have A Nice Day
Chaitanya.
2008 Jul 29 10:55 AM
Hi,
you can define a table from type in the following way
TYPES: BEGIN OF t_mara ,
MATNR TYPE ZMARA-MATNR,
MTART TYPE ZMARA-MTART,
MATKL TYPE ZMARA-MATKL,
MEINS TYPE ZMARA-MEINS,
SPRAS TYPE ZMAKT-SPART,
MAKTX TYPE ZMAKT-MAKTX,
WERKS TYPE ZMARC2-WERKS,
CURRENCY TYPE ZMARC2-CURRENCY,
END OF t_mara.
DATA IT_TAB TYPE STANDARD TABLE OF t_mara WITH HEADER LINE .
Thanks & Regards
Ashu Singh
2008 Jul 29 10:56 AM
hi
use this
types: begin of itab1.
include structure VBdpa.
types: end of itab1.
*here we have declared the table type here*
types: itab2 type standard table of itab1.
Cheers
Snehi
2008 Jul 29 10:57 AM
try this piece of code...
this is the user defined data type..
Types: begin of ty_vbak,
vbeln type vbak-vbeln,
auart type vbak-auart,
end of ty_vbak.
data: it_vbak type table of ty_vbak,
wa_vbak type ty_vbak.
select vbeln auart from vbak into table it_vbak upto 20 rows.
loop at it_vbak into wa_vbak.
write:/ wa_vbak-vbeln,
wa_vbak-auart.
endloop.