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

Can you find the syntax error in this code?

Former Member
0 Likes
1,064

Hi all, I have the following code but it is giving me a syntax error which says "The text literal "'. " is longer than 255 characters. Check whether it ends correctly."

case vbdkl-vkorg
when '0010' or 0011' or '0020' or '0030' or '0040' or '0060' or '0065'.
w_include = 'tvko-txnam_kop'.
when '0021'.
w_include = 'zadrs_hdr_ver_weatherbond'.
when '0012'.
perform get_bzirk
	using vbdkl-kunnr
		vbdkl-vkorg
		kna1-telf1
		kna1-telfx
	changing w_bzirk
		w_prt_phone
if w_bzirk = 'CARLSH'
	w_include = 'tvko-txnam_kop'.
else
	w_include = 'NAME1'.
endif.
when '0050'.
perform get_bzirk
	using vbdkl-kunnr
		vbdkl-vkorg
		kna1-telf1
		kna1-telfx
	changing w_bzirk
		w_prt_phone
if w_bzirk = 'CCWSH'
	w_include = 'tvko-txnam_kop'.
else
	w_include = 'NAME1'.
endif.
when others.
w_include = 'tvko-txnam_kop'.
endcase.

Regards,

Davis

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,022

Hi Davis,

Have you pasted code as it is, if yes then you are missing lots of dots '.'

case vbdkl-vkorg.

when '0010' or '0011' or '0020' or '0030' or '0040' or '0060' or '0065'.

w_include = 'tvko-txnam_kop'.

when '0021'.

w_include = 'zadrs_hdr_ver_weatherbond'.

when '0012'.

perform get_bzirk

using vbdkl-kunnr

vbdkl-vkorg

kna1-telf1

kna1-telfx

changing w_bzirk

w_prt_phone.

if w_bzirk = 'CARLSH'.

w_include = 'tvko-txnam_kop'.

else.

w_include = 'NAME1'.

endif.

when '0050'.

perform get_bzirk

using vbdkl-kunnr

vbdkl-vkorg

kna1-telf1

kna1-telfx

changing w_bzirk

w_prt_phone.

if w_bzirk = 'CCWSH'.

w_include = 'tvko-txnam_kop'.

else.

w_include = 'NAME1'.

endif.

when others.

w_include = 'tvko-txnam_kop'.

endcase.

Try this code.

Regards,

Atish

Hi all, I have the following code but it is giving me a syntax error which says "The text literal "'. " is longer than 255 characters. Check whether it ends correctly."

case vbdkl-vkorg
when '0010' or 0011' or '0020' or '0030' or '0040' or '0060' or '0065'.
w_include = 'tvko-txnam_kop'.
when '0021'.
w_include = 'zadrs_hdr_ver_weatherbond'.
when '0012'.
perform get_bzirk
	using vbdkl-kunnr
		vbdkl-vkorg
		kna1-telf1
		kna1-telfx
	changing w_bzirk
		w_prt_phone
if w_bzirk = 'CARLSH'
	w_include = 'tvko-txnam_kop'.
else
	w_include = 'NAME1'.
endif.
when '0050'.
perform get_bzirk
	using vbdkl-kunnr
		vbdkl-vkorg
		kna1-telf1
		kna1-telfx
	changing w_bzirk
		w_prt_phone
if w_bzirk = 'CCWSH'
	w_include = 'tvko-txnam_kop'.
else
	w_include = 'NAME1'.
endif.
when others.
w_include = 'tvko-txnam_kop'.
endcase.

Regards,

Davis

9 REPLIES 9
Read only

Former Member
0 Likes
1,022

ur missing a quote here


when '0010' or <b>(')</b>0011' or '0020' or '0030' or '0040' or '0060' or '0065'.

Read only

0 Likes
1,022

Basavaraj and everybody else,

Thank you very much! I spent a few minutes on that and couldn't find it; I assumed I was missing a quote somewhere.

Regards,

Davis

Read only

Former Member
0 Likes
1,022

Hi

It means a ' is missing, but probably a point is missing:

<b>case vbdkl-vkorg <----


ERROR</b>

when '0010' or 0011' or '0020' or '0030' or '0040' or '0060' or '0065'.

<b>case vbdkl-vkorg.<----


ok</b>

when '0010' or 0011' or '0020' or '0030' or '0040' or '0060' or '0065'.

Max

Read only

Former Member
0 Likes
1,023

Hi Davis,

Have you pasted code as it is, if yes then you are missing lots of dots '.'

case vbdkl-vkorg.

when '0010' or '0011' or '0020' or '0030' or '0040' or '0060' or '0065'.

w_include = 'tvko-txnam_kop'.

when '0021'.

w_include = 'zadrs_hdr_ver_weatherbond'.

when '0012'.

perform get_bzirk

using vbdkl-kunnr

vbdkl-vkorg

kna1-telf1

kna1-telfx

changing w_bzirk

w_prt_phone.

if w_bzirk = 'CARLSH'.

w_include = 'tvko-txnam_kop'.

else.

w_include = 'NAME1'.

endif.

when '0050'.

perform get_bzirk

using vbdkl-kunnr

vbdkl-vkorg

kna1-telf1

kna1-telfx

changing w_bzirk

w_prt_phone.

if w_bzirk = 'CCWSH'.

w_include = 'tvko-txnam_kop'.

else.

w_include = 'NAME1'.

endif.

when others.

w_include = 'tvko-txnam_kop'.

endcase.

Try this code.

Regards,

Atish

Read only

0 Likes
1,022

Atish,

Thanks a lot. I didn't realize that I wrote the code as sloppy as I did.

Regards,

Davis

Read only

marius_greeff
Active Participant
0 Likes
1,022

You are missing '.' in your code.

if w_bzirk = 'CARLSH'

if w_bzirk = 'CCWSH'

and after your perform get_bzirk

Regards,

M

Read only

Former Member
0 Likes
1,022

Thanks to all who found my mistakes. I didn't realize that I made so many mistakes.

Regards,

Davis

Read only

Former Member
0 Likes
1,022

Hi,

You missed out a single inverted comma at line number two for 0011.

Whenever you miss a single inverted comma, ABAP will treat all the lines following after the line as the part of that string.

Since, a text-literal can be of maximum size 255, therefore it displays the error "literals that take up more than one lines are not permitted".

Does that solve your problem.

Reward points if helpful.

Best Regards,

Saurabh.

Read only

Former Member
0 Likes
1,022

Hi Davis,

If you have pated the code as it is you have missed out single quotes' and full stop (.) in many places in the code.

Regards

Jitendra