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

regarding range

Former Member
0 Likes
3,809

Hi experts,

i used a range in my selection screen and used in a select statement . every thing was doing fine but when it (range field)was empty no data is selected by the select statement.

select * from tab_name into table where matnr IN r_matnr .

what should i do...

thanks and regards

abap.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,336

hi,

r_matnr may be empty as because u have declared as a standard data type. check it.

by default if u dont give any data to select options then all records should be displayed for u.

and also tab_name may be empty check that one also.

if helpful reward some points.

with regards,

Suresh Babu

9 REPLIES 9
Read only

Former Member
0 Likes
2,337

hi,

r_matnr may be empty as because u have declared as a standard data type. check it.

by default if u dont give any data to select options then all records should be displayed for u.

and also tab_name may be empty check that one also.

if helpful reward some points.

with regards,

Suresh Babu

Read only

Former Member
0 Likes
2,336

Hi,

if there is no data in the RNAGE, then clear the Header of that range field and clear the SIGN and the OPTIONS in the body of that Range field before that select.

Regards

Sudheer

Read only

Former Member
0 Likes
2,336

Hi

i thick u r not entering any data in range check once with data otherwise

use select option and findout the diff....

Reward points for helpful answers,

Kiran.M

Read only

Former Member
0 Likes
2,336

hi,

the declaretion of range is :

RANGES r_matnr FOR mara-matnr.

r_matnr-low = p_matnr.

r_matnr-sign = 'I'.

r_matnr-option = 'CP'.

APPEND r_matnr.

and select is :

SELECT vbeln matnr vgbel vgpos lfimg FROM lips

INTO CORRESPONDING FIELDS OF TABLE it_lips FOR ALL ENTRIES IN it_likp

WHERE vbeln EQ it_likp-vbeln and matnr IN r_matnr..

if range field on selection screen is empty then this select fetch no data.

what went wrong and what should i do for this..

thanks and rgds

abaper.

Read only

0 Likes
2,336

Hi,

declaration:

ranges: r_matnr type mara-matnr.

  • Filling ranges is similar to select-options.

r_matnr-low = 'I'.

r_matnr-sign = 'EQ'.

r_matnr-low = '000000000000018'.

append r_matnr.

Usage in Selects

select * from mara into table it_mara

where matnr in r_matnr.

Regards

Read only

Former Member
0 Likes
2,336

Hello,

Please check this:

Tables : MARA.

select-options : P_matnr for MARA-MATNR.

where in tables you shouls define the table from where you need the materials and use the table-matnr for declaring P_matnr....

in this case,i believe if you leave matnr it empty also then all your material records will be fetched as per code(into table)

Hope it was helpful,

Regards

Byju

Read only

Former Member
0 Likes
2,336

Hi all,

actually if i put some material in the selection screen in the range field (e.g. TK001 or TK* ) it will doing fine but problems arise when it is blank.

Read only

0 Likes
2,336

PARAMETERS: p_matnr TYPE matnr MATCHCODE OBJECT mat0m.

RANGES r_matnr FOR mara-matnr.

r_matnr-low = p_matnr.

r_matnr-sign = 'I'.

r_matnr-option = 'CP'.

APPEND r_matnr.

SELECT vbeln matnr vgbel vgpos lfimg FROM lips

INTO CORRESPONDING FIELDS OF TABLE it_lips FOR ALL ENTRIES IN it_likp

WHERE vbeln EQ it_likp-vbeln and matnr IN r_matnr.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,336

You range should be filled like a select-options, if no data exists, then REFRESH it and don't CLEAR (or clear range[])

REFRESH myrange.

clear myrange.
myrange-sign = 'I'.
myrange-option = 'BT'
myrange-low = 'low value'.
myrange-high = 'high value'.
append myrange.

clear myrange.
myrange-sign = 'I'.
myrange-option = 'EQ'
myrange-low = 'value'.
append myrange.

Regards