Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 9

Email Sending Functionality for Different Business Process in Sap

created by Vijay Simha on Nov 18, 2013 6:40 AM, la t modi!ied by Vijay Simha on "an 21, 2014 #:4$ AM
Ver ion 1
inShare1

Email Sending Functionality for Different Business Process in Sap


Nov, 2013 ntroduction Every Business Process in SAP Follow different communication types to communicate with its Business partners like Print and send via post, Fax, and Email (Internet !Several E"mail communications need to #e sent to $endors % &ustomers who are the #usiness partners for the or'ani(ation which contains several Business Processes like Payment Advice, )unnin' forms and P*+s etc!, with P)F and Excel as attachment, which is a very eco!friendly "ay! Presently many are usin' the process of takin' a print out and sendin' it throu'h the post! ,his Process has lot of paper wasta'e! So instead of this we can send a mail which saves lot of paper wasta'e !,his process ena#les the #o green nitiative and reduces lot of manual effort! -ith the recent releases in SAP all the Business process are enhanced with Email sendin' functionality! ntroduction to Email Processes Every Standard FI process like )unnin' and Payment and collection advice has a default way of sendin' there notices to the customer or vendor #y post! Sendin' a mail is not a standard SAP functionality. in order to achieve this nonstandard Functionality we haveB$E! ,his is an enhancement techni/ue (*pen FI that was developed for Financial Accountin' component! ,his functionality is primarily used in FI in the areas of dunnin', Payment advice &ustomer and $endor Statement etc! Each of them has their own Function modules which will not interfere with each other! Each of these has a B,E+s ena#led to fill the FI00A"0A&1A structure to determine whether the output should #e sent as fax, print via post or email, i!e!, if FI0AA"0A&1A 2 3 " print via post and FI0AA"0A&1A 2 4I+ its email and if its 45+ FA6! ,his )ocument contains how this mail functionality can #e achieved #y usin' the B,E+s for )ifferent applications in FI! 1% Application Area: FI - Accounts payable and Accounts receivable Dunning &pplication of t'e process B$E event (000010)0( ! % ,his process B,E is useful sent to the customer As a default property, the either #y scannin' the copy durin' a dunnin' run when a dunnin' notice needs to #e #y the medium of an electronic form (E7AI8 ! dunnin' notice 'ets printed and is sent to the customer or via 9P*S,9!

% ,his same dunnin' notice could #e a very #eneficial if it is sent #y means of electronic form directly after the dunnin' has #een carried out!

% So, to achieve this non"standard functionality we need to enhance the standard process! $ransaction ! F BF !* Environment !* nfo systems +Processes, % &lick on execute, % Select the B,E ::::3:;: as it deals with the *utput device<medium

% &han'e the Already Present function module to = function 7odule!

0ow, technically the B,E is ready to work as we have re'istered the B,E! As a functional aspect, the followin' thin's are needed to #e taken care of!

% Standard communication option " to 9E7AI89 in the 9>eneral9 ,a# in customer master 96):5<:39!

% After confi'urin' these #asic steps, the B,E is complete to tri''er for dunnin' run for this particular customer! Dunning -un % SAPF3?:)5",his Pro'ram can #e used to execute the )unnin' form #y 'ivin' the @un date and identification and the lo'ic in the F79s can #e checked #y placin' the de#u''er! % Best way is to check in the de#u''er,

& F N&&!N&./& ! For .ommunication 0edium + ! nternet, 1!Print 1ut, 2!Fa2, & F N&&3 N$&D 4 Email &ddress to send t'e PDF

& Process the next step #y confirmin' the 9Send to mail9 dialo',

& If 9&AFI0AA"I0,A)9 is left #lank the system will pick from the customer master 9&lerks internet9, else it will take from the value 9&AFI0AA"I0,A)9! ,his ena#les the P)F sendin' functionality which ena#les is standard process and the lo'ic to send excel can #e written in the a#ove F7 only! Also if you need to fill the Su#Bect of Email use itcpo"tdtitle structure which of ?: characters! If we need to send the Body also 7aintain the standard text as mentioned in the #elow screen shot!

N1$E5 If we need to send many attachments other than P)F we have to write the code in the a#ove F7 call the common mail sendin' functionality! In this case first a mail will #e sent with Excel or some other as attachment then the standard P)F functionality is called! $'is is a very eco!friendly means of informing t'e customers for t'eir over!due items%

2% Application Area: FI Payment Advice and Collection Advice: &pplication of t'e process B$E event (000020)0( 4 ,his B,E is called in the standard include @FF*@I:C as shown #elow!

% In the transaction FIBF Select the B,E ::::5:;: as it deals with the *utput device<medium sampleAprocessA::::5:;: will #e assi'ned! % Since this is not a standard functionality we need to enhance the F7 so copy the sampleAprocessA::::5:;: into =sampleAprocessA::::5:;:! 6ogic in t'e F0 &heck if customer or $endor has Email 7aintained in the 7aster )ata! If it+s maintained then % ,he structure cAfinna included the internet address!
'e et the tran mi ion medi(m to )*+ a belo,c.!inaa/nacha 0 1*1c.!inaa/intad 0 l. mt2.addr31304- 56he email 7btained !rom the ma ter data8

8ater the mail sendin' functionality can #e called after the closeAform as shown in the #elow screen shot or By *,F data and excel can #e created usin' the ta#Are'up structure in the form avisAschrei#en! 3% Application Area: FI Customer/Vendor Balance Con irmation: &pplication of t'e process B$E event (00002)10( 4 % ,his process B,E is useful durin' a &ustomer<$endor Balance &onfirmation form which needs to #e sent to the &ustomer<$endor #y an electronic form (E7AI8 ! By default, the form is sent to the &ustomer<$endor either #y Fax or via 9P*S,9!

% But as an environmental aspect to avoid wasta'e of paper, the same Statement could #e sent #y means of electronic form directly after the &ustomer<$endor Statement run has #een carried out! % So, to achieve this functionality we need to enhance the standard process! !ransaction - FIBF -" #nvironment -" In o $ystems %Processes& % &lick on Execute! % Select B,E ::::5;3: as it deals with )eterminin' the *utput )evice

% &lick on Sample Function 7odule! ,he F7 9SA7P8EAP@*&ESSA::::5;3:9 is assi'ned! In order to include the mail sendin' functionality, &opy the Function 7odule into a = Function 7odule and make the re/uired chan'es to ena#le the mail sendin' functionality! 6ogic in t'e F05 &heck if the &ustomer or $endor has Email 7aintained in the 7aster )ata! If it is maintained then % ,he structure cAfinna includes the internet address! -e set the transmission medium to 4I+ as #elow! &Afinaa"nacha 2 9I9! &Afinaa"intad 2 lAsmtpAaddr(3D: ! EEmail *#tained from the master dataF % 8ater the mail sendin' functionality can #e called after the &loseAform as shown in the #elow screen shot or By *,F data, and excel can #e created usin' the Structure 1BSI)1 for &ustomer and 1BSIG1 for $endor!

4% /o" to ac'ieve 0ail Functionality $ec'nically5 .reate a .ommon Functionality for sending mail using classes i& For sending t'e sub(ect greater t'an )** c'aracters
% At 2re ent ( in9 the :M S7.;7<=M>N6.S>N;.A?*1 ha the ca2ability o! endin9 only #0 character b(t ( in9 the belo, method o! the cla the (bject more than 2## character -

% So clA#cs class is used for the #elow purpose! % ,here is also any option of chan'in' the sender I) in case the re/uirement is not use the % SAP master Hser I) usin' the clA#cs class! % &reate the #elow setAmessa'eAsu#Bect o#Bect of type clA#cs and call the method to

wAsendAre/uest ,IPE @EF ,* clA#cs $A8HE IS I0I,IA8, &A88 7E,1*) wAsendAre/uest"JsetAmessa'eAsu#Bect E6P*@,I0> ipAsu#Bect 2 su#Bect! ii, For Sending 0ultiple &ttac'ments li7e PDF and E2cel % In case multiple attachments the #elow method addAattachment attachment can #e used #y loopin' on the attachments o#tained to this function module! fAA,,A&17E0,S ,IPE @7PSA,AP*S,A&*0,E0,

wAdocument

,IPE @EF ,* clAdocumentA#cs $A8HE IS I0I,IA8,

8**P A, attachments I0,* fAattachment!

wAattachmentAsu#Bect 2 fAattachment"su#Bect! wAfilesi(e 2 fAattachment"docsi(e! % ,his 7ethod will have the option to take input as method su#Bect, filesi(e and wAdocument"JaddAattachment( E6P*@,I0> iAattachmentAtype 2 fAattachment"docAtype iAattachmentAsu#Bect 2 wAattachmentAsu#Bect iAattachmentAsi(e 2 wAfilesi(e iAattAcontentAtext 2 fAattachment"contAtextEF ! E0)8**P! iii& For $ending #mail to multiple recipients li+e !o, BCC and CC, % ,he #elow 8o'ic can applied to provide cc #cc and to as like multiple receivers! ,he method addArecipient wArecipient has the option to 'ive #lindAcopy, &opy and recipient! ,IPE @EF ,* ifArecipientA#cs $A8HE IS I0I,IA8,

% 8oop at the multiple receivers 8**P A, receivers I0,* fAreceivers! wArecipientAmail 2 fAreceivers"receiver ! % ,he #elow method sets wArecipient 2 wArecipientAmail ! them mail I) of the @eceiver! clAcamAaddressA#cs2JcreateAinternetAaddress(

E6P*@,I0> iArecipient iAcopy iA#lindAcopy E0)8**P! iAexpress 2 2

wAsendAre/uest"JaddArecipient( 2 wArecipient 2 969 fAreceivers"copy fAreceivers"#lindAcopy !

You might also like