2007 May 28 5:37 AM
hi guru
please tell me how to declare int. table in real time with example.
i want how to write with types keyward.
regards
subhasis
2007 May 28 5:41 AM
************************************************************************
* 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.
hi guru
please tell me how to declare int. table in real time with example.
i want how to write with types keyward.
regards
subhasis
2007 May 28 5:41 AM
************************************************************************
* 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.
2007 May 28 5:41 AM
hi Subhasish ,
procees ike this .
types : begin of itab1,
field1 like tablename-fieldname,
field2 like tablename-fieldname,
end of itab1 .
data: itab2 type table of itab1 occurs 0 .
or
data: itab2 type itab1 occurs 0 with header line .
Regards,
Ranjita
2007 May 28 5:44 AM
2007 May 28 5:45 AM
Hi,
In real time the ITABs declaration will be of without header line
Data : begin of t_type,
mara type mara-matnr,
Data : end of t_type.
table and work area
data : i_table type standard table of t_type,
wa type t_type.
Regards
Shiva
2007 May 28 5:59 AM
No, u should not use header line statement or occurs 0 , it is not performance oriented
use the following code..
types : begin of ty_mara,
matnr type mara-matnr,
mtart type mara-mtart,
end of ty_mara,
ty_t_mara type standard table of ty_mara.
data : wa_mara type ty_mara,
it_mara type ty_t_mara.
here it_mara is the internal table and wa_mara is the work area..
it is the best way to define and to use also .
rewards ..
if helpful
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |