‎2007 Jul 03 11:25 AM
Hi,
I am creating a base structure, I am getting the error "4 is not expected".
DATA:
Begin of TAB_EMP,
EMPID (4) TYPE N,
ENAME (30) TYPE C,
SALARY TYPE I,
END OF TAB_EMP.
Also plz let me know how to create a table based on this
‎2007 Jul 03 11:26 AM
remove the space in empid and (4) like that
DATA:
Begin of TAB_EMP,
EMPID(4) TYPE N,
ENAME(30) TYPE C,
SALARY TYPE I,
END OF TAB_EMP.
regards
shiba dutta
null
‎2007 Jul 03 11:26 AM
remove the space in empid and (4) like that
DATA:
Begin of TAB_EMP,
EMPID(4) TYPE N,
ENAME(30) TYPE C,
SALARY TYPE I,
END OF TAB_EMP.
regards
shiba dutta
null
‎2007 Jul 03 11:27 AM
HI,
Try This,
DATA:
Begin of TAB_EMP,
EMPID TYPE N, --- >For type N no need to Give Length of the Field,
ENAME (30) TYPE C,
SALARY TYPE I,
END OF TAB_EMP.
Thanks.
‎2007 Jul 03 11:30 AM
‎2007 Jul 03 11:35 AM
Hi,
DATA:
Begin of TAB_EMP,
EMPID(4) TYPE N,
ENAME(30) TYPE C,
SALARY TYPE I,
END OF TAB_EMP.
Data : Itab like table of TAB_emp with header line.
Itab is the Internal Table.
Thanks,
Reward All helpful Answers.
‎2007 Jul 03 11:29 AM
for table
data : itab like TAB_EMP occurs 0 [with header line].
the statement in [with header line] is optional.
regards
shiba dutta
‎2007 Jul 03 11:41 AM
Try This
DATA:
Begin of TAB_EMP,
EMPID(4) TYPE N,
ENAME(30) TYPE C,
SALARY TYPE I,
END OF TAB_EMP.
Data : Itab like table of TAB_emp.
here Itab is an internal table.
Thanks
‎2007 Jul 03 11:44 AM
Hi,
You can use Standard Table concept.
When you create a standard table, you can use the following forms of the TYPES and DATA
statements. The addition INITIAL SIZE is also possible in all of the statements. The addition
WITH HEADER LINE is possible in the DATA statement.
Standard Table Types
Generic Standard Table Type:
TYPES <itab> TYPE|LIKE [STANDARD] TABLE OF <linetype>.
The table key is not defined.
Fully-Specified Standard Table Type:
TYPES <itab> TYPE|LIKE [STANDARD] TABLE OF <linetype>
WITH [NON-UNIQUE] <key>.
The key of a fully-specified standard table is always non-unique.
Standard Table Objects
Short Forms of the DATA Statement
DATA <itab> TYPE|LIKE [STANDARD] TABLE OF <linetype>.
DATA <itab> TYPE|LIKE [STANDARD] TABLE OF <linetype>
WITH DEFAULT KEY.
Both of these DATA statements are automatically completed by the system as follows:
DATA <itab> TYPE|LIKE STANDARD TABLE OF <linetype>
WITH NON-UNIQUE DEFAULT KEY.
The purpose of the shortened forms of the DATA statement is to keep the declaration of standard
tables, which are compatible with internal tables from previous releases, as simple as possible.
When you declare a standard table with reference to the above type, the system automatically
adopts the default key as the table key.
Fully-Specified Standard Tables:
DATA <itab> TYPE|LIKE [STANDARD] TABLE OF <linetype>
WITH [NON-UNIQUE] <key>.
The key of a standard table is always non-unique.
For your question, internal table will create like this:
data itab type standard table of tab_emp with default key.
Regards,
Bhaskar