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

IS THIS VALID

Former Member
0 Likes
1,210

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
Read only

anversha_s
Active Contributor
0 Likes
1,163

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
Read only

Former Member
0 Likes
1,163

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

Read only

anversha_s
Active Contributor
0 Likes
1,163

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

Read only

Former Member
0 Likes
1,163

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

regards

shiba dutta

Read only

Former Member
0 Likes
1,163

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.

Read only

0 Likes
1,163

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

Read only

0 Likes
1,163

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

Read only

anversha_s
Active Contributor
0 Likes
1,163

hi,

Please mark all helpful answers.

Regards

Anver

Read only

anversha_s
Active Contributor
0 Likes
1,164

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

Read only

0 Likes
1,163

Hi anver,

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

thanks,

CAPC

Read only

0 Likes
1,163

Hi CAPC,

I believe you have to give a space after )

Best Regards

Renjan