‎2008 Mar 18 1:55 PM
HI
IN CREATION OF REPORT
which is better to write nameoftable-fieldname or dataelementname
for exp :
1.
Types : begin of ty_mara,
matnr type mara-matnr,
pstat type mara-pstat ,
end of ty_mara.
2.
Types : begin of ty_mara,
matnr type matnr ,
pstat type pstat_d,
end of ty_mara.
which one is the common practice...
pls tell me this
Regards
Rajan Mehta
‎2008 Mar 18 2:00 PM
Hi rajan,
1. I would say the first one TABLE-FIELDNAME
is always better.
2. Bcos
3. We are essentially interested in the FIELDNAMEs type.
4. In future, if SAP changes the data element of the
field, then we do not need to change the program.
The program (since it is declared using table-fieldname),
will automatically ADAPT to the new settings.
(If we had declared using data element, then
our program would not ADAPT to the field in question. It would
still point to the old data element, which is now not used in the table)
regards,
amit m.
‎2008 Mar 18 1:57 PM
Hi,,
Types : begin of ty_mara,
matnr type mara-matnr,
pstat type mara-pstat ,
end of ty_mara.This is the best way .
Regards,
S.Nehru
‎2008 Mar 18 1:57 PM
referring to the data element .. is better ...
as the nameoftable-fieldname will also refer to the data element
‎2008 Mar 18 1:57 PM
Hi,
The first one is of common practice, and widely used.
The second one is usually not preferred because it generally refers to a domain and not to a field.
<REMOVED BY MODERATOR>
Regards.
Edited by: Alvaro Tejada Galindo on Mar 18, 2008 6:15 PM
‎2008 Mar 18 1:58 PM
‎2008 Mar 18 1:58 PM
Hi,
Both are same.....
mara-matnr is reference matnr of mara but if u wrote matnr type matnr it means it refrenced directly journal matnr data element but a purpose for which u r using no issues u can use either.......
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Mar 18, 2008 6:15 PM
‎2008 Mar 18 2:00 PM
Hi rajan,
1. I would say the first one TABLE-FIELDNAME
is always better.
2. Bcos
3. We are essentially interested in the FIELDNAMEs type.
4. In future, if SAP changes the data element of the
field, then we do not need to change the program.
The program (since it is declared using table-fieldname),
will automatically ADAPT to the new settings.
(If we had declared using data element, then
our program would not ADAPT to the field in question. It would
still point to the old data element, which is now not used in the table)
regards,
amit m.