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: 

Read_Text with the smart style then create attachment

suwandi_cahyadi
Contributor
0 Kudos

Hi Experts,

I need to send an email with an attachment. The content of the attachment comes from a document text which can be retrieved via the READ_TEXT FM.

The problem is, the user maintain the text with the Graphical PC Editor. User can enter anything in the text and sometimes the user uses the tab character to format and align the text.

When I get the content of the text and attach it using the cl_document_bcs. The tab alignment get messy, and after further research, this is because the the text in SAP uses the SYSTEM smart style, where the font family, font size and the tab width are different than the default word document.

My question is, how to get the content of the text and make it an attachment with a good tab alignment? (maybe to get the text content along with the styles that it has?)

Thank you,

Suwandi C.

1 ACCEPTED SOLUTION

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

See:

Try:

FORM get_pdf_data_2.

  CALL FUNCTION 'READ_TEXT'

  

  CALL FUNCTION 'PRINT_TEXT'

Get the otfdata and convert it to PDF return the result as TYPE solix_tab .

CL_BCS love solix_tab attachments .

Regards .

2 REPLIES 2

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

See:

Try:

FORM get_pdf_data_2.

  CALL FUNCTION 'READ_TEXT'

  

  CALL FUNCTION 'PRINT_TEXT'

Get the otfdata and convert it to PDF return the result as TYPE solix_tab .

CL_BCS love solix_tab attachments .

Regards .

Former Member
0 Kudos

Hi,

If you want to handle tab in the standard text, one way could be to use a place holder like $TAB$ in the text and then replace it in the runtime.

I know this requires user training on how to maintain data but will work always.

R