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

Check a parameter in a ranges table

arkantos
Explorer
0 Likes
1,982

HI,

Can anyone tell me what is wrong with the following code.

IF NOT P_KUNNR IS INITIAL.

* **       IF P_KUNNR NOT BETWEEN R_KUNNR-LOW AND R_KUNNR-HIGH.


         IF P_KUNNR NOT IN R_KUNNR.

           R_KUNNR_LINE-SIGN = 'I'.

           R_KUNNR_LINE-OPTION = 'EQ'.

           R_KUNNR_LINE-LOW = P_KUNNR.

           APPEND R_KUNNR_LINE TO R_KUNNR.

         ENDIF.

ENDIF.

When P_KUNNR is not inital and R_KUNNR was not containing P_KUNNR, mycode does not pass through the ranges statements.

1 ACCEPTED SOLUTION
Read only

VenkatRamesh_V
Active Contributor
0 Likes
1,510

Hi,

Try this,

IF NOT P_KUNNR IS INITIAL.

          IF ( P_KUNNR  NOT IN  R_KUNNR[] ) OR ( R_KUNNR[] IS INITIAL ).

            R_KUNNR_LINE-SIGN = 'I'.

            R_KUNNR_LINE-OPTION = 'EQ'.

            R_KUNNR_LINE-LOW = P_KUNNR.

            APPEND R_KUNNR_LINE TO R_KUNNR.

       ENDIF.

ENDIF.

Hope it helpful,

Regards,

Venkat.

HI,

Can anyone tell me what is wrong with the following code.

IF NOT P_KUNNR IS INITIAL.

* **       IF P_KUNNR NOT BETWEEN R_KUNNR-LOW AND R_KUNNR-HIGH.


         IF P_KUNNR NOT IN R_KUNNR.

           R_KUNNR_LINE-SIGN = 'I'.

           R_KUNNR_LINE-OPTION = 'EQ'.

           R_KUNNR_LINE-LOW = P_KUNNR.

           APPEND R_KUNNR_LINE TO R_KUNNR.

         ENDIF.

ENDIF.

When P_KUNNR is not inital and R_KUNNR was not containing P_KUNNR, mycode does not pass through the ranges statements.

4 REPLIES 4
Read only

rosenberg_eitan
Active Contributor
0 Likes
1,510

Hi,

What is the content of R_KUNNR ?

Was it empty ?

regards. 

Read only

VenkatRamesh_V
Active Contributor
0 Likes
1,511

Hi,

Try this,

IF NOT P_KUNNR IS INITIAL.

          IF ( P_KUNNR  NOT IN  R_KUNNR[] ) OR ( R_KUNNR[] IS INITIAL ).

            R_KUNNR_LINE-SIGN = 'I'.

            R_KUNNR_LINE-OPTION = 'EQ'.

            R_KUNNR_LINE-LOW = P_KUNNR.

            APPEND R_KUNNR_LINE TO R_KUNNR.

       ENDIF.

ENDIF.

Hope it helpful,

Regards,

Venkat.

Read only

0 Likes
1,510

Thanks Eitan and Venkat for your response..

Issue solved venkat..

As you have pointed out we have to check both conditions.

When R_KUNNR is an empty table P_KUNNR  NOT IN  R_KUNNR[]  alone is not sufficient.

Thanks..

Read only

matt
Active Contributor
0 Likes
1,510

If you define R_KUNNR correctly (i.e. as RANGE OF) then you do not need the []