‎2009 Mar 04 9:55 AM
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
‎2009 Mar 04 10:06 AM
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.
‎2009 Mar 04 10:06 AM
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.
‎2009 Mar 04 10:12 AM
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 !
‎2009 Mar 04 10:16 AM
what should this tab do? Make it a tab delimited file? If so, use the CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB to do so.
‎2009 Mar 04 10:36 AM
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 !
‎2009 Mar 04 10:42 AM
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.
‎2009 Mar 04 10:49 AM