Skip to Content
A Simple Example of “Minimalist IT” If you’re an SAP developer working or consulting for a wealthy and forward-thinking SAP customer (like the one I’m consulting for now), then the task of sending lengthy formatted multi-line emails out of SAP is trivial. But what if you’re at a site that can’t take advantage of the cool stuff that SAP provides to do this? (The stuff that many who post here take for granted.) I was recently working for a different customer whose security requirements prevented installation of any reasonable “modern” way to send any old email out of SAP, much less lengthy formatted multi-line emails. So of course, one of the consultants on site had already dipped into his ditty-bag and pulled out the usual function module that submits an SMTP “send” command to the OS (UNIX in this case). And this permitted very simple emails to be sent out of SAP, subject to the limitation on the size of the variable that could be passed to the FM for the actual text of the email. But what about long formatted multi-line emails? Well, those of you who have gotten fat and lazy because SAP now makes everything easy for you may have to think about this one for a little while. But for those self-reliant and hardy poor folk who know how to “make do”, there’s a simple and straightforward answer to this question. And, it can even be elaborated to allow for variable substitutions in the body of the email text. Do you know what it is? If not, should you? * Commented-out note: * (Note: discretionary points WILL be awarded if anyone * comes up with an even more minimal solution than * the one we used.) Amended note: As per Craig’s comment below: Craig will award 100 points to anyone who comes up with a simpler solution than taking advantage of the basic properties of the UNIX command line to pipe a cat file command to an SMTP send command. PS – Craig wants to allow non-email solutions in this contest, so since he’s awarding the points, he’s the boss. But I was really interested in solutions that actually send email via native OS mechanisms for doing so.

To report this post you need to login first.

9 Comments

You must be Logged on to comment or reply to a post.

  1. Community User
    Sorry that was supposed to be “amaze” slight typo I guess.

    Most people dealing with email formats tend to just review the multiple blogs and forums posts on the topic here in SDN and find many an alternative solution.

    Me went a completely different route when dealing with R/3 and a very simple 620 install (long before some of the goodies came into play) and got rid of the email all together.

    REST – it does not get any simpler!

    (0) 
    1. David Halitsky Post author
      Hi Craig –

      Your response ignores the requirement that the solution be “minimal”.

      What do you want to bet that the solution I have in mind is NOT in any of the blogs or posts to which you refer ?

      BTW, I don’t mind being a source for amusement OR amazement, so long as folks get the basic point I’m trying to make.

      As Kojak used to say, “Who loves ya, baby?”

      djh

      (0) 
      1. Community User
        Always a betting man, however it all really matters on what you consider to be minimal – a single solution which can eliminate all emailing and that can be deployed completely in less than 4 hours? If so and youcan do it in under 4 hours you would win 😉

        It’s hard to compare minimal because one’s interpretation changes the rules of the game, so it’s one of those cases of subjective ruling.

        (0) 
    2. David Halitsky Post author
      that it was in the last paragraph, which said that points would be awarded for any solution “different” than the one used at the site I was at. 

      What I should have said instead of “different” was “even more minimal”, and I have corrected the original post accordinly.

      Sorry for this lack of clarity.

      (0) 
      1. Community User
        Well first and foremost you can’t reward points for this type of thing even as a Mentor – however as I always enjoy seeing things challenged (would have prefered an email first though – please keep in mind for the future) I wil reward 100 points for someone who comes up with a more “minimal” solution than what you have – HOWEVER you need to update the blog again to show that solution (not a new blog – update this one).
        (0) 
        1. David Halitsky Post author
          didn’t come under the general heading of “community spirit”, particularly since any and all solutions would help our less fortunate brethren working at sites without the “goodies” as you call them.

          Anyway, I’ve amended the blog post as you requested.

          But I don’t know why me changing it popped it to the top of the stack for the day – not anything I did.

          (0) 
          1. Community User
            Feel free to keep it “email sending based” not everyone will have the freedom I did in my old life 😉

            As for the changing and stack issue you moved it to DRAFT mode then back to FINAL, no need to do that once it’s FINAL you can keep it that way.

            Oh since you get the emails when someone comments please let me know when someone or more than one person has solutions there can be more than one so no need to pick and choose if you feel there are two or even three that fit the bill say the word.

            (0) 
  2. Abdulbasit Gulsen
    Hi,

    I have faced with similar problem 5 years ago in SAP release 4.0B
    Our requirement was sending payroll results with e-mail in html format
    with nice images embeded to it. They also expected to encode e-mails with
    a simple algorithm. ( I used Base64 ) In release 4.0B there was not much
    options available as it is now.
    I was playing with PHP in those days and I came out with a solution
    supported with PHP. Nice thing is PHP is free and you can install either
    you use windows, unix or linux and it will not bring performance problems.
    Implementation time differs according to experience in PHP. It will not
    take 4 hours to implement maybe just 1-2 days. Hoverwer, if you think of the
    capabilities of this solution, it worths. You can integrate your different
    process in very simple way. Here is my solution;
    ( I will explain my solution according to windows but you can of course do
    the same things in unix )
    1. Install php to your system.
    Just download last version of php and copy it to any folder you want. Change
    some php.ini file according to your requirement. There is no need to install
    any web server since we will use php in command prompt.
    2. Write your php code to :
         – take parameters from text file
         – format your mail
         – send mail
    3. Write your ABAP Function Module to :
         – collect data from sap system
         – write collected data to temporary text file in filesystem
         – call php.exe with parameters like
           “php.exe abdulbasit@gulsen.net mySubject 43543534sdfsd.txt”
    4. Call your abap function module from anywhere you like.

    That’s all. There are plenty of php source in google using different
    methods to send formatted e-mail. You can use smtp authentication,attach
    documents, embed images, etc. You can design different templates for
    different purposes. You can also use the power of php to make some complex
    process easier. If you want to send data back to SAP just echo in PHP and
    read results back in your function module. If you have much data to send
    back to SAP, use SAPRFC.
    As I said before, it is not minimal solution. I don’t expect award point,
    but I just wanted to share my opinion…

    Regards
    Abdul.

    (0) 
    1. David Halitsky Post author
      Hi Abdulbasit Gulsen –

      That’s a nice one.  It’s similar to what we came up with because basically, it uses the operating system to do the job and just writes what is needed from SAP to the external file system. 

      But yours is more powerful becuase it can call up the full resources of php.

      I wish we had had this luxury in our situation, but because it was a government site, they would never have given the freedom you had to work at the OS level.  Well, they might have eventually, but it would have taken months to get all the bureaucratic OK’s.

      Anyway, thanks for taking the time and share your solution. As I said – I think you deserve the points.

      Regards
      djh

      (0) 

Leave a Reply