Skip to content

Instantly share code, notes, and snippets.

@EkremGungormez
Created May 18, 2012 09:17
Show Gist options
  • Save EkremGungormez/2724210 to your computer and use it in GitHub Desktop.
Save EkremGungormez/2724210 to your computer and use it in GitHub Desktop.
abap inner join example
TABLES: MKPF,
MSEG.
DATA: BEGIN OF gs_ara,
mblnr type mkpf-mblnr,
mjahr TYPE mkpf-mjahr,
budat TYPE mkpf-budat,
tcode2 TYPE mkpf-tcode2,
usnam TYPE mkpf-usnam,
cpudt TYPE mkpf-cpudt,
cputm TYPE mkpf-cputm,
bktxt TYPE mkpf-bktxt,
xauto TYPE mseg-xauto,
werks TYPE mseg-werks,
lgort TYPE mseg-lgort,
shkzg TYPE mseg-shkzg,
dmbtr TYPE mseg-dmbtr,
menge TYPE mseg-menge,
meins TYPE mseg-meins,
END OF gs_ara.
DATA gt_ara like STANDARD TABLE OF gs_ara.
select
mk~mblnr mk~mjahr
mk~budat mk~tcode2
mk~usnam mk~cpudt
mk~cputm mk~bktxt
ms~xauto ms~werks
ms~lgort ms~shkzg
ms~dmbtr ms~menge
ms~meins
into CORRESPONDING FIELDS OF TABLE gt_ara
from
mkpf as mk
INNER JOIN
mseg as ms
on
mk~mblnr = ms~mblnr
where
mk~mjahr = '2012'
and
ms~shkzg = 'H'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment