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: 

Error when defining a variable other than CHAR

aidaj_hilton
Participant
0 Kudos

I am getting a syntax error when I define variables :

data: l_arbei type p.

constants: l_delim type x value '09'.

Message L_ARBEI must be a character-type field (data type C, N, D or T). an open control structure introduced by "INTERFACE"

Has anyone else experienced this problem. Why can I not define these variables.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

where dpes this error occur?

I don't think in defination step: I don't get this message in my system.

Max

12 REPLIES 12

Former Member
0 Kudos

Hi

where dpes this error occur?

I don't think in defination step: I don't get this message in my system.

Max

0 Kudos

data: l_arbei type p decimals 1,

l_ismnw type p decimals 1.

write w_ops-work_activity to l_arbei.

l_arbei = l_arbei - l_ismnw.

if l_arbei gt 0.

write l_arbei to w_ops-work_activity.

endif.

As mentioned same error message when defining the following:

constants: c_delim type x value '09'.

split i_input1-line at c_delim into

w_hdr-orderid

w_hdr-order_type.

I agree that there should be no problem with the definitions. However cannot understand why it does not like it. Thought there might be an additional requirement for Unicode systems.

0 Kudos

Yes unicode system doesnot allow string based commands such as SPLIT to use hex characters as the delimiter. You can use the same command in non-unicode system successfully.

Srinivas

0 Kudos

Thanks Srinivas. Is there an alternative for splitting a tab delimited file other than changing input file to use a different delimiter

0 Kudos

Use this.


SPLIT i_input1-line AT cl_abap_char_utilities=>horizontal_tab
 INTO w_hdr-orderid w_hdr-order_type.

0 Kudos

Thanks so much Srinivas - Worked like a charm.

Hope I correctly rewarded you. Clicled on solved problem before I replied

0 Kudos

Glad to be of help John, you got it correctly.

former_member181962
Active Contributor
0 Kudos

Hi Jill,

are you trying to use the value l_arbei in any operations like

concatenation, substring, replace, translate etc?

For those operations, all the fields used must be of C, N, D, T types only.

Regards,

Ravi

0 Kudos

Hi,

it is not because of definition, it is because of your opertaions on the l_arbei.

please check that...

regards

vijay

0 Kudos

Thanks for your response. I looked at

move f1 to l_arbei instead of write f1 to l_arbei and that got rid of the error message

(f1 is a char field read from input file).

Still cannot understand the problem with

split f1 at c_delim into g1 g2.

when delim is defined as constant type x value '09' though. Obviously the problem occurs at this statement and not the original definition but not sure what the alternative is. I need to split my input file at the tabs.

Former Member
0 Kudos

where does this error occurs .. coz when i tried the same code in my system, it didnt give me any error...so i think that its not because of this defintion, u might have used this code somewhere else in ur prog. n its the effect of that operation that u got this error.

Former Member
0 Kudos

Your syntax error is coming from the fact that you declared 'l_arbei' as type p, whereas the system is expecting it to be of the specified types wherever it is being used.

Change it to one of the types(in all probability, it will be N unless you need decimals) mentioned and you will be ok.

Srinivas