2008 Apr 18 2:51 PM
Hi,
I am getting the unicode problem in transfer statement.
Please follow the code.
DATA : BEGIN OF FINALDATA1 OCCURS 0,
TEXT(25) TYPE C,
f0(1) type c value ',',
QUANTITY LIKE S780-ZZPRDPRQTY,
f1(1) type c value ',',
CURRENCY LIKE S780-ZZPRDPURCS,
f2(1) type c value ',',
TRATE1 TYPE P DECIMALS 3,
END OF FINALDATA1.
OPEN: DATASET OFILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT. "open the input file "ECC6
IF SY-SUBRC <> 0.
WRITE: 'Input file could not be opened', SY-SUBRC.
STOP.
ENDIF.
LOOP AT FINALDATA1.
perform move_neg_sign1.
perform move_neg_sign2.
perform move_neg_sign3.
*
TRANSFER FINALDATA1 TO OFILE .
ENDLOOP.
In this the unicode problem will comin in runtime mode.
please solve this problem urgently.
Thanks & Regards,
Radhakrishna.Y
2008 Apr 18 3:04 PM
transfer will fail for currency and Quantity fields.
DATA : BEGIN OF FINALDATA1 OCCURS 0,
TEXT(25) TYPE C,
f0(1) type c value ',',
QUANTITY type char10, "they should be character variables
f1(1) type c value ',',
CURRENCY type waers,
f2(1) type c value ',',
TRATE1 TYPE P DECIMALS 3,
END OF FINALDATA1.
data: file type rlgrap-filename.
OPEN: DATASET FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT. "open the
IF SY-SUBRC eq 0.
WRITE: 'Input file could not be opened', SY-SUBRC.
STOP.
ENDIF.
LOOP AT FINALDATA1.
"so convert that to char format and send.
TRANSFER FINALDATA1 TO FILE .
ENDLOOP.
2008 Apr 18 2:56 PM
Hello,
Use the OPEN DATASET command IN BYNARY MODE saving the data to an XSTRING variable and later on convert it to the desirable data type.
Follow an example:
DATA: file TYPE string VALUE `flights.dat`,
wa TYPE spfli.
FIELD-SYMBOLS <hex_container> TYPE x.
OPEN DATASET file FOR INPUT IN BINARY MODE.
ASSIGN wa TO <hex_container> CASTING.
DO.
READ DATASET file INTO <hex_container>.
IF sy-subrc = 0.
WRITE: / wa-carrid,
wa-connid,
wa-countryfr,
wa-cityfrom,
wa-cityto,
wa-fltime,
wa-distance.
ELSE.
EXIT.
ENDIF.
ENDDO.
Regards,
2008 Apr 18 3:04 PM
transfer will fail for currency and Quantity fields.
DATA : BEGIN OF FINALDATA1 OCCURS 0,
TEXT(25) TYPE C,
f0(1) type c value ',',
QUANTITY type char10, "they should be character variables
f1(1) type c value ',',
CURRENCY type waers,
f2(1) type c value ',',
TRATE1 TYPE P DECIMALS 3,
END OF FINALDATA1.
data: file type rlgrap-filename.
OPEN: DATASET FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT. "open the
IF SY-SUBRC eq 0.
WRITE: 'Input file could not be opened', SY-SUBRC.
STOP.
ENDIF.
LOOP AT FINALDATA1.
"so convert that to char format and send.
TRANSFER FINALDATA1 TO FILE .
ENDLOOP.
2008 Apr 18 3:50 PM
Hi,
how we convert the quantity, currency and rate fields having decimal values into character format.
my file having data like this.
233,123.000 is the currency
.091 is the rate.
254.678 is the quantity.
my main problem is when i transfer my data from internal table to operating system file,it displays the unicode problem during runtime.
TRANSFER FINALDATA1 TO OFILE(it is a operating system file).
Please provide me profer solution.
Thanks & Regards,
Radhakrishna.Y
2008 Aug 20 10:41 PM
data textqty(10) type c.
write quantity to textqty.
This will convert your quantity field to text..keeping the comma's and decimal
Joe
2008 Apr 18 3:05 PM
Hi,
It is necessary to specify as an option, which character set is used in the disk file. Since the legacy system is still using the "old" character set and not Unicode.
Find out the character set in the legacy and use like this way
open dataset fnam for input in legacy text mode code page '1100'.
a®