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

Runtime error when Transfering data from data object to a file

Former Member
0 Likes
1,136

Hi everybody,

I'm having a problem when I transfer data from data object to file. The codes like following :

data : full_path(128).

OPEN DATASET full_path FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

and transfer data from flat structure to this file full_path

move: tab to c_output-tab_5,

tab to c_output-tab_4,

tab to c_output-tab_3.

transfer c_output to full_path. // Error Line

The detail error like the following:

For the statement

"TRANSFER f TO ..."

only character-type data objects are supported at the argument position

"f".

In this case. the operand "f" has the non-character-type "u". The

current program is a Unicode program. In the Unicode context, the type

'X' or structures containing not only character-type components are

regarded as non-character-type.

transfer c_output to full_path. " Line error

Please help me to fix this issue !

Thank you in advance !

Edited by: Hai Nguyen on Mar 4, 2009 10:55 AM

1 ACCEPTED SOLUTION
Read only

Sm1tje
Active Contributor
0 Likes
885

the error message is quite self explanatory. The field type of the argument you are transferring, contains non-character type fields. Check all fields of c_output and determine which fields are non character type fields.

6 REPLIES 6
Read only

Sm1tje
Active Contributor
0 Likes
886

the error message is quite self explanatory. The field type of the argument you are transferring, contains non-character type fields. Check all fields of c_output and determine which fields are non character type fields.

Read only

Former Member
0 Likes
885

Hi Mickey,

Thanks for your answer,

I found out that the structure c_output have the field with data type X. I know that the cause of the issue.

begin of c_output,

vbeln(10),

tab_5 like tab,

posnr(6),

tab_4 like tab,

topmat(18),

tab_3 like tab,

end of c_output.

data : tab type X value 9.

Could you tell me how to fix it ? What I have to do in this situation ?

Thank you very much !

Read only

Sm1tje
Active Contributor
0 Likes
885

what should this tab do? Make it a tab delimited file? If so, use the CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB to do so.

Read only

Former Member
0 Likes
885

Hi Micky,

I only have to fix that bug. I don't create this program so I don't know the purpose of tabs

Do you have any solution to casting the type of c_output or change the addition for the OPEN DATASET

OPEN DATASET full_path FOR OUTPUT IN TEXT MODE ENCODING DEFAULT ?

Thank you very much !

Read only

Sm1tje
Active Contributor
0 Likes
885

You can try to use the OPEN DATASET ....BYTE MODE, but I don't think this is the way to go.

Try like this:

change the type of tab to the type of attribute horizontal_tab of class cl_abap_char_utilities. Next, move this value cl_abap_char_utilities=>horizontal_tab to tab and you should be in the clear.

Read only

Former Member
0 Likes
885

Thanks Mickey,

I will try doing like your guides !