cancel
Showing results for 
Search instead for 
Did you mean: 

abap Program in rotuine help

Former Member
0 Kudos

Hi Guys,

I need to write a routine in the update rule for a KF with the following Logic:

IF COMM_STRUCTURE-DIVISION = 20 AND (COMM_STRUCTURE-MATERIAL0(5) ='SPARE' OR COMM_STRUCTURE-MATERIAL0(10) = 'INNERCASE' OR COMM_STRUCTURE-MATERIAL+0(4) = 'TEST').

Its giving me error when I check it..Can any one tell me ASAP how write this logic please...

Thanks...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The syntax error is because there is no space between '(' & 'COMM_STRUCTURE-MATERIAL' as well as 'TEST' & ')'. Likewise ='SPARE', should be as = 'SPARE'.

Try below code...

IF COMM_STRUCTURE-DIVISION = '20'.

IF COMM_STRUCTURE-MATERIAL+0(5) ='SPARE'.

ELSEIF COMM_STRUCTURE-MATERIAL+0(9) = 'INNERCASE'

ELSEIF COMM_STRUCTURE-MATERIAL+0(4) = 'TEST'.

ENDIF.

ENDIF.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sam,

Try this

IF COMM_STRUCTURE-DIVISION = 20. 
 IF COMM_STRUCTURE-MATERIAL+0(5) ='SPARE' OR COMM_STRUCTURE-MATERIAL+0(10) = 'INNERCASE' OR COMM_STRUCTURE-MATERIAL+0(4) = 'TEST'.
  do process....
 ENDIF.
ENDIF.

<b>Reward if this helps,</b>

Satish

Former Member
0 Kudos

Hi Sam,

In BI 7.0 you have to use SOURCE_FIELDS instead of COMM_STRUCTURE.

- Ram.

Former Member
0 Kudos

Hi Ram I KNOW ,

But am asking about the logic why its showing error here ...

here in this scenerio we are using Update rules so I need to use COMM_STRUCTURE only...Do you know why the code is giving wrong and also let me know the exact logic in performance point of view as well..

Thanks inadvacne and points will be assigned...

krzysztof_konitz4
Contributor
0 Kudos

Hi,

Do you have syntax error or execution of this code gives you wrong results ?

If this code is copied/pasted from you update rules then it is not correct because you omitted some spaces before and after parenthesis...

And you also check ten chars in COMM_STRUCTURE-MATERIAL+0(10) but string 'INNERCASE' has only 9...

regards

Krzys