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

if condition

Former Member
0 Likes
767

Hello friends,

I am unable to get this if condition working in SAP script (SE71)

ELSEIF &EKKO-BUKRS& EQ 'KYCO' AND &EKPO-WERKS& EQ 'VU' AND &LFA1-LAND1& = ( 'US' OR 'CA' )

else....

endif.

Even when the condition is satisfied it dosent trigger. I am assuming to do with the brackets. Let me know an Alternative.

Thakns,

Madhu.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
673

Hi,

Please try this.


...

ELSEIF &EKKO-BUKRS& EQ 'KYCO' AND &EKPO-WERKS& EQ 'VU'.
  IF &LFA1-LAND1& EQ 'US' OR &LFA1-LAND1& EQ 'CA'.
     ...
  ENDIF.

ELSE.
   ...
ENDIF.

Regards,

Ferry Lianto

5 REPLIES 5
Read only

Former Member
0 Likes
673

modify as highlighted:

ELSEIF &EKKO-BUKRS& EQ 'KYCO' AND &EKPO-WERKS& EQ 'VU' AND <b>( &LFA1-LAND1& = 'US' OR &LFA1-LAND1& = 'CA' )</b>

Regards,

Ravi

Read only

Former Member
0 Likes
673

Hi,

Please try this.

ELSEIF &EKKO-BUKRS& EQ 'KYCO' AND &EKPO-WERKS& EQ 'VU' AND ( &LFA1-LAND1& EQ 'US' OR &LFA1-LAND1& EQ 'CA' ).

Regards,

Ferry Lianto

Read only

0 Likes
673

Thanks Ravi and ferry,

I have tried even this and it dosent work as well. Any more suggestions. When i cahnges the code it also gave me a warning message.

message - AND, OR or end of condition expected

Madhu.

Read only

Former Member
0 Likes
674

Hi,

Please try this.


...

ELSEIF &EKKO-BUKRS& EQ 'KYCO' AND &EKPO-WERKS& EQ 'VU'.
  IF &LFA1-LAND1& EQ 'US' OR &LFA1-LAND1& EQ 'CA'.
     ...
  ENDIF.

ELSE.
   ...
ENDIF.

Regards,

Ferry Lianto

Read only

0 Likes
673

Thanks Ferry,

I actually tried this method the first time but i gave problems.

There are many elseif followed by this else if...

Suppose,

ELSEIF &EKKO-BUKRS& EQ 'KYCO' AND &EKPO-WERKS& EQ 'VU'.

is satisfied and

IF &LFA1-LAND1& EQ 'US' OR &LFA1-LAND1& EQ 'CA'.

is not satisfied,

it dosent check for other conditions...

however i got it working,

ELSEIF &EKKO-BUKRS& EQ 'KYCO' AND &EKPO-WERKS& EQ 'VU' and &LFA1-LAND1& = 'US'

.....

....

ELSEIF &EKKO-BUKRS& EQ 'KYCO' AND &EKPO-WERKS& EQ 'VU' and &LFA1-LAND1& = 'CA'

.....

....

elseif...

..endif.

Anyways thanks for the suggestions.

Madhu.