How to send a mail through SAP and not to die trying it

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 ๐Ÿ˜›
Continue reading

MAP2E_IMSEG_TO_BAPI… and why I hate it (4.6c)

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 ๐Ÿ˜ฆ