10-28-2009 7:32 PM
Hello Everybody,
I have a requirement to read the Mail body as soon it comes into SAP.
For that I have set up the exits in SO50 and its working fine.
When I look at the mail content , I see that the Mail lines are separated with #.
When I am trying to split at # , the character is not recognised in SAP.
Can someone tell me how can recognise the Linefeeds from the mail body so that I split the data
accordingly.
Please help me on this.
Thanks,
Sneha Sing.
10-28-2009 7:57 PM
try splitting at cl_abap_char_utilities=>horizontal_tab. or vertical_tab or CR_LF (for line feed)
like
split x1 at cl_abap_char_utilities=>CR_LF into ab cd ef. try other attributes(hor tab, vrt tab as well)..
http://help.sap.com/saphelp_nw04s/helpdata/en/79/c554d9b3dc11d5993800508b6b8b11/frameset.htm
Edited by: Soumyaprakash Mishra on Oct 29, 2009 1:29 AM
10-28-2009 7:57 PM
try splitting at cl_abap_char_utilities=>horizontal_tab. or vertical_tab or CR_LF (for line feed)
like
split x1 at cl_abap_char_utilities=>CR_LF into ab cd ef. try other attributes(hor tab, vrt tab as well)..
http://help.sap.com/saphelp_nw04s/helpdata/en/79/c554d9b3dc11d5993800508b6b8b11/frameset.htm
Edited by: Soumyaprakash Mishra on Oct 29, 2009 1:29 AM
10-28-2009 8:03 PM
>
> I have a requirement to read the Mail body as soon it comes into SAP.
If you just want to read it.... why do you need to split. I think, when the mail comes into SAP the mail content will be in internal table....
The table is type of SOLI where you have only field which is line. The other one you see is not from the table but it is SAP internal.
You can read it. If you want to alter it you would have to copy it into internal table. (not sure even if it works).
>
> For that I have set up the exits in SO50 and its working fine.
> When I look at the mail content , I see that the Mail lines are separated with #.
> When I am trying to split at # , the character is not recognised in SAP.
>
Try to find some function modules for read text or similar to this. You may have to pass internal table into the FM.... Also check for any convertion function modules
10-28-2009 8:12 PM
I am already reading it from SOLI.
I am looking to split the line at the Linefeed because the mail contains valid data.
I need to do some actions based on the data from the mail.
10-28-2009 8:34 PM
declare a constant like:
data: lv_feed type c value cl_abap_char_utilities=>CR_LF.
now use:
do.
split <your email text > into line1 <your email text >
if sy-subrc ne 0.
exit.
endif.
append table.
enddo.