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: 

ABAP4 syntax errors

Former Member
0 Kudos

hello guys,

i have a some crazy errors in my program in sap 4.6C version .

i'm  trying to  adapt a code from a different program ( a more recent version ) to the old version 4.6C im working at it right now .

but i have lot of synax errors that i can't solve some of them,

if anyone have ideas or can help me ,please dont hesitate to message me or answer me .

PS: im new in SAP /ABAP

thanks a lot .

the error is : The text literal "'<script type=" is longer than 255 characters. Please check whether it ends with a quotation mark.

the code is:

*    Appending the description div and the script to make it dynamic

    APPEND '<script type="text/javascript">$(".col-sm-3")

.hover(function(e){title = $(this).attr("title");$("#desc").

html("<span>" + title + "</span>");$(this).removeAttr("title");},

function(e){$("span", "#desc").html("DESCRIPTION");' TO lt_html.

 

APPEND '$(this).attr("title",title);});</script><div id="desc"

class="row" style="color:black;padding:5px;margin-left:74px;border: 1px

dashed black;margin-top:440px;width:78%;background-color:

#dcdcdc;font-size:18px;">DESCRIPTION</div>' TO lt_html.

    APPEND '</div></div>' TO lt_html.

    APPEND '</body>' TO lt_html.

    APPEND '</html>' TO lt_html.

Message was edited by: Matthew Billingham - removed SAP logo

6 REPLIES 6

Phillip_Morgan
Contributor
0 Kudos

Hi,

The first thing: if these strings take up more than one line, you should know that in ABAP it is not permitted. I copied your code and  got "Literals that take up more than one line not permitted."

You may want to split them and concatenate or, if you are in a more recent SAP release, you can concatenate using the concatenate operator (&). Like below:


   APPEND '<script type="text/javascript">$(".col-sm-3")' &

'.hover(function(e){title = $(this).attr("title");$("#desc").' &

'html("<span>" + title + "</span>");$(this).removeAttr("title");},' &

'function(e){$("span", "#desc").html("DESCRIPTION");' TO lt_html.



Splitting the string up can also help you pinpoint where the error is, if there is one.


Hope this helps.

Former Member
0 Kudos

the code is from a recent sap release,but i should adapt it to an old version sap 4.6C,that why it dont work in old version but it work very good in sap 6.0 release

0 Kudos

Then you should use concatenate of the various pieces into a variable and only after do your append.

0 Kudos

The error message already says that your string is to long. So, I guess you have to split up your big strings into several strings, which do not overflow the limit of 255 chars.

former_member194739
Active Participant
0 Kudos

Hi,

SAP 4.6C not supported more than 255 character long. so you can split the string within 254 characters with using & symbol.

Thanks,

Syed Abbas.

Sandra_Rossi
Active Contributor
0 Kudos

Sorry to say that & is not a concatenation operator as people could imagine. It was just a way to write a literal of up to 255 characters in the ABAP editor at the time we could only enter 72 characters maximum in a line.

So, & does not permit more than 255 characters.

The only way to do it in 4.6C is to use the CONCATENATE statement.