I am working on ABAP program - user input is to query column ANLAGE
and output is to get all records from table EADZ
(and only fields of EADZ
) based on ANLAGE
.
Statement and joins should work like this:
- Input
ANLAGE
, find in tableEASTL
, getsLOGIKNR
- Input
LOGIKNR
, find in tableEGERR
, getsEQUNR
- Input
EQUNR
, find in tableETDZ
, getsLOGIKZW
- Input
LOGIKZW
, find in tableEADZ
, gets all records (this is the final output)
Here is the code I tried:
DATA: gt_cas_rezy TYPE STANDARD TABLE OF eadz,
lv_dummy_eanl LIKE eanl-anlage.
SELECT-OPTIONS: so_anl FOR lv_dummy_eanl NO INTERVALS NO-EXTENSION.
SELECT * FROM eadz
INNER JOIN etdz ON eadz~logikzw EQ etdz~logikzw
INNER JOIN egerr ON etdz~equnr EQ egerr~equnr
INNER JOIN eastl ON egerr~logiknr EQ eastl~logiknr
INTO CORRESPONDING FIELDS OF TABLE @gt_cas_rezy
WHERE eastl~anlage IN @so_anl.
I got the records from table EADZ
except that the date fields are empty (even though, they are filled in database table). I am assuming there is a problem with JOINs since in statement like this I join all the fields of all 4 tables into one "record" and then to corresponding fields of internal table.
How to get the values of date fields?