-1

I have declared an internal table.

DATA ITAB_DEPT TYPE TABLE OF ZCLOUD9_DEPT WITH HEADER LINE.

SELECT A~DEPT_ID A~DEPT_NAME A~DEPT_NO A~EMP_ID B~FIRST_NAME B~LAST_NAME
INTO TABLE ITAB_DEPT FROM ZCLOUD9_DEPT AS A
INNER JOIN  ZCLOUD9_EMP AS B
ON A~EMP_ID = B~EMP_ID
WHERE A~DEPT_ID = MEM_DEPT_ID.

WRITE AT: /1 'Department ID' , 15 'Dept Name' , 30 'Tel No' , 40 'Dept I/C ID' , 50 'Dept I/C'.
uline.
LOOP AT ITAB_DEPT.
WRITE AT: /1 ITAB_DEPT-DEPT_ID , 15 ITAB_DEPT-DEPT_NAME ,
30 ITAB_DEPT-DEPT_NO, 40 ITAB_DEPT-EMP_ID , 50 ITAB_DEPT-FIRST_NAME , 59 ITAB_DEPT-LAST_NAME.

when i have activate the program, the syntax error states that the itab_dept does not have a component called first_name/last_name

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Pu3
  • 11
  • 1
  • 5
  • so what? The error is clear enough, your table itab_dept doesn't seem to have the field FIRST_NAME. You declare ITAB_DEPT as a table of type ZCLOUD9_DEPT, so look at that table/structure and see if it really doesn't have that field. If it doesn't, you know what is going on. You have to define your ITAB_DEPT with the fields you need. – Dirk Trilsbeek Dec 23 '14 at 08:50

1 Answers1

1

You should declare your 'ITAB_DEPT' similar to this.

types: begin of struct_dept.
    include type zcloud9_dept.
    include type zcloud9_emp.
types: end of struct_dept.

data: itab_dept type table of struct_dept with header line.

Right now, 'ITAB_DEPT' only contains the fields of 'ZCLOUD9_DEPT' table. You also need the fields of 'ZCLOUD9_EMP' to join them.

This may not work right out of the box, but it should put you on the right path.

akin
  • 11
  • 1