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

putting conditioning in sapscript

Former Member
0 Likes
684

hi experts ,

in my sap script, i have to put condition on a field. the positive value of that field should write the word 'Debit' and -ve value should be prefixed by 'Credit'.

i have written the following code:

/: IF &RF130-SALDO& < 0

AS CREDIT

/: ENDIF

/: IF &RF130-SALDO& > 0

AS DEBIT

/: ENDIF

But the code is not working fine. can anyone suggest me something on it ?

thanx in advance

akanksha

4 REPLIES 4
Read only

0 Likes
646

Hi Akanksha,

Evaluation is performed strictly from left to right. The comparison is always performed on literal values, to compare a value with simply '0' doesn't work. You have to use the exact value.

Regards, Norbert

Read only

0 Likes
646

hi Norbert,

well i actually have to check for the -ve and +ve values of the specified field. that is y i m comparing it with < 0 and > 0.

is there any other way out ?

Read only

0 Likes
646

HI, you can use this statement, but you will have to compare with a value like '0.000,00' - try some different lenghts and versions, I dont know how long exactly your field is. Regards

Read only

0 Likes
646

dear norbet ,

my field type is currency.

i have tried it the y way u hav written