2010 Apr 06 1:39 PM
data :
wa_itab type zempmasternish,
itab type table of zempmasternish,
wa_itab_sec type zdepartnish,
itab_sec type TABLE OF zdepartnish,
fieldcatalog type slis_t_fieldcat_alv with header line,
v_prog_name type sy-repid.
select empno deptno deptname from zdepartnish into itab_sec where empno = itab-empno.i am getting an error that work area cannot be used as an internal table with the above select statement can you please help me out with this.
Edited by: Thomas Zloch on Apr 6, 2010 2:43 PM - tags added
2010 Apr 06 1:47 PM
What do you want to do? Read into a workarea? Use ... INTO wa_itab_sec ...
Read into an internal table? Use ... INTO TABLE itab_sec ...
Also study online help for SELECT statement which explains everything.
Thomas
data :
wa_itab type zempmasternish,
itab type table of zempmasternish,
wa_itab_sec type zdepartnish,
itab_sec type TABLE OF zdepartnish,
fieldcatalog type slis_t_fieldcat_alv with header line,
v_prog_name type sy-repid.
select empno deptno deptname from zdepartnish into itab_sec where empno = itab-empno.i am getting an error that work area cannot be used as an internal table with the above select statement can you please help me out with this.
Edited by: Thomas Zloch on Apr 6, 2010 2:43 PM - tags added
2010 Apr 06 1:47 PM
What do you want to do? Read into a workarea? Use ... INTO wa_itab_sec ...
Read into an internal table? Use ... INTO TABLE itab_sec ...
Also study online help for SELECT statement which explains everything.
Thomas
2010 Apr 06 1:47 PM
Hi,
Either write
select empno deptno deptname from zdepartnish into table itab_sec where empno = wa_itab-empno.
or write
select empno deptno deptname from zdepartnish into wa_itab where empno = wa_itab-empno.
Thanks & Regards
Rocky
2010 Apr 06 1:47 PM
You are trying to use a table field in your WHERE clause w/o using FOR ALL ENTRIES.
2010 Apr 06 1:47 PM
THE CORRECT CODE IS
SELECT EMPNO DEPTNO DEPTNAME FROM ZDEPARTNISH INTO TABLE ITAB_SEC WHERE EMPNO = WA_ITAB-EMPNO.
THE INCORRECT CODE IS :
SELECT EMPNO DEPTNO DEPTNAME FROM ZDEPARTNISH INTO ITAB_SEC WHERE EMPNO = WA_ITAB-EMPNO
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |