Different object keys

Werner Koessl Werner.Koessl at hirschvogel.de
Fri Jul 9 03:53:49 EDT 2004


Hi everybody,
 
i've noticed a difference between the keys of object types.
I take 2 object types as an example: EMPLOYEET and DRAW.
 
The key of DRAW consists of 4 fields: DocumentType, -Number, -Version, =
-Part.
The key of EMPLOYEET consists of 2 fields: Number and ValidityBegin.
 
I've implemented a method for both object types.
In the DRAW-method i can use the key fields with e.g. =
object-key-DocumentNumber.
In the EMPLOYEET-method i cannot use e.g. object-key-Number.
 
I know why it doesn't work but i don't know the reason for that =
implementation of SAP.
In DRAW the key-fields are implemented like this:
       BEGIN OF key,
            documenttype LIKE draw-dokar,
            documentnumber LIKE draw-doknr,
            documentversion LIKE draw-dokvr,
            documentpart LIKE draw-doktl,
       END OF key.
 
But in EMPLOYEET the key field looks like the following:
       key LIKE swotobjid-objkey.
I thought it have to look like this:
       BEGIN OF key,
            Number LIKE pakey-pernr,
            ValidityBegin LIKE pakey-begda,
       END OF key.
 
But why is it different ???
 
Regards,
Werner.
 


More information about the SAP-WUG mailing list