I had to send again a mail through SAP. I used my older code and found it a lot heavy for my needs. I managed to create a Z function that allows me to send a simple mail without having to fill all those nasty tables.
Maybe it exists in SAP standard, but I’ve been not able to find it. Continue reading
Update: I’ve wrote a function module that allows you to send VERY SIMPLE mails (no attachments, no weird things) here.
Long time ago, before becoming a tuly idiot, I’ve had to face a little trouble: I had to send a mail with an attachment through SAP, and was not able to find by myself how to do it.
I’ve searched around the net (basically SAPFans :P) and managed how to do it.
I’ve posted there (in SAPFans, I mean) how to do it, but from time to time, someone re-asks the same question, and I’m tired of use the search button in SF. Today I did it again (the search, I mean… I’m not enough lucky) and though “why not to put it in the club’s page? I will save some time in the future…” or something like that.
The link here: http://sapfans.com/forums/viewtopic.php?p=543631
And the post itself after the jump 😛
Let’s talk a bit about my idiocy. Maybe if you read this and never though about sy-tabix, you will find this post useful. If you knew the basics of sy-tabix, you will find this post useless and trivial.
But hey! I am an idiot, and must thing all we can be idiots sometimes.
Maybe you have used sometime the wonderful SFMDR (SAP Function Module Documentation Repository) from Richard Harper (his friends call him “Rich”… both).
When he launched the idea, I was one of the first SAPFans to jump over the wagon to help him with its translations…
The function module MAP2E_IMSEG_TO_BAPI2017_GM_ITE helps the coder to find a faster way to transfer data from IMSEG structure to its BAPI equal. But the FM’s code in 4.6c doesn’t check the IMSEG’s fields’ types and/or if they are full.
Then, you call this module happily, and when you call the BAPI_GOODSMVT_CREATE you get an absurd error about PS_PSP_PNR is wrong. And you ask yourself “When I tried to fill this freaky field?”
Never. You didn’t. But that weird FM does. And a NUMC initial field when MOVE’d to a C field delivers its zeroes to the character field. And the BAPI checks if that C field is initial, taking ‘00000000’ as a valid value.
I will not use this FM in my system for now. It’s pure crap, and its original coder needs to learn some things about the MOVE sentence. Sometimes I hate BAPIs 😦