on 03-07-2008 1:00 PM
hi guys,
my requirement is this. I am passing a value(p_empno) to SF from SE38 pgm through function. i want to fetch the records from 2 tbls based on this value. In global definition, under initialisation tab, i wrote the code:
data : itab type table of str,
wa_itab type str.
select aempno aname a~dob
bdept bloc b~sal into table itab
from zempmaster as a
inner join zempdetails as b on bempno = aempno
where a~empno = p_empno.
the error is : itab is neither specified under "TABLES" nor is it defined as an internal table.
Hi,
*Global Data*
itab type str. -
> itab type table of str [Try this]
wa_itab type str.
Types
types:begin of str,
empno like zempmaster-empno,
name like zempmaster-name,
dob like zempmaster-dob,
dept like zempdetails-dept,
loc like zempdetails-loc,
sal like zempdetails-sal,
end of str.
Initialization
code for fetching data from DB into itab.
The ERROR is:
Field itab is unknown
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you define the internal table in "Initialization" tab or "Global data" tab.
If in "Initialization" tab, that should work.
If in "Global data" tab, don't forget to fill the "Output parameters" with itab and the "Input parameter" with p_empno.
Also str is only a data element of length 12. is it long enough ?
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
When you declare in initialization area the type used in global definition will show an error message
so if you have declared a TYPE then declare it in TYPES area
If you declare it in INITIALIZATION area then you can use within that only but not for interface and for TYPE
in TYPES
types: begin of t_vbak,
vbeln type vbak-vbeln,
end of t_vbak.
in Global definition
i_VBAK type t_vbak
no error here
Declare the same in TYPES and use the same
Regards
Shiva
I'll brief u abt what I' ve done:
Global Data
-
itab type str.
wa_itab type str.
Types
-
types:begin of str,
empno like zempmaster-empno,
name like zempmaster-name,
dob like zempmaster-dob,
dept like zempdetails-dept,
loc like zempdetails-loc,
sal like zempdetails-sal,
end of str.
Initialization
-
code for fetching data from DB into itab.
The ERROR is:
-
Field itab is unknown
Hi
STR is not table it is a data element check it
and use the table name for it or use begin of
Regards
Shiva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.