Application Development and Automation 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 only

Problem with TXT attach

Former Member
0 Likes
620

Hello people,

I have to send an e-mail with an attach. The file is generated in the program.

Im using the function "SO_NEW_DOCUMENT_ATT_SEND_API1"

On the contents_bin im concatenating cl_abap_char_utilities=>horizontal_tab on differents fields AND cl_abap_char_utilities=>cr_lf at the end of the line to jump for the next one. THE PROBLEM IS: the first character works good, but the second don´t, this character appears at the end of the line "□". I read in the forum that i can use a type X but i cant concatenate it. I use cl_abap_char_utilities=>newline too but the same happend.

I dont know what to do...i test evrithing and nothing work up. Any ideas???

Thank you!!!

Gustavo

PS: Sorry my english, Im from Argentine =P

7 REPLIES 7
Read only

Former Member
0 Likes
590

Hi Gustavo,

Question:

Is your application server on which the program will run a Windows based server or a Unix/Linux based server?

I suspect the last one (Unix/Linux based).

If so, do NOT concatenate cl_abap_char_utilities=>cr_lf but use cl_abap_char_utilities=>newline.

So use cl_abap_char_utilities=>cr_lf on a Windows based platform.

And use cl_abap_char_utilities=>newline on a Unix/Linux based platform.

On a Unix/Linux system a Carriage Return + Line Feed (CR+LF) only is a Carriage Return character. A TEXT file created on Unix/Linux that is migrated to Windows platform needs conversion (with an FTP tool this is done by setting the MODE to ASCII). The other way around works the same.

Hope this helps you out a bit.

Regards,

Rob.

Read only

Former Member
0 Likes
590

mmmmm he server is in Unix yes but...the table is generated in the program, i mean its not an existing file on server. In the program i do a few selects and another stuff and I finally get a innternal table "it_download". Then, I concatenate that fileds with the characters into another iinternal table "it_attach" and thats the table that i send on contents_bin.

Anyway, I tried with cr_lf and with newline and both didnt work.

Thank you for your time =D

Read only

0 Likes
590

Hi Gustavo,

Sorry it was not of much help.

Did you try to add the internal table to the CONTENTS_TXT table instead of CONTENTS_BIN? Since it is a textfile you're trying to attach to the mail.

Regards,

Rob.

Read only

Former Member
0 Likes
590

Yes but CONTENTS_TXT is the table who has the body of the e-mail, the table for the attach is CONTENTS_BIN.

Any other idea?

Read only

Former Member
0 Likes
590

I think the problem is the characters that Im concatenating or something like that. I had to do the same with an Excel file and this characters work good. Im really lost with this PLZ if anyones has an idea write it here.

Thank you

Read only

Former Member
0 Likes
590

Im looking at the class CL_ABAP_CHAR_UTILITIES

It has this attributes:

BYTE_ORDER_MARK_LITTLE

BYTE_ORDER_MARK_BIG

BYTE_ORDER_MARK_UTF8

CHARSIZE

ENDIAN

MINCHAR

MAXCHAR

HORIZONTAL_TAB

VERTICAL_TAB

NEWLINE Didnt work

CR_LF Didnt work

FORM_FEED

BACKSPACE

SPACE_STR

SPACE_STR_LANGU

Someone of these can help me?

Read only

Former Member
0 Likes
590

Well people, im not really sure what happend. Today I run again the program, and the txt file it was fine!

I test it 20 times more and it was rigth in all the test.

I dont know what happen...but now the programs works good

Thank you all!!!