Application Development and Automation 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: 
Read only

select statement

Former Member
0 Likes
620

Dear abaper,

I declared one range r_wrks.

I am using that in select statement its giving DUMP

SELECT SINGLE BSART FRGKZ RESWK

FROM EBAN

INTO (W_BSART,X_FRGKZ,X_RESWK)

WHERE BANFN = EBAN-BANFN

AND BNFPO = EBAN-BNFPO

AND ( RESWK = '098' OR RESWK = '099' OR RESWK IN R_WRKS )

AND EKGRP BETWEEN '110' AND '220'.

This above select statement giving dump as

"Value table for IN itab operator has an unexpected format."

Plz lemme know how to declare

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
585

Hi

RANGES R_WRKS FOR EBAN-RESWK.

But the problem should be how you fill the range and not how you have declared it.

Post your code where you fill the range.

Max

5 REPLIES 5
Read only

Former Member
0 Likes
586

Hi

RANGES R_WRKS FOR EBAN-RESWK.

But the problem should be how you fill the range and not how you have declared it.

Post your code where you fill the range.

Max

Read only

Former Member
0 Likes
585

Can u send total Code.

Murthy

Read only

Former Member
0 Likes
585

hi Shakya,

Try to append the values for '098' and '099' of RESWK to R_WRKS and refine your select statement as given below:

SELECT BSART FRGKZ RESWK FROM EBAN upto 1 rows

INTO (W_BSART,X_FRGKZ,X_RESWK)

WHERE BANFN = EBAN-BANFN AND

BNFPO = EBAN-BNFPO AND

RESWK IN R_WRKS AND

EKGRP BETWEEN '110' AND '220'.

Hope this will work.

Sajan.

Read only

anversha_s
Active Contributor
0 Likes
585

Hi,

chk a sample code.

Define a range:

Ranges: r_field for <table>.

if not field1 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
r_field-option-low = field1.
append r_field.
endif.

if not field2 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
r_field-option-low = field2.
append r_field.
endif.

if field1 is initial and field2 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
append r_field.
endif.

select * from <table> where field1 in r_field.

regards

Anver

if hlpful pls mark points

Read only

Former Member
0 Likes
585

<b>RESWK = '0098' OR RESWK = '0099' OR RESWK IN R_WRKS</b>

<b>reswk is 4 in length</b>

substitute this and see ..

vijay

a view of the code ,,

tables : eban.

data : w_bsart like eban-bsart,

w_frgkz like eban-frgkz,

w_reswk like eban-reswk.

ranges rwrks for eban-reswk.

rwrks-sign = 'I'.

rwrks-option = 'EQ'.

rwrks-low = '0098'.

rwrks-high ='0099'.

append rwrks.

SELECT SINGLE BSART FRGKZ RESWK

FROM EBAN

INTO (W_BSART, w_FRGKZ, w_RESWK)

WHERE BANFN = EBAN-BANFN

AND BNFPO = EBAN-BNFPO

AND ( RESWK = '0098' OR RESWK = '0099' OR RESWK IN RWRKS )

AND EKGRP BETWEEN '110' AND '220'.

Message was edited by:

Vijay k