VinceCoder
4/10/2019 - 7:52 AM

Controllo tabelle per differenze

Controllo tra tabelle per evidenziarne le differenze. Queste righe vengono messe in tabella di appoggio per eventualmente mostrarle a schermo in alv_popup

  DATA: ls_tout_compare LIKE LINE OF lt_tout,
        ls_tout LIKE LINE OF lt_tout.

  lt_tout[] = tout[].
  lt_tout_compare[] = tout_compare[].

  LOOP AT lt_tout INTO ls_tout.
    READ TABLE lt_tout_compare WITH KEY aufpl = ls_tout-aufpl
                                        aplzl = ls_tout-aplzl
                                        vornr = ls_tout-vornr
                                        TRANSPORTING NO FIELDS.
    IF sy-subrc <> 0.
      APPEND ls_tout TO it_differences.
    ENDIF.
  ENDLOOP.

  LOOP AT lt_tout_compare INTO ls_tout_compare.
    READ TABLE lt_tout WITH KEY aufpl = ls_tout_compare-aufpl
                                aplzl = ls_tout_compare-aplzl
                                vornr = ls_tout_compare-vornr
                                TRANSPORTING NO FIELDS.
    IF sy-subrc <> 0.
      APPEND ls_tout_compare TO it_differences.
    ENDIF.
  ENDLOOP.