<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CRLF issue in csv text fields in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/crlf-issue-in-csv-text-fields/m-p/12613522#M2012002</link>
    <description>&lt;P&gt;Then I tried like this&lt;BR /&gt;DATA: ls_string TYPE string,&lt;/P&gt;&lt;P&gt;          lv_rec    TYPE i,&lt;/P&gt;&lt;P&gt;          gv_rec    TYPE i VALUE 0.&lt;/P&gt;&lt;P&gt;    FIELD-SYMBOLS: &amp;lt;fs_val&amp;gt; TYPE any.&lt;/P&gt;&lt;P&gt;    DATA: it_st TYPE STANDARD TABLE OF ts_data_tech,&lt;/P&gt;&lt;P&gt;          wa_st TYPE ts_data_tech.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        in_xstring = iv_content&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        out_string = ls_string.&lt;/P&gt;&lt;P&gt;    SPLIT ls_string AT '||' INTO TABLE it_text.&lt;/P&gt;&lt;P&gt;    DESCRIBE TABLE it_text LINES lv_rec.&lt;/P&gt;&lt;P&gt;    DATA(lv_count) = lv_rec / 43.&lt;/P&gt;&lt;P&gt;    lo_struct ?= cl_abap_structdescr=&amp;gt;describe_by_data( gs_data_tech2 ).&lt;/P&gt;&lt;P&gt;    DO lv_count TIMES.&lt;/P&gt;&lt;P&gt;      APPEND INITIAL LINE TO gt_data_tech2 ASSIGNING FIELD-SYMBOL(&amp;lt;fs_data_tech&amp;gt;).&lt;/P&gt;&lt;P&gt;      LOOP AT lo_struct-&amp;gt;components ASSIGNING FIELD-SYMBOL(&amp;lt;fs_components&amp;gt;).&lt;/P&gt;&lt;P&gt;        gv_rec = gv_rec + 1.&lt;/P&gt;&lt;P&gt;        READ TABLE it_text INTO DATA(wa_text) INDEX gv_rec.&lt;/P&gt;&lt;P&gt;        ASSIGN COMPONENT &amp;lt;fs_components&amp;gt;-name&lt;/P&gt;&lt;P&gt;         OF STRUCTURE &amp;lt;fs_data_tech&amp;gt; TO &amp;lt;fs_val&amp;gt;.&lt;/P&gt;&lt;P&gt;        &amp;lt;fs_val&amp;gt; = wa_text-line.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;    ENDDO.&lt;/P&gt;&lt;P&gt;*_______________________________________&lt;BR /&gt;but for this to work I hve to put delimeter || at the end of every record.. but my manager said it is not a good solution&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jun 2022 07:45:31 GMT</pubDate>
    <dc:creator>at09051</dc:creator>
    <dc:date>2022-06-21T07:45:31Z</dc:date>
    <item>
      <title>CRLF issue in csv text fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/crlf-issue-in-csv-text-fields/m-p/12613519#M2011999</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
  &lt;P&gt;I have a requirement in which I am uploading csv files in my abap program, the file has some text fields , for ex- supplier comment. records are separated by ||. user is writing comment in text field and pressing enter to write in new line. when I am uploading this file and split it into required internal table, the line is breaking from between( where the text field is) and next records are being generated in new row. do anyone hve any suggestions?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 06:32:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/crlf-issue-in-csv-text-fields/m-p/12613519#M2011999</guid>
      <dc:creator>at09051</dc:creator>
      <dc:date>2022-06-21T06:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: CRLF issue in csv text fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/crlf-issue-in-csv-text-fields/m-p/12613520#M2012000</link>
      <description>&lt;P&gt;If I understand well, the user enters this::&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;my first line
my second line&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And in the file:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;my first line||my second line&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Correct?&lt;/P&gt;&lt;P&gt;Then show your code and we'll tell you where you're wrong.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 07:11:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/crlf-issue-in-csv-text-fields/m-p/12613520#M2012000</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-06-21T07:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: CRLF issue in csv text fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/crlf-issue-in-csv-text-fields/m-p/12613521#M2012001</link>
      <description>&lt;P&gt;actually file is like this..&lt;/P&gt;&lt;P&gt;abc|| my first line&lt;/P&gt;&lt;P&gt;my second line || cdef|| ghi and so on&lt;/P&gt;&lt;P&gt;the records in internal table should be like..&lt;/P&gt;&lt;P&gt;abc | my first line ##(crlf) my second line | cdef | ghi..&lt;/P&gt;&lt;P&gt;earlier I wrote a code..&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        buffer        = iv_content&lt;/P&gt;&lt;P&gt;*       APPEND_TO_TABLE       = ' '&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        output_length = gv_length&lt;/P&gt;&lt;P&gt;      TABLES&lt;/P&gt;&lt;P&gt;        binary_tab    = gt_upload.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'SCMS_BINARY_TO_TEXT'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        input_length = gv_length&lt;/P&gt;&lt;P&gt;      TABLES&lt;/P&gt;&lt;P&gt;        binary_tab   = gt_upload&lt;/P&gt;&lt;P&gt;        text_tab     = gt_str&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        failed       = 1&lt;/P&gt;&lt;P&gt;        OTHERS       = 2.&lt;/P&gt;&lt;P&gt;    LOOP AT gt_str INTO DATA(gs_str).&lt;/P&gt;&lt;P&gt;      " split csv data to convert it into standard table format&lt;/P&gt;&lt;P&gt;      SPLIT gs_str-line AT '||' INTO gs_data_tech-statebox&lt;/P&gt;&lt;P&gt;                 gs_data_tech-taskbox&lt;/P&gt;&lt;P&gt;                 gs_data_tech-validationbox&lt;/P&gt;&lt;P&gt;                 gs_data_tech-prioritybox&lt;/P&gt;&lt;P&gt;                 gs_data_tech-rfrno&lt;/P&gt;&lt;P&gt;                 gs_data_tech-nctext&lt;/P&gt;&lt;P&gt;                 gs_data_tech-msn&lt;/P&gt;&lt;P&gt;                 gs_data_tech-version&lt;/P&gt;&lt;P&gt;                 gs_data_tech-nctype&lt;/P&gt;&lt;P&gt;                 gs_data_tech-program&lt;/P&gt;&lt;P&gt;                 gs_data_tech-plant&lt;/P&gt;&lt;P&gt;                 gs_data_tech-state&lt;/P&gt;&lt;P&gt;                 gs_data_tech-ncopened&lt;/P&gt;&lt;P&gt;                 gs_data_tech-ncclosed&lt;/P&gt;&lt;P&gt;                 gs_data_tech-supplier&lt;/P&gt;&lt;P&gt;                 gs_data_tech-activeoss&lt;/P&gt;&lt;P&gt;                 gs_data_tech-taskopened&lt;/P&gt;&lt;P&gt;                 gs_data_tech-priority&lt;/P&gt;&lt;P&gt;                 gs_data_tech-productgrp&lt;/P&gt;&lt;P&gt;                 gs_data_tech-partdesc&lt;/P&gt;&lt;P&gt;                 gs_data_tech-partno&lt;/P&gt;&lt;P&gt;                 gs_data_tech-category&lt;/P&gt;&lt;P&gt;                 gs_data_tech-airbuscomment&lt;/P&gt;&lt;P&gt;                 gs_data_tech-liability&lt;/P&gt;&lt;P&gt;                 gs_data_tech-liabilitycat&lt;/P&gt;&lt;P&gt;                 gs_data_tech-liabilityval&lt;/P&gt;&lt;P&gt;                 gs_data_tech-validationstatus&lt;/P&gt;&lt;P&gt;                 gs_data_tech-validationcomment&lt;/P&gt;&lt;P&gt;                 gs_data_tech-suppliercomment&lt;/P&gt;&lt;P&gt;                 gs_data_tech-completiondate&lt;/P&gt;&lt;P&gt;                 gs_data_tech-prod_deadline_datetime&lt;/P&gt;&lt;P&gt;                 gs_data_tech-matavailabledate&lt;/P&gt;&lt;P&gt;                 gs_data_tech-affectedsubcomp&lt;/P&gt;&lt;P&gt;                 gs_data_tech-trackingno&lt;/P&gt;&lt;P&gt;                 gs_data_tech-currency&lt;/P&gt;&lt;P&gt;                 gs_data_tech-labourhrsoss&lt;/P&gt;&lt;P&gt;                 gs_data_tech-adminhrsoss&lt;/P&gt;&lt;P&gt;                 gs_data_tech-matcostsoss&lt;/P&gt;&lt;P&gt;                 gs_data_tech-shipcostsoss&lt;/P&gt;&lt;P&gt;                 gs_data_tech-datasource&lt;/P&gt;&lt;P&gt;                 gs_data_tech-notificationid&lt;/P&gt;&lt;P&gt;                 gs_data_tech-dossierid&lt;/P&gt;&lt;P&gt;                 gs_data_tech-tasknumber&lt;/P&gt;&lt;P&gt;                 gs_data_tech-qrpref&lt;/P&gt;&lt;P&gt;                 gs_data_tech-cfifilter&lt;/P&gt;&lt;P&gt;                 gs_data_tech-technical_fields_marker.&lt;/P&gt;&lt;P&gt;      IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;        APPEND gs_data_tech TO gt_data_tech. " append lines of all csv files to one table&lt;/P&gt;&lt;P&gt;        CLEAR gs_data_tech.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2061685-image.png" /&gt;&lt;/P&gt;&lt;P&gt;there should be 2 records only(one is header file).. but you see there are three&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 07:43:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/crlf-issue-in-csv-text-fields/m-p/12613521#M2012001</guid>
      <dc:creator>at09051</dc:creator>
      <dc:date>2022-06-21T07:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: CRLF issue in csv text fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/crlf-issue-in-csv-text-fields/m-p/12613522#M2012002</link>
      <description>&lt;P&gt;Then I tried like this&lt;BR /&gt;DATA: ls_string TYPE string,&lt;/P&gt;&lt;P&gt;          lv_rec    TYPE i,&lt;/P&gt;&lt;P&gt;          gv_rec    TYPE i VALUE 0.&lt;/P&gt;&lt;P&gt;    FIELD-SYMBOLS: &amp;lt;fs_val&amp;gt; TYPE any.&lt;/P&gt;&lt;P&gt;    DATA: it_st TYPE STANDARD TABLE OF ts_data_tech,&lt;/P&gt;&lt;P&gt;          wa_st TYPE ts_data_tech.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        in_xstring = iv_content&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        out_string = ls_string.&lt;/P&gt;&lt;P&gt;    SPLIT ls_string AT '||' INTO TABLE it_text.&lt;/P&gt;&lt;P&gt;    DESCRIBE TABLE it_text LINES lv_rec.&lt;/P&gt;&lt;P&gt;    DATA(lv_count) = lv_rec / 43.&lt;/P&gt;&lt;P&gt;    lo_struct ?= cl_abap_structdescr=&amp;gt;describe_by_data( gs_data_tech2 ).&lt;/P&gt;&lt;P&gt;    DO lv_count TIMES.&lt;/P&gt;&lt;P&gt;      APPEND INITIAL LINE TO gt_data_tech2 ASSIGNING FIELD-SYMBOL(&amp;lt;fs_data_tech&amp;gt;).&lt;/P&gt;&lt;P&gt;      LOOP AT lo_struct-&amp;gt;components ASSIGNING FIELD-SYMBOL(&amp;lt;fs_components&amp;gt;).&lt;/P&gt;&lt;P&gt;        gv_rec = gv_rec + 1.&lt;/P&gt;&lt;P&gt;        READ TABLE it_text INTO DATA(wa_text) INDEX gv_rec.&lt;/P&gt;&lt;P&gt;        ASSIGN COMPONENT &amp;lt;fs_components&amp;gt;-name&lt;/P&gt;&lt;P&gt;         OF STRUCTURE &amp;lt;fs_data_tech&amp;gt; TO &amp;lt;fs_val&amp;gt;.&lt;/P&gt;&lt;P&gt;        &amp;lt;fs_val&amp;gt; = wa_text-line.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;    ENDDO.&lt;/P&gt;&lt;P&gt;*_______________________________________&lt;BR /&gt;but for this to work I hve to put delimeter || at the end of every record.. but my manager said it is not a good solution&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 07:45:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/crlf-issue-in-csv-text-fields/m-p/12613522#M2012002</guid>
      <dc:creator>at09051</dc:creator>
      <dc:date>2022-06-21T07:45:31Z</dc:date>
    </item>
  </channel>
</rss>

