Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

New line for text file

Hi,

I am trying to send text file as an email attachment using   cl_document_bcs->add_attachment method.

My requirment is to get the file in below format..

%FDF-1.2%âãÏÓ

1 0 obj

<</FDF

<</Fields[

<</T(COMPANY_ADDRESS)/V(ABC PVT) Ltd PO Box 7058 Greenstone 1616 ZA ZA)>>

/ID[]/UF()>>/Type/Catalog>>

endobj

trailer

<</Root 1 0 R>>

%%EOF


I have hard coded most of the stuff like below..

DATA:

DATA:it_fdf  TYPE bcsy_text,

                 wa_fdf TYPE soli.


CONSTANT:

d14(8) VALUE '%FDF-1.2',

                      d15(6) VALUE '%âãÏÓ',

                      d16(7) VALUE '1 0 obj',

                      d17(20) VALUE '/FDF << /Fields [',

                      d18(6VALUE '[ << /T ('.



wa_fdf = d14.

  CONDENSE wa_fdf.

  APPEND wa_fdf TO it_fdf.

  wa_fdf = d15.

  CONDENSE wa_fdf.

  APPEND wa_fdf TO it_fdf.

  wa_fdf = d16.

  CONDENSE wa_fdf.

  APPEND wa_fdf TO it_fdf.

  wa_fdf = d17.

  CONDENSE wa_fdf.

  APPEND wa_fdf TO it_fdf.


  ls_atatchments-objtp = 'txt'.

             ls_atatchments-subject = pv_subject.

             ls_atatchments-cont_text = it_fdf.

             APPEND ls_atatchments TO attachment.

CALL METHOD lo_document->add_attachment

                       EXPORTING

                         i_attachment_type    = ls_atatchments-objtp

                         i_attachment_subject = pv_title

                         i_att_content_text   = ls_atatchments-cont_text.

but output text file is appearing as per the attachment..

but I want to write text file like

%FDF-1.2%âãÏÓ- in first line

1 0 obj- in second line (Currently second line is appearing in first line after 250 char as line for SOLI is 250 char...)


Could you any one tell me how I can achieve this in order to get the line in second line not after the 250 char..?


I really appreciate your help on this.

Thanks,

Sara.

Not what you were looking for? View more on this topic or Ask a question