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

Warning with string placing

Former Member
0 Likes
1,753

HI All ,

I want to solve warning issue but i am not sure that I know how .

I have 3 fields type string which in need to split but i get warning

The VALUE specification is longer than the corresponding field. The		
VALUE specification will only be passed to the field length!	

DATA:

lv_prefix TYPE string,

lv_domain TYPE string.

SPLIT iv_prefix AT lc_sperator INTO lv_prefix lv_domain.

iv_prefix is type string .

Any idea how can i avoid this warning?

Regards

Chris

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
0 Likes
972

I just tried this and got no warning:

CONSTANTS: lc_seperator TYPE c LENGTH 1 VALUE ';'.

DATA:
lv_prefix TYPE string,
lv_domain TYPE string,
iv_prefix TYPE string.

SPLIT iv_prefix AT lc_seperator INTO lv_prefix lv_domain.

If I change it to: CONSTANTS: lc_seperator TYPE c LENGTH 1 VALUE 'abcd'. Then I do get the warning.

How is lc_seperator defined?

matt

3 REPLIES 3
Read only

matt
Active Contributor
0 Likes
973

I just tried this and got no warning:

CONSTANTS: lc_seperator TYPE c LENGTH 1 VALUE ';'.

DATA:
lv_prefix TYPE string,
lv_domain TYPE string,
iv_prefix TYPE string.

SPLIT iv_prefix AT lc_seperator INTO lv_prefix lv_domain.

If I change it to: CONSTANTS: lc_seperator TYPE c LENGTH 1 VALUE 'abcd'. Then I do get the warning.

How is lc_seperator defined?

matt

Read only

Former Member
0 Likes
972

The VALUE specification is longer than the corresponding field. The

VALUE specification will only be passed to the field length!

warning appers when you define some variablw with char and assign it some value and you are not assigning as many characters as the value required

please assign char4 if you are using value of 4 characters in lv_seperator.

Read only

Former Member
0 Likes
972

Hi,

I did this as mentioned below :

DATA:

lv_prefix TYPE string,

lv_domain TYPE string.

Constants : lc_seprator value ','.

lv_prefix = 'This is a test, do it.'.

SPLIT lv_prefix AT lc_seprator INTO lv_prefix lv_domain.

But I did not get any warning.

Regds,

Lalit