abapOpenChecks icon indicating copy to clipboard operation
abapOpenChecks copied to clipboard

Check 24 - Exclude TYPES from identical code bloc check

Open AlexandreHT opened this issue 5 years ago • 0 comments

As I write an ALV report, check 24 was triggered by 2 different TYPES structure declarations with a large number of identical components. I think TYPES instructions should be excluded from the check.

Unit test

  method test002_01.
* ===========

    _code 'types: begin of ty_alv,'.
    _code '         bzobj type keko-bzobj,'.
    _code '         kalnr type keko-kalnr,'.
    _code '         kalka type keko-kalka,'.
    _code '         kadky type keko-kadky,'.
    _code '         tvers type keko-tvers,'.
    _code '         bwvar type keko-bwvar,'.
    _code '         kkzma type keko-kkzma,'.
    _code '         matnr type keko-matnr,'.
    _code '         werks type keko-werks,'.
    _code '         bwkey type keko-bwkey,'.
    _code '         bwtar type keko-bwtar,'.
    _code '         kokrs type keko-kokrs,'.
    _code '         hwaer type ckhs-hwaer,'.
    _code '         vprsv type mbew-vprsv,'.
    _code '         valuation_price type mbew-stprs,'.
    _code '         peinh type mbew-peinh,'.
    _code '       end   of ty_alv,'.
    _code '       tty_alv type standard table of ty_alv.'.
    _code 'types: begin of ty_cost_estimate_header,'.
    _code '         bzobj type keko-bzobj,'.
    _code '         kalnr type keko-kalnr,'.
    _code '         kalka type keko-kalka,'.
    _code '         kadky type keko-kadky,'.
    _code '         tvers type keko-tvers,'.
    _code '         bwvar type keko-bwvar,'.
    _code '         kkzma type keko-kkzma,'.
    _code '         matnr type keko-matnr,'.
    _code '         werks type keko-werks,'.
    _code '         bwkey type keko-bwkey,'.
    _code '         bwtar type keko-bwtar,'.
    _code '         kokrs type keko-kokrs,'.
    _code '         kadat type keko-kadat,'.
    _code '         bidat type keko-bidat,'.
    _code '       end of ty_cost_estimate_header,'.
    _code '       tty_cost_estimate_header type standard table of ty_cost_estimate_header.'.

    ms_result = zcl_aoc_unit_test=>check( mt_code ).

    cl_abap_unit_assert=>assert_initial( ms_result ).

  endmethod.

AlexandreHT avatar Aug 28 '20 07:08 AlexandreHT