Quantcast
Viewing all articles
Browse latest Browse all 9080

Re: How to append records to final table with conditions

   *declare output itab
DATA: BEGIN OF it_output,
  vbeln type....
  refdocnr...
  fkdat...
  vprs_kbetr...
  zk03_kbetr..
  z004_kbetr...
  ek02_kbetr...
end of it_output.

LOOP AT it_join INTO wa_join.
  MOVE vbeln fkdat from wa_join into wa_output.
  LOOP AT it_konv INTO wa_konv
    with key.....
    CASE wa_konv-kschl.
      WHEN 'VPRS'.
        MOVE wa_konv-kbetr TO wa_output-vprs_kbetr.
        ....
        etc....
        ....
    ENDCASE.
    READ TABLE it_glpca WITH KEY.... into wa_glpca.
    IF sy-subrc = 0.
      MOVE wa_glpca-refdocnr TO wa_output-refdocnr.
    ENDIF.
    APPEND wa_output TO it_output.
  ENDLOOP.
ENDLOOP.


Viewing all articles
Browse latest Browse all 9080

Trending Articles