cancel
Showing results for 
Search instead for 
Did you mean: 

NEED

Former Member
0 Kudos

I have created a variable(value type) in selection screen

with parameter and i have another variable cycle.I need to write code like this

if valuetype = 1.

cycle should start with A and B(BOTH)

else cycle should start with P and q.

IF VALUETYP = '1'.

CYCLE+0(1) = 'A'

OR

CYCLE+0(1) = 'B'

ELSE.

CYCLE+0(1) = 'P'.

OR

CYCLE+0(1) = 'Q'.

WRITE:/ CYCLE.

ENDIF.

BUT ITS GIVING ERROR MESSAGE INCORRECT ARTHAMATIC EXPRESSION <OR.

can any one help me in this issue.

Accepted Solutions (0)

Answers (1)

Answers (1)

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Please try this code.

report zrich_0001.

parameters: valuetyp(1) type c.
parameters: cycle(10) type c.

at selection-screen.

  case valuetyp.

    when '1'.
      if cycle+0(1) <> 'A'
        and  cycle+0(1) <> 'B'.
        message e001(00) with' Cycle needs to start with A or B'.
      endif.

    when '2'.
      if cycle+0(1) <> 'P'
        and  cycle+0(1) <> 'Q'.
        message e001(00) with' Cycle needs to start with P or Q'.
      endif.

  endcase.

Regards,

Rich Heilman