Skip to content

Latest commit

 

History

History
112 lines (78 loc) · 2.95 KB

DdlTypoRule.md

File metadata and controls

112 lines (78 loc) · 2.95 KB

<-- previous rule | overview | next rule -->

Correct frequent typos in DDL comments

Corrects frequent typos in DDL comments and adds warnings about typos in annotation values. Only considers typos with unambiguous correction.

Options

  • Correct frequent typos
  • Change from British English to American English
  • Apply on comments
  • Add TODO on annotation values
  • Add TODO on annotation references

Examples

// no authorisation check requried
@AccessControl.authorizationCheck: #NOT_REQUIRED

@EndUserText.label: 'main dcoument imformation'

@Metadata.allowExtensions: true

// to fix typos in references, the element itself must be renamed, too
@ObjectModel.semanticKey: [ 'Mesage', 'Valididty' ]

define view C_AnyView
  as select from I_AnyDocument as Doc

  // assocation to coresponding other view
  association[1..* ] to I_OtherView as _OtherAlias
    on Doc.DocumentId = _OtherAlias.DocumentId

{
      // docuent ID
  key Doc.DocumentId,

      -- docuemnt name and attibutes
      Doc.DocumentName,
      Doc.Mesage,
      Doc.Valididty,
      Doc.CreatedOn,
      Doc.CreatedBy,

      // caculate total ammount
      (Doc.InitialAmount + Doc.DeltaAmount) as TotalAmount,

      /* to optimise perfomance, only expose small selction of
         fields neccessary for the applicaton; futher detials
         could be made avaialable separatly via extention */
      Doc.AnyField,
      Doc.OtherField,

      _OtherAlias
}

Resulting code:

// no authorization check required
@AccessControl.authorizationCheck: #NOT_REQUIRED

// TODO: check spelling: dcoument (typo) -> document (ABAP cleaner)
// TODO: check spelling: imformation (typo) -> information (ABAP cleaner)
@EndUserText.label: 'main dcoument imformation'

@Metadata.allowExtensions: true

// to fix typos in references, the element itself must be renamed, too
@ObjectModel.semanticKey: [ 'Mesage', 'Valididty' ]

define view C_AnyView
  as select from I_AnyDocument as Doc

  // association to corresponding other view
  association[1..* ] to I_OtherView as _OtherAlias
    on Doc.DocumentId = _OtherAlias.DocumentId

{
      // document ID
  key Doc.DocumentId,

      -- document name and attributes
      Doc.DocumentName,
      Doc.Mesage,
      Doc.Valididty,
      Doc.CreatedOn,
      Doc.CreatedBy,

      // calculate total amount
      (Doc.InitialAmount + Doc.DeltaAmount) as TotalAmount,

      /* to optimize performance, only expose small selection of
         fields necessary for the application; further details
         could be made available separately via extension */
      Doc.AnyField,
      Doc.OtherField,

      _OtherAlias
}

Related code