Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

CL_ABAP_CHAR_UTILITIES "Carriage Return and Line Feed" Character Pair

Former Member
0 Kudos

Hi,

Using BCS method I'm sending a text file containing many lines. However, when I open the text file using notepad ++ some strange characters are appearing at the end of each line. This characters are CR LF, how can I remove this? During debugging I do not see this characters...

Thanks,

Mawi

4 REPLIES 4

SuhaSaha
Advisor
Advisor
0 Kudos

Are you getting the line breaks in your notepad ? If yes, i fear the '++' characters are not CRLF (amy be i am wrong)

Can you please paste your code so that we can analyse?

Former Member
0 Kudos


DATA: l_string    TYPE string,
        l_xstring   TYPE xstring,
        l_count     TYPE i.
          
  DATA: lt_mailrec  TYPE soli_tab,              
        l_size      TYPE so_obj_len.                     

  CONSTANTS: lc_pipe TYPE c VALUE '|'.

  FIELD-SYMBOLS: <fs> TYPE ANY.

  CLEAR: l_count.
  LOOP AT gt_file INTO gs_file WHERE vbeln  = pi_vbeln
                                 AND action = pi_action.
*   counter
    ADD 1 TO l_count.

    CLEAR: l_string.
    DO.
      CASE sy-index.
        WHEN 1.
          l_string = gs_file-bsark.

        WHEN OTHERS.
          ASSIGN COMPONENT sy-index OF STRUCTURE gs_file TO <fs>.
          IF sy-subrc NE 0.
            EXIT.
          ELSE.
            CONDENSE <fs>.
            CONCATENATE l_string <fs> INTO l_string SEPARATED BY lc_pipe.
          ENDIF.
      ENDCASE.
    ENDDO.

    IF l_count GT 1.
      CONCATENATE gc_nl l_string INTO l_string.
    ENDIF.
    CONDENSE l_string.
    REFRESH: lt_mailrec.

    TRY.
        cl_bcs_convert=>string_to_soli(
          EXPORTING
            iv_string   = l_string
          RECEIVING
            et_soli  = lt_mailrec ).
      CATCH cx_bcs.
        MESSAGE e445(so).
    ENDTRY.

    APPEND LINES OF lt_mailrec TO pt_mailbin.

  ENDLOOP. "zlsdi_hsbc_mail data

notepad ++ is the software I use to view the text file. I'm getting CR LF at the end of each line

Edited by: Mawi C. Ng on Apr 8, 2010 8:28 AM

0 Kudos

>

> notepad ++ is the software I use to view the text file. I'm getting CR LF at the end of each line

Oops my bad

Did you try opening with notepad do you see the CRLF character ?

Former Member
0 Kudos

If I use notepad I do not see any CR LF characters, however the client is using notepad ++ and they cannot process the file because of such error occurs due to those CR LF characters...