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: 

Information on Ranges and select-options

Former Member
0 Kudos

Hi All,

A very basic information required.Can any one tell me if we give a range in an condition comparing a internal table field with the range value and if the case is internal table field ia a numeric value but range is empty in such case why the control is going inside the condition.

Can any one tell me why does range behave in this way.

thanks in anticipation.

Regards,

Rajashree

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos

HI rajashree,

Anurag was spot on.

IN ABAP parlance

Empty range = all entries.

IN case you want to check with value space,

then do this:

r_range-sign = 'I'.

r_range-option = 'EQ'.

r_range-low = space.

append r_range.

Regards,

Ravi

4 REPLIES 4

Former Member
0 Kudos

The way range works is that if you leave it blank..it signifies all entries. I hope the above resolves your query but if you need more details can you please cut-paste your condition alongwith the data..so that the forum can explain you in more details if required.

Former Member
0 Kudos

Hi Anurag Bankley ,

Her's the code for filling up ra_local range

LOOP AT tb_lo2 WHERE knumv = tb_lo1-knumv

AND kposn = tb_lo1-ebelp

AND kschl EQ 'ZML0'.

ra_local-sign = 'I'.

ra_local-option = 'EQ'.

ra_local-low = tb_lo2-varcond+5.

APPEND ra_local.

CLEAR: ra_local,

tb_lo2.

ENDLOOP.

Here's the cod efor checking if the internal table value is in the range or not

CLEAR tb_bapicuval.

LOOP AT tb_bapicuval WHERE charc CS co_lo.

IF tb_bapicuval-value IN ra_local.

CONTINUE.

ELSE.

local_options-z_localoptions_code = tb_bapicuval-value.

local_options-z_price__for_options = co_00.

CLEAR tb_lo3.

LOOP AT tb_lo3 WHERE cuobj = tb_output-cuobj

AND value CS tb_bapicuval-value.

MOVE tb_lo3-value_txt TO local_options-z_localoptions_desc

.

EXIT.

ENDLOOP."Loop at tb_lo3

APPEND local_options.

CLEAR local_options.

ENDIF. "if tb_bapicuval-value in ra_local.

In this case even when ra_local is initial

when checking if bapicuval-value is in ra_local .when ra_local is initial its going int if loop instead of going to else part.

Please can you clarify this.

Thanks in anticipation.

Regards,

Rajashree

former_member181962
Active Contributor
0 Kudos

HI rajashree,

Anurag was spot on.

IN ABAP parlance

Empty range = all entries.

IN case you want to check with value space,

then do this:

r_range-sign = 'I'.

r_range-option = 'EQ'.

r_range-low = space.

append r_range.

Regards,

Ravi

0 Kudos

Hello friends,

I am writing a code. My select-option is as follows:

SELECT-OPTIONS: P_LIFNR FOR LFA1-LIFNR

,P_BUKRS FOR LFB1-BUKRS .

Constructor definition ia as follows:

METHODS:

CONSTRUCTOR

IMPORTING VALUE(I_LIFNR) TYPE LFA1-LIFNR

VALUE(I_BUKRS) TYPE LFB1-BUKRS "Buchungskreis auslesen

Now as I creat my object.

data obj type ref to class

START-OF-SELECTION.

CREATE OBJECT OBJ EXPORTING I_LIFNR = P_LIFNR.

I_BUKRS = P_BUKRS.

END-OF-SELECTION.

I am having problem because of Range type.

Message is; I_LIFNR is not type compatable with P_LIFNR. I guess this is becuase of the Range (Select-option). Using parameters: .... Solves the problem but I dont want to use parameters for my input. So how do can I solve this problem.

Blacky