Skip to Content
author's profile photo Former Member
Former Member

reg Unicode: type convertion from byte and string charecter processing

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2006 at 03: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2006 at 11:29 AM

    question is conversion of charecter string to byte string

    processing

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2006 at 02: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 .

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2006 at 05:54 AM

    Hi all,

    Thanks for the helping me in solving the problem.

    regards,

    Amarnath Reddy.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.