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

syntax help

Former Member
0 Likes
1,351

hi friends

i need the syntax help for the below sentence

F = (10 - (round(10 - j) - j)^2)

this is giving error in editor

pls help to resolve this

thanks in advance

with regards

s.janagar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,277

Instead of ^ use **.

Hope it helps.

Thanks,

Jayant

10 REPLIES 10
Read only

Former Member
0 Likes
1,277

What is the syntax error. Please provide more details of your code as well.

regards,

Advait

Read only

0 Likes
1,277

""Local Interface:

*" IMPORTING

*" REFERENCE(UID) TYPE OIJNOMI-ZZSCHEDID

*" REFERENCE(TIMESTAMP) TYPE CHAR14

*" EXPORTING

*" REFERENCE(TOKEN) TYPE CHAR25

*"----


*timestamp (YYYYMMDDhhmmss)

DATA: zyear TYPE i,

zmon TYPE i,

zdat TYPE i,

zhrs TYPE i,

zmin TYPE i,

zsec TYPE i,

zfrm TYPE i,

zuid TYPE i,

a TYPE i,

b TYPE i,

c TYPE i,

d TYPE i,

e TYPE i,

f TYPE i,

g TYPE i,

h TYPE i,

i TYPE i,

j TYPE i,

k TYPE i,

w_data TYPE i.

  • splitting up the timestamp to date,month,hrs,minutes etc.,

zuid = uid.

zyear = timestamp+0(4).

zmon = timestamp+4(2).

zdat = timestamp+6(2).

zhrs = timestamp+8(2).

zmin = timestamp+10(2).

zsec = timestamp+12(2).

a = zhrs + 1.

b = zuid - zdat + zhrs.

c = zyear - zhrs.

d = zmin + zuid .

e = zyear + zhrs * 13 + zuid + zdat * 23 .

f = e * zuid.

g = zuid - zdat.

h = zuid - zhrs.

i = zhrs - zdat.

j = zuid / 10.

k = 25 - zhrs.

zfrm = ABS( 15 * zuid * a + 11 * b + 19 * c + d * 3 + f + zhrs * zhrs * g * h + i * 23 * ( 10 - ( j - round( j ) * 10 ) exp 2 ) * ( k ) exp 2 ).

token = zfrm.

Edited by: janagar sundaramoorthy on Nov 25, 2008 9:20 AM

Read only

Former Member
0 Likes
1,278

Instead of ^ use **.

Hope it helps.

Thanks,

Jayant

Read only

0 Likes
1,277

hi jayant

your answer is helpful

but

the code i have pasted above is also giving an error

Function Module ZIS_TSW_ESRV_TOKEN_TEST

The syntax for a method specification is "objref->method" or

"class=>method" . "class=>method". "class=>method". "class=>method".

can u pls help me to resolve this

Read only

0 Likes
1,277

Hello,

Try to do it this way.

zfrm = ABS ( ( 15 * zuid * a ) + ( 11 * b ) + ( 19 * c ) + ( d * 3 ) + f + ( zhrs * zhrs * g * h ) + ( ( i * 23 ) * ( 10 - ( ( j - round( j ) * 10 ) exp 2 ) * ( k ) exp 2 ) ) ).

Hope it helps. (Pardon me if I have missed some braces).

Try this code as Test Program. Also try to break the arithematic operation.

Hope it helps.

Thanks,

Jayant

Read only

Former Member
0 Likes
1,277

HI

Try this

F = ( 10 - ( ROUND( 10 - j ) - j ) ^ 2 ).

Regards

Read only

Former Member
0 Likes
1,277

Hi

What do you mean by round(j) and exp , ^? I don't think they are proper operator in ABAP.

Read only

0 Likes
1,277

hi alex yu

just put F1 help and see

these are the operators available

with regards

s.janagar

Read only

Former Member
0 Likes
1,277

Hi,

Even i felt the same as alex.

Round option we will use generally while writing any thing. For example,

DATA: X TYPE P DECIMALS 2 VALUE '12493.97'.

WRITE: /X ROUND -2,

Regards,

Kusuma.

Read only

Former Member
0 Likes
1,277

solved