Professional Documents
Culture Documents
Email Sending Functionality For Different Business Process in Sap1
Email Sending Functionality For Different Business Process in Sap1
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
% ,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
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
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(