2007 Feb 26 7:54 AM
Hi
Please give our commetes on below question.
What is the difference between using Type and Like for TABLES in a function module interface?
Regards,
Hi
Please give our commetes on below question.
What is the difference between using Type and Like for TABLES in a function module interface?
Regards,
2007 Feb 26 7:59 AM
Hi shwetambari,
1. In se37, in Tables parameter,
2. it will not allow type
eg. A LIKE T001 -
ok
B Type T001 -
error (system will give message
Flat types may only be referenced using LIKE
table parameters )
regards,
amit m.
2007 Feb 26 1:16 PM
Is there any senario where we can use 'TYPE ' in table parameter of se37?
If not, please explain why?
2007 Feb 26 1:26 PM
Hi again,
1.
ABC TYPE T001A_T (<---- this is table type)
B TYPE BUKRS (<----- this is data element)
2. In the above cases, TYPE will work in se37,
in IMPORT/EXPORT/CHANGING Parameters.
3. ABC TYPE T001A_T (<---- this is table type)
This will work in TABLES parameter also.
regards,
amit m.
2007 Feb 26 1:38 PM
can you please explain why only table types are accepted with type in table parameters where as in all the other parametes type can be used with the table name as well.
2007 Feb 26 8:02 AM
hi
for FM creation preferred one is TYPE only.
if you use LIKE while creating FM
system will give message
Flat types may only be referenced using LIKE
table parameter.
Regards,
kumar
2007 Feb 26 8:22 AM
Example
DATA NUMBER TYPE I.
DATA WA_SPFLI TYPE SPFLI.
The field NUMBER is created with type I. You can now use it in the program. In particular, you can assign numeric values to the field and use it in calculations ( ABAP number types).
The field WA_SPFLI is created using the type of the database table SPFLI from the ABAP Dictionary. This field is structured and can be used especially for working with data from database table SPFLI.
... LIKE f1
Field f is created with the same field attribtues as the data object f1, which has already been declared. Any data object (field, parameter, structure...) is allowed as long as its type has been fully specified.
f1 can be any ABAP Dictionary reference.
Example
DATA TABLE_INDEX LIKE SY-TABIX.
The field TABLE_INDEX now has the same attributes as SY-TABIX (index field for internal tables).
Note
You should use this addition whenever you can. If the type of a field to which you are referring changes, the ABAP runtime system updates all references automatically. It also stops the system from carrying out unnecessry (and maybe undesirable) type conversions.
2007 Feb 26 8:40 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |