on 08-20-2008 7:38 AM
Hi, friends
I have a text file to mail scenario, where file must be attached to receiver mail.
Receiver CC mail is protocol XIPAYLOAD and use mail package and keep attachment.
In tab module, i have:
Module name --> SAP XI Sample/ConvertCRLFfromToLF
Module configuration --> mode LFtoCRLF
The plain text file is attached to mail but there are no line feeds after the plain text lines.
Thanks, in advance
fieldSeparator='0x0D''0x0A' solved this problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you work with attachments, you first have to use PayloadSwapBean to switch attachment and main payload, then use the ConvertCRLFfromToLF module and then PayloadSwapBean again.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, Stefan.
I've tryed to apply your suggestion but i don't succeed.
I don't know how to do it if:
Attachment is created in CC via mail attributes
xml message is like:
<?xml version="1.0" encoding="utf-8" ?>
- <ns0:Mail xmlns:ns0="http://sap.com/xi/XI/Mail/30">
<Subject>Envio fichero </Subject>
<From>xxxxxxxs</From>
<To>xxxxxxxs</To>
<Content_Type>text/plain;charset=utf-8;name="envprvped_006058_080808_110104_388_N"</Content_Type>
<Content>LIN|0087505|CANELONES GRATINADOS RACION 300 G|10|20.000|0|0.89| LIN|0088131|CARACOLES CABRILLA 2'5 KG EU/KG|10|6.000|0|4.5| LIN|0088183|PULPO COCIDO BOLSA 2 KG EU/KG|3|4.000|0|16.75| LIN|0088203|MAIZ DULCE 2'5 K EU/KG|2|2.000|0|1.34| LIN|0088215|CALAMAR COMPASS ROMANA 3KG EU/KG|3|3.000|0|5.85|| LIN|0088339|NUGGETS POLLO 1 KG|6|30.000|0|4.07| LIN|0088346|PATATAS DOLARS 2'5KG EU/KG|10|8.000|0|0.88| LIN|0088398|MEJILLON GALLEGO MEDIA CONCHA 1 KG|9|9.000|0|4.45| LIN|0088404|GAMBA LANGOSTINERA N2 RETRAC.EU/KG|12|18.000|0|13.36| LIN|0088405|GAMBA LANGOSTINERA N4 RETRAC.EU/KG|6|18.000|0|8.75| LIN|0088434|BROCOLI 2'5 KG EU/KG|5|4.000|0|1.1|</Content>
</ns0:Mail>
Can you help me?
Thanks,
Carme
I see. You do not have an XI message with an attachment, just the main payload.
In that case the module won't help you in any way.
You have to add the CRLF in mapping. You can do that with a Java mapping which is added as additional step to your existing mapping. In this Java mapping you replace all LF with CRLF.
The Java mapping could be similar to that one:
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]
Just replace the ampersand with the characters of LF and CRLF
Regards
Stefan
Stefan,
This is not a Java mapping, it's an ABAP mapping.
I've tryed also to insert this characters, but without success.
In my abap class i have:
-
data: l_newline type c value cl_abap_char_utilities=>newline.
data: l_linefeed type c value cl_abap_char_utilities=>CR_LF.
clear wa_string.
incode = idocument->get_elements_by_tag_name( 'linea' ).
length = incode->GET_LENGTH( ).
do length times.
outcode = incode->get_item( index = d_lines ).
wa_linea = outcode->get_value( ).
if wa_string is initial.
wa_string = wa_linea.
else.
concatenate wa_string l_newline l_linefeed crlf wa_linea into wa_string.
endif.
add 1 to d_lines.
enddo.
l_element_dummy = l_document->create_simple_element(
name = 'Content'
VALUE = wa_string
parent = l_element_root ).
-
so...it's similar to your suggestion..
Any other input, please?
Regards,
Carme.
Hi, Stefan,
You are right: I have change my ABAP code, and now when I download payload from Message Monitorin (TEchnical Routing) i can see one line for every record LIN:
<?xml version="1.0" encoding="utf-8"?><ns0:Mail xmlns:ns0="http://sap.com/xi/XI/Mail/30"><Subject>Envio fichero MAGSA</Subject><From>xxxxx</From><To>xxxx</To><Content_Type>text/plain;charset=utf-8;name="envprvped_sdicmp_006058_080808_110104_388_N"</Content_Type><Content>LIN|0087500|CROQUETAS POLLO ARTESANAS 35 G 1K|4|20.000|0|2.58|
LIN|0087503|CROQUETAS SABOR POLLO 20 G 1K|4|20.000|0|1.12|
LIN|0087505|CANELONES GRATINADOS RACION 300 G|10|20.000|0|0.89|
LIN|0088131|CARACOLES CABRILLA 2'5 KG EU/KG|10|6.000|0|4.5|
CHK|84|</Content></ns0:Mail>
However, when I open file received via mail, this character has disappeared and i can see only a line with all content:
LIN|0087500|CROQUETAS POLLO ARTESANAS 35 G 1K|4|20.000|0|2.58|LIN|0087503|CROQUETAS SABOR POLLO 20 G 1K|4|20.000|0|1.12|LIN|0087505|CANELONES GRATINADOS RACION 300 G|10|20.000|0|0.89|
LIN|0088131|CARACOLES CABRILLA 2'5 KG EU/KG|10|6.000|0|4.5|CHK|84|
Kind regards,
Carme.
Why r u using this module? Is there a conversion from Windows line feed to Unix line feed or vice-versa.
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My problem is that i have a sender file in unix system that contains line feed.
Sender unix file is like:
LIN|0089541|150/200 3K EU/K|1|6.000|0|6.1|
LIN|0089579|5|10.000|0|4.7|
LIN|0089594|6|30.000|0|2.85|
LIN|0089599|3|15.000|0|4.55|
But received filed attached to mail is like:
LIN|0089541|150/200 3K EU/K|1|6.000|0|6.1|LIN|0089579|5|10.000|0|4.7|LIN|0089594|6|30.000|0|2.85| LIN|0089599|3|15.000|0|4.55|
And size is also different.
Thanks,
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.