cancel
Showing results for 
Search instead for 
Did you mean: 

Update Rule

Former Member
0 Kudos

Hi ,

I have one info object in Tranafer Structure , Applied Transfer Rule based on 5 info object and derived the addition of those 5 and stored result in Transfer Rule . That info object is in Key Fig tab of Cube .

Now in Cube i have one Info Obj Char , Which do not have value in Comm Stru , But i need to caluate based on The Transfer Rule Applied that info object Tota Value .

How can we do it ? Is it possibe ?

Consider Transfer Rule Applied info object = ' Total ' .

Now i need to writr update rule based on this Total , To update field ' Grade '

So i click on Info Obj char ' Grade ' In update Rule , Create Routing , Now in

Result = ?

What shoud be given ?

Total or Grade .

Kumar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kumar,

There is only one ENDIF if you use ELSE IF.

The syntax is like this:

The last statement block is always terminated by ENDIF.

IF ( <condition1> ). 

<statement block1>

ELSEIF ( <condition2> ). 

<statement block2>

ELSEIF ( <condition3> ). 

<statement block3>

.....

ELSE.

<statement block4>

ENDIF.

Bye

Dinesh

Answers (7)

Answers (7)

Former Member
0 Kudos

Thanks Dinesh . Assigned Points .

Former Member
0 Kudos

Hi ,

Why we need

ELSE IF.

IF .

This is equal to

If

endif.

if

endif .

Is this necessary , <b>In other languages the syntax is like this</b>

If Cond 1

else if Cond 2 to Cond 3

elseif Cond 3 to Cond 4

elseif Cond 4 to Con 5

else Exceptional condition

endif .

Kumar

Former Member
0 Kudos

Dinesh ,

Can you give simple syntax of using condition like checking a range

Eg : IF A > 10 and < 20 .

Else if A > 20 and < 30 .

ENDIF.

How to brinng this in Routine ? This syntax answer will solve my Problem ?

Kumar

former_member619464
Active Contributor
0 Kudos

If A > 10 and A < 20.

RESULT = .

Elseif A > 20 and A < 30.

RESULT = .

Endif.

Endif.

Former Member
0 Kudos

Hi Kumar,

In such acse the syntax would be :

IF A GT 10 AND A LT 20

-


-


ELSEIF.

IF A GT 20 AND A LT 30.

-


-


ENDIF.

Bye

Dinesh

Former Member
0 Kudos

Hi Kumar,

Yes. You can have nested "IF" loops. But make sure you dont have too many of them as it affects the performance.

Bye

Dinesh

Former Member
0 Kudos

HI ,

Can i use Nested If conditions

IF Comm_stru Eq -


Condition 1

Else If Comm_stru Eq .....

Condition 2

Endif .

Can anyone give syntax ? Becaues nested if it shows Error

. Needed after Else

Kumar

former_member619464
Active Contributor
0 Kudos

Hi Kumar,

You need to put fullstop '.' after every ABAP statement.

Regards,

R.Ravi

former_member619464
Active Contributor
0 Kudos

Also make sure that the all the If loops shoudl be closed by endif.

Regards,

R.Ravi

Former Member
0 Kudos

Hi Kumar,

Each info-object would have a RESULT so for Grade you need to specify the "Grade Value".

For example you can define for "Grade" routine something like this:

IF COMM_STRUCTURE-TOTAL < 40.
RESULT = 'F'.

Hope this helps.

Bye

Dinesh

Former Member
0 Kudos

Result = comm_structure-Applied.

Use the right neme of infoobject for Applied.

Hope it helps.

Regards