Application Development 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: 

IS THIS VALID

Former Member
0 Kudos

I WOULD LIKE TO KNOW IF THIS IS CORRECT

IF EQUI-ANSDT BETWEEN 'O1.O4.1992' AND '31.03.1993'.

AMT = ( AMT1 * 8.24 ) / 100 .

AMT2 = AMT1 - AMT.

CLEAR AMT.

IT GIVES ME THE ERROR :

INCOMPLETE ARTHIMETIC EXPRESSION.: ")" MISSING AT END OF STMT.

PLS HELP,

CAPC

1 ACCEPTED SOLUTION

anversha_s
Active Contributor
0 Kudos

hi,

chk this.

data : f_val type f value '8.24'.

AMT = ( AMT1 *  f_val ) / 100 .

AMT2 = AMT1 - AMT.

CLEAR AMT.

this will work

Rgds

Anver

10 REPLIES 10

Former Member
0 Kudos

IF EQUI-ANSDT ge '19920401' or EQUI-ANSDT le '19930331'.

AMT = ( AMT1 * 8.24 ) / 100 .

AMT2 = AMT1 - AMT.

CLEAR AMT.

endif.

if EQUI-ANSDT is a date field.

regards

shiba dutta

anversha_s
Active Contributor
0 Kudos

hi,

try this.

IF ( EQUI-ANSDT  GE  '19920401'  AND  EQUI-ANSDT  LE '19930331' ).

AMT = ( AMT1 * 8.24 ) / 100 .
AMT2 = AMT1 - AMT.
CLEAR AMT.

Rgds

Anver

Former Member
0 Kudos

sorry anver is right in if condition instead of or it will be and please change that.

regards

shiba dutta

Former Member
0 Kudos

Date format is different in different systems according to the user profile settings.

So , please make the below. It will work in any system.

Date : lv_date1 like equi-ansdt,

lv_date2 like equi-ansdt.

Move the dates :

lv_date1 = s_ansdt-low.

lv_date2 = s_ansdt-high.

If ( equi-ansdt >= lv_date1 ) and ( equi-ansdt <= lv_date2 ).

amt = ( amt * 8.24 ) / 100.

amt2 = amt1 - amt.

clear amt.

endif.

The above thing will work out.

Reward Points if helpful and close the thread.

Kannu.

0 Kudos

Hi kannu,

my problem is not with the if condition,

but the

amt = ( amt * 8.24 ) / 100 stmt.....

i gave amt as type i.

is it oK, pls help

capc

0 Kudos

Hi

amt = ( amt * 8.24 ) / 100

It depends on how you need to have the result, if you use an integer the result will be rounded off :

DATA: AMT TYPE I VALUE 200.

AMT = ( AMT * '8.24' ) / 100.

* ---> 200 * 8.24 / 100 = 16.48 =======> AMT = 16

DATA: AMT TYPE I VALUE 300.

AMT = ( AMT * '8.24' ) / 100.

* ---> 300 * 8.24 / 100 = 24.72 =======> AMT = 25

Max

anversha_s
Active Contributor
0 Kudos

hi,

Please mark all helpful answers.

Regards

Anver

anversha_s
Active Contributor
0 Kudos

hi,

chk this.

data : f_val type f value '8.24'.

AMT = ( AMT1 *  f_val ) / 100 .

AMT2 = AMT1 - AMT.

CLEAR AMT.

this will work

Rgds

Anver

0 Kudos

Hi anver,

but the values are from parameters......

thanks,

CAPC

0 Kudos

Hi CAPC,

I believe you have to give a space after )

Best Regards

Renjan