Skip to Content
author's profile photo Former Member
Former Member

Information on Ranges and select-options

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Oct 23, 2006 at 10:49 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2006 at 10:40 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2006 at 10:47 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.