Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Run Time Error

Former Member
0 Kudos

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.

8 REPLIES 8

Former Member
0 Kudos

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

0 Kudos

This I have done but it is not solving my problem.

0 Kudos

u just copy ur entire prg, i will try to solve ur issue

Madhavi

0 Kudos

No Madhavi I have these two queries only and it is giving dump.

0 Kudos

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'.

Former Member
0 Kudos

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^

Former Member
0 Kudos

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

Former Member
0 Kudos

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'.