01-08-2008 5:11 AM
Hi Experts,
I m creating a report related to notification summary.
i have plant and notification fields on screen.I want to fetch notification types,status(nopr,osno,noco) so i m using viqmel and jest tables.
my query is this.
select a~qmnum
a~qmdat
a~qmart
a~iwerk
a~objnr
b~stat from viqmel as a inner join jest as b
on amandt = bmandt and
on aobjnr = bobjnr
into table it_viqmel
where a~iwerk = p_werks
and a~qmdat = p_date.
and ( bstat = 'I0068' OR bstat = 'I0070' OR b~stat = 'I0072' )
AND b~inact <> 'X'.
select txt04
txt30
from tj02t
into table it_tj02t
for all entries in it_viqmel
where istat = it_viqmel-stat
and spras = 'E'.
but it is giving DBIF_RSQL_INVALID_RSQL error.
Please suggest me where i m doing mistake.and are the tables correct for this.
01-08-2008 5:18 AM
if r doing inner join for two tables then u r suppose to write 'on' single time only. in u r case u have to write first select statement as follows.
select a~qmnum
a~qmdat
a~qmart
a~iwerk
a~objnr
b~stat from viqmel as a inner join jest as b
on amandt = bmandt and aobjnr = bobjnr
into table it_viqmel
where a~iwerk = p_werks
and a~qmdat = p_date.
and ( bstat = 'I0068' OR bstat = 'I0070' OR b~stat = 'I0072' )
AND b~inact 'X'.
Madhavi
01-08-2008 5:32 AM
01-08-2008 5:34 AM
01-08-2008 5:36 AM
01-08-2008 5:40 AM
In place of 'E' u just try with 'EN'
select txt04
txt30
from tj02t
into table it_tj02t
for all entries in it_viqmel
where istat = it_viqmel-stat
and spras = 'EN'.
01-08-2008 5:18 AM
hi
good
Here is what the dump said and my answers are right below them.
Possible errors:
o The maximum size of an SQL statement has been exceeded.
This may not be the reason in your case. This usually happens when you use the option FOR ALL ENTRIES
o The statement contains too many input variables.
Most likely this is your issue. I think your r_lifnr is filled with all the vendors in your system and filled as single values. In that case you may be exceeding a limit set on the system. Instead of trying to remove this setting, what I would suggest is to do the following.
Define a select-option for LIFNR on your selection screen. This way users can have the flexibility of specifying certain vendors. If they don't enter anything, it is still ok. Don't fill it with single values.
Use this select-option in your select statement. After the select statement, do a delete from itab where the vendors are not in your r_lifnr as below.
DELETE t_bsak_tmp WHERE NOT lifnr IN r_lifnr.
Also, avoid using client. You don't need that unless you really want to select from a different client other than your logon client. Your select statement is using logon client anyway, so you don't need to specify that.
o The space needed for the input data exceeds the available memory.
If the above changes are made and the problem is still there, then this is the next thing to look at.
thanks
mrutyun^
01-08-2008 5:45 AM
select a~qmnum
a~qmdat
a~qmart
a~iwerk
a~objnr
b~stat
into table it_viqmel
from viqmel as a
inner join jest as b
on aobjnr = bobjnr
where a~iwerk = p_werks
and a~qmdat = p_date.
and ( bstat = 'I0068' OR bstat = 'I0070' OR b~stat = 'I0072' )
AND b~inact = 'X'.
select txt04
txt30
from tj02t
into table it_tj02t
for all entries in it_viqmel
where istat = it_viqmel-stat
and spras = 'E'.
u forgot '='
awrd points if useful
Bhupal
01-08-2008 6:21 AM
Hi Garima,
Try and use this, you wouldn't get any error,
tables: viqmel, jest, tj02t.
types : begin of ty_viqmel,
qmnum type viqmel-qmnum,
qmdat type viqmel-qmdat,
qmart type viqmel-qmart,
iwerk type viqmel-iwerk,
objnr type viqmel-objnr,
stat type jest-stat,
end of ty_viqmel,
begin of ty_objnr,
txt04 type tj02t-txt04,
txt30 type tj02t-txt30,
end of ty_objnr.
data: it_viqmel type table of ty_viqmel,
wa_viqmel type ty_viqmel,
it_objnr type table of ty_objnr,
wa_objnr type ty_objnr.
parameters: p_werks like marc-werks,
p_date like sy-datum.
select a~qmnum
a~qmdat
a~qmart
a~iwerk
a~objnr
b~stat from viqmel as a inner join jest as b
on aobjnr = bobjnr
into table it_viqmel
where a~iwerk = p_werks
and a~qmdat = p_date
and ( bstat = 'I0068' OR bstat = 'I0070' OR b~stat = 'I0072' )
AND b~inact eq 'X'.
select txt04
txt30
from tj02t
into table it_objnr
for all entries in it_viqmel
where istat = it_viqmel-stat
and spras = 'E'.