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

Defining internal table using types

Former Member
0 Likes
783

Hi all,

can u plz explain How can i define an internal table using types?

Thanks & regards

Venkat

5 REPLIES 5
Read only

LucianoBentiveg
Active Contributor
0 Likes
666

TYPES: BEGIN OF type_salida,

hkont LIKE bseg-hkont,

secue TYPE num1,

altkt LIKE skb1-altkt,

txt50 LIKE skat-txt50,

budat LIKE bkpf-budat,

blart LIKE bkpf-blart,

xblnr LIKE bkpf-xblnr,

belnr LIKE bkpf-belnr,

buzei LIKE bseg-buzei,

bktxt LIKE bkpf-bktxt,

debe LIKE bseg-dmbtr,

haber LIKE bseg-dmbtr,

saldo LIKE bseg-dmbtr,

debed LIKE bseg-wrbtr,

haberd LIKE bseg-wrbtr,

saldod LIKE bseg-wrbtr,

wrbtr LIKE bseg-wrbtr,

dmbtr LIKE bseg-dmbtr,

shkzg LIKE bseg-shkzg,

bukrs LIKE bkpf-bukrs,

END OF type_salida.

DATA: t_salida TYPE STANDARD TABLE OF type_salida WITH HEADER LINE.

Read only

Former Member
0 Likes
666

Hi Venkat,

The TYPES statement introduces user-defined data types . As with standard data types, you can use them when creating data objects and when assigning types to formal parameters and field symbols. User-defined data types are an essential component of the ABAP/4 type concept .

TYPES:

BEGIN OF TY_MARA,

MATNR TYPE MARA-MATNR,

MTART TYPE MARA-MTART,

MBRSH TYPE MARA-MBRSH,

MATKL TYPE MARA-MATKL,

END OF TY_MARA.

DATA ITAB TYPE STANDARD TABLE OF TY_MARA WITH HEADER LINE.

To know more about TYPES, Just see the URL.

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/types.htm

<b>Note: Plz award points to all helpful answers.

Close the thread if they are solved.</b>

Thanks,

Vinay

Read only

Former Member
Read only

Former Member
0 Likes
666

if you have a type ty_mytype,

then

data itab type standard table of ty_mytype occurs 0.

Regards,

Ravi

Read only

Former Member
0 Likes
666

Hai Venkat

see the following Code

************************************************************************

  • Table Declaration *

************************************************************************

TABLES: mara,

marc,

mard.

************************************************************************

  • Types Declaration *

************************************************************************

TYPES: BEGIN OF typ_mara,

matnr TYPE mara-matnr, "Material Number"

mbrsh TYPE mara-mbrsh, "Industrial Sector"

mtart TYPE mara-mtart, "Material Type"

meins TYPE mara-meins, "Base Unit of Measure"

END OF typ_mara.

TYPES: BEGIN OF typ_makt,

matnr TYPE makt-matnr, "Material Number"

maktx TYPE makt-maktx, "Material Description"

END OF typ_makt.

TYPES: BEGIN OF typ_marc,

matnr TYPE marc-matnr, "Material Number"

werks TYPE marc-werks, "Plant Number"

END OF typ_marc.

TYPES: BEGIN OF typ_mard,

matnr TYPE marc-matnr, "Material Number"

werks TYPE marc-werks, "Plant Number"

lgort TYPE mard-lgort, "Storage Location"

END OF typ_mard.

************************************************************************

  • Intrnal tables Declaration *

************************************************************************

DATA: it_mara TYPE STANDARD TABLE OF typ_mara WITH HEADER LINE.

DATA: it_makt TYPE STANDARD TABLE OF typ_makt WITH HEADER LINE.

DATA: it_marc TYPE STANDARD TABLE OF typ_marc WITH HEADER LINE.

DATA: it_mard TYPE STANDARD TABLE OF typ_mard WITH HEADER LINE.

Thanks & regards

Sreenivasulu P