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: 

Split error

Former Member
0 Kudos

Good morning friends, first greet for this coming year , below 'm putting together a report load and I have a problem in finding a pair of variables , this is the code:

TYPES : BEGIN OF t_dw ,
       
text ( 65435 ) TYPE c ,
       
data (70 ) TYPE c ,
     
END OF t_dw .

DATA: TYPE w_dw t_dw ,
             
it_dw LIKE STANDARD TABLE OF w_dw .

   
LOOP AT INTO w_dw it_dw .
     
TRANSLATE TO UPPER CASE w_dw .
     
W_dw - text SPLIT AT ',' INTO
                                   
w_input - aufnr
                                   
w_input - vornr
                                   
w_input - budat
                                   
w_input - zzcant1
                                   
w_input - zzmot1
                                   
w_input - zzcant2

In the fields zzcant1 zzcant2 the following error message :

" W_INPUT - ZZCANT1 " must be a character -type data object (data type C , N , D , T, or STRING)" .

These two fields are zzcant1 zzcant2 type and QUAN, please can guide and give me an example on how to resolve this error .

Thank you very much experts.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Try the following....

DATA : lc_par1 type char25 , lc_par2 type char25.

clear : lc_par1 , lc_par2.

SPLIT W_dw - text  AT ',' INTO
                                   
w_input - aufnr
                                   
w_input - vornr
                                   
w_input - budat
                                    lc_par1

                                    lc_par2

                                   
w_input - zzcant2

Write lc_par1 to w_input - zzcant1.

Write lc_par2 to w_input - zzcant2.

6 REPLIES 6

Former Member
0 Kudos

Try the following....

DATA : lc_par1 type char25 , lc_par2 type char25.

clear : lc_par1 , lc_par2.

SPLIT W_dw - text  AT ',' INTO
                                   
w_input - aufnr
                                   
w_input - vornr
                                   
w_input - budat
                                    lc_par1

                                    lc_par2

                                   
w_input - zzcant2

Write lc_par1 to w_input - zzcant1.

Write lc_par2 to w_input - zzcant2.

arivazhagan_sivasamy
Active Contributor
0 Kudos

Hi Brujo,

Please move those fields as character type and then assign the value to real field.

For eg.

split field at ',' into field1 field2.

zzcant1 = field1.

zzcant2 = field2.

Arivazhagan S.

Former Member
0 Kudos

Hii Brujo,

As it's clearly illustrated in the error that while splitting the text , you can not put this splitted text into QUAN field .This is conversion error. so before moving one field to another check out the data type of the fields and two must be same.If two fields data types are not same then always declare the target fields which will get the data as alpha-numeric(CHAR type).

So create a char type field and get the splitted text into this char type field and finally assign/ write this char type field to your QUAN type  field as illustrated by others.

regards

Syed

Former Member
0 Kudos

Hi Brujo ,

data: v_zzcant1 type char10 ,

      v_zzmot1  type char10 .


W_dw - text SPLIT AT ',' INTO
                              
w_input - aufnr
                              
w_input - vornr
                              
w_input - budat
                              
w_input - zzcant1 V_ZZCANT1
                              
w_input - zzmot1 V_ZZMOT1
                              
w_input - zzcant2 .


w_input-zzcant1 = v_zzcant1 .

w_input-zzmot1  = v_zzmot1 .


With Regards ,

Juneed Manha

chundru_ravindra
Participant
0 Kudos

Hi,

You are trying to put Character data to Quantity variable. This is not possible. you will face a problem Conversion Error. Make sure Source and Target data type should be same.

Regards,

Ravindra.

Former Member
0 Kudos

Hi Brujo,

You are splitting and trying to put the value in quantity or currency fields(w_input - zzcant1 and w_input - zzmot1).

So first split and put in character or numeric type fields and then use MOVE or WRITE statement to move these character fields in quantity or currency fields.

Use as suggested by

Regards,

Sheetal.