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: 

what is wrong with this if sentence

Former Member
0 Kudos

Hi all,

I am trying to control the statement with this:

if itab-bklas ne 'FER' or itab-bklas ne 'HAW'.  
    PERFORM calculate_req_data. 
else.                                           
    perform get_plan_data
endif.             

Even the itab-bklas value equals FER or HAW, it do processes the calculate req_data, however I want to process get_plan_data if itab-bklas equals FER of HAW.

What is wrong with this sentence?

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Here you will need to use AND statement -

Currently it triggers the PERFORM calculate_req_data when BKLAS is not equal to FER or it is not equal to HAW. I think what you want os - the perform should trigger only if BKLAS is not equal to FER and not equal to HAW.

if itab-bklas ne 'FER' AND itab-bklas ne 'HAW'.

Hope this helps.

ashish

4 REPLIES 4

Former Member
0 Kudos

Hi,

Here you will need to use AND statement -

Currently it triggers the PERFORM calculate_req_data when BKLAS is not equal to FER or it is not equal to HAW. I think what you want os - the perform should trigger only if BKLAS is not equal to FER and not equal to HAW.

if itab-bklas ne 'FER' AND itab-bklas ne 'HAW'.

Hope this helps.

ashish

Former Member
0 Kudos

Try this:

if itab-bklas ne 'FER' and itab-bklas ne 'HAW'.     "<==== use AND
    PERFORM calculate_req_data. 
else.                                           
    perform get_plan_data
endif.

Rob

Former Member
0 Kudos

keep it simple like this.

if itab-bklas EQ 'FER' or itab-bklas EQ 'HAW'.

perform get_plan_data

else.

PERFORM calculate_req_data.

endif.

*reward if solved*

Former Member
0 Kudos

thanks all of you.