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: 

ITS_UNEXPECTED_TOKEN

Former Member
0 Kudos

Hello Experts,

Category           ABAP Programming Error
Runtime Errors     ITS_UNEXPECTED_TOKEN
ABAP Program       SAPLWSAO_DYNP

Application Component  LO-SRS

Short text

Template interpretation failed. Syntax error.

 

What happened?

The template "templates\wsta\90\saplwsao_dynp_buttons_220.html" contains syntax
  errors and could therefore not
be compiled.
Cause of error: the token "(" ("(") could not be recognized.
The syntax error is located in line: 15, column: 16
The erroneous HTMLB line is:
    " `ButtonM(label=#order_post, jsfunction="submit_form('POST')", message="Are
  you sure you want to post this order?" )`"

Above error raises when the SERVICE WSTA is executing.

Error while the control reached ButtonM() Function is reached.

Can any one please let me know to solve this issue.

Thank You,

Swetha.C

3 REPLIES 3

arindam_m
Active Contributor
0 Kudos

Hi,

Well for a start the template has a syntax error to check your templates you will have to see the contents. In my system the template I cannot see the code this in line 15.

`ButtonM(label=#order_post, jsfunction="submit_form('POST')", message="Are

      you sure you want to post this order?" )`

You can do a check. Go to SE80. Select Repository Browser. Choose Internet service. Give WSTA which is the service having issues in your case. Go to Topic 90. Then see template SAPLWSAO_DYNP.

All the clues for viewing the same is in the path:

"templates\wsta\90\saplwsao_dynp_buttons_220.html"

Then see if the template is saved and published if not do that, also check if you have publishing lock in attributes tab. For you reference you can compare with the code that I have in my server. Best would be to do the same with your production system.

<HTML>

<HEAD><TITLE>SAP Retail Store (Orderlist)</TITLE> </HEAD>

`include ("wosm", "global")`

`include(~name="SAPLWSAO_DYNP_SCRIPTS_220.HTML")`

<BODY>

<FORM NAME=form1 ACTION="`wgateURL(~target="_parent",~forcetarget="yes")`" METHOD="post">

<TABLE BORDER=0>

<TR><TD>

<TABLE BORDER=0><TR>

  <TD width=700>`include(~name="SAPLWSAO_DYNP_DATA_220.HTML")`</TD>

  <TD width=300>`include(~name="SAPLWSAO_DYNP_BUTTONS_220.HTML")`</TD>

</TR></TABLE>

</TD></TR><TR><TD>`include(~name="SAPLWSAO_DYNP_MSGLINE_220.HTML")`</TD></TR>

</TABLE>

<INPUT TYPE="hidden" name=OkCode value=1></FORM>

`<!-- declare fielddump in "sapxjutil.dll"; fielddump() -->`

</BODY>

</html>

Hopefully that helps.

Cheers,

Arindam

Former Member
0 Kudos

Hello Arindam,

Thank you for reply.

Actually we did up-gradation form 4.6 to ECC . Code in the target system is a copy of source system.

Code in Source system is as given below

***************************************************************************************************

<!-- Buttons for template 240 -->

<TABLE BORDER=0 align=left>

  `if (G_DISP_DIM > 0) then` 

    <TD align="left" nowrap>

     `if (G_DIALOG_MODUS == "1") then`

       `if (G_POST_ORDER_OK == "X") then`

<!-- `Button(label=#order_post, jsfunction="submit_form('POST')")` -->

`ButtonM(label=#order_post, jsfunction="submit_form('POST')", message="Are you sure you want to post this order?" )`

***************************************************************************************************

Red colored text is replaced with green colored text.

When i run the code with Button() method it works fine. But when i used ButtonM() it gives the ITS_UNEXPECTED_TOKEN

Please give me a solution for this error

Thank You,

Swetha.C

arindam_m
Active Contributor
0 Kudos

Hi,

Looks like the standard one does not have the ButtonM method. If You want the buttonM them also check the Javascript that is there in your source system that also has to be modified. Basically the Button object does not have the extra parameter

"Are you sure you want to post this order?" )`

But your ButtonM has the parameter. A Javascript will be there in the same path that handles the ButtonM functionality compare that you might find the old code that handle the same parameter if you want the same thing. Looking at it can take in the upgraded code only change that will be removed is the question before its actually posts.

Cheers,

Arindam