09-21-2006 12:03 PM
Hi all,
I currently working on MM module where programs to be checked Unicode enabled in new versions 6.10 relase .
I have a problem in one of the program ..where the error is above mentioned type conversion is no longer possible.
the program :
LOOP AT pdf INTO wa_pdf.
TRANSLATE wa_pdf USING ' ~'.
CONCATENATE buffer wa_pdf INTO buffer.
ENDLOOP.
TRANSLATE buffer USING '~ '.
DO.
--> APPEND buffer TO t_pdf .error message
SHIFT buffer LEFT BY 255 PLACES.
IF buffer IS INITIAL.
EXIT.
ENDIF.
the fields are declared as
pdf TYPE STANDARD TABLE OF tline,
wa_pdf LIKE LINE OF pdf,
buffer TYPE string,
t_pdf TYPE STANDARD TABLE OF solix.
My question is how to make convertion using other logic.
any help is highly appreciated .
regards,
Amarnath Reddy
09-21-2006 4:23 PM
Try the following code:
Declare the following variables.
data: ls_pdf type solix,
ls_char(255) type c.
field-symbols: <fs> type any.
Add this code instead of 'append buffer to t_pdf in ur code:
ls_char = buffer.
assign ls_char to <fs> casting type x.
ls_pdf-line = <fs>.
append ls_pdf to t_pdf.
Regards
Sridhar
09-21-2006 12:29 PM
question is conversion of charecter string to byte string
processing
09-21-2006 1:06 PM
REPORT ZSRIM_TEMP23.
DATA : PDF TYPE STANDARD TABLE OF TLINE,
WA_PDF LIKE LINE OF PDF,
BUFFER TYPE STRING,
T_PDF TYPE STANDARD TABLE OF SOLIX.
LOOP AT PDF INTO WA_PDF.
TRANSLATE WA_PDF USING ' ~'.
CONCATENATE BUFFER WA_PDF INTO BUFFER.
ENDLOOP.
TRANSLATE BUFFER USING '~ '.
DO.
*--> APPEND buffer TO t_pdf .error message
SHIFT BUFFER LEFT BY 255 PLACES.
IF BUFFER IS INITIAL.
EXIT.
ENDIF.
ENDDO.
I copied your code in my sap system,but i am not getting any ERROR.can you please give the Error description along with the code.
Regards
Srikanth
09-21-2006 3:27 PM
Hi Sridar,
error message was t_pdf and buffer are not mutually convertable in unicode as t_pdf is of type solix and solix contains raw data type of binary data which is of byte string and buffer is having a string which is character string.
I think there is a structure mismatch .
09-21-2006 4:26 PM
use like,
FIELD-SYMBOLS: <cf> TYPE C.
ASSIGN BUFFER TO <cf> CASTING.
T_PDF = <CF>.
regards,
Srikanth.
09-21-2006 4:33 PM
I guess in UNICODE enabled system, data transferring between structures is possible only when both the structures are same or both have only character format fields.
To avoid the error, i think we need to explicitly move field by field when the structure alters.
Kind Regards
Eswar
09-21-2006 4:23 PM
Try the following code:
Declare the following variables.
data: ls_pdf type solix,
ls_char(255) type c.
field-symbols: <fs> type any.
Add this code instead of 'append buffer to t_pdf in ur code:
ls_char = buffer.
assign ls_char to <fs> casting type x.
ls_pdf-line = <fs>.
append ls_pdf to t_pdf.
Regards
Sridhar
09-22-2006 6:54 AM
Hi all,
Thanks for the helping me in solving the problem.
regards,
Amarnath Reddy.