Skip to Content

Trying to create 'CSV' files with 'SAP_CONVERT_TO_TEXT_FORMAT'

I am getting a dump when I use the functional call sometimes. Sometimes it works correctly.

       CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
         EXPORTING
              I_FIELD_SEPERATOR    = '|'
              "I_LINE_HEADER        = I_LINE_HEADER
              I_FILENAME           = fname
         TABLES
              I_TAB_SAP_DATA       = <fs_temp_data_standard>
         CHANGING
              I_TAB_CONVERTED_DATA = conv_data
         EXCEPTIONS
              CONVERSION_FAILED    = 1
              OTHERS               = 2.

2019-02-22-07-34-03-abap-runtime-errors.png

'In this case, the operand "op1" has the non-character-type "I". The current program is flagged as a Unicode program. In the Unicode context, type X fields are seen as non-character-type, as are structures that contain non-character-type components.'

How do I correct it, or should I build the csv files manually?

I wonder if this is related, I imported a table from memory into a table I made dynamically. This is the data I'm trying to convert. I wonder if a mismatch error were to happen and I ignore it it may cause problems later. When I remove 'IGNORING STRUCTURE BOUNDARIES' the import fails.

 IMPORT sel_tab TO <fs_data> ind_empty TO flag
   FROM MEMORY ID me->report_name IGNORING STRUCTURE BOUNDARIES.
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Feb 25, 2019 at 09:42 AM

    I think you'll have to create the CSV manually as Simon suggests. To convert from numeric to character, WRITE is usually a good option. You need to know the types of each field, so that you can know when to use the field value directly, and when they might need converting to character. You can get this through RTTS.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 25, 2019 at 08:40 AM

    What's your SAP version, did you search and find a note such as 1855878 - Supplement to SAP_CONVERT_TO_TEX_FORMAT (where 'I' was added)

    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.