Académique Documents
Professionnel Documents
Culture Documents
IntegratingSchedulerSoftwarewithSAPPI|SCN
GettingStarted Newsletters
Hi,Jagadish
LogOut
1points
Store
SearchtheCommunity
Products
Services&Support
AboutSCN
Downloads
Industries
Training&Education
Partnership
DeveloperCenter
Activity
LinesofBusiness
UniversityAlliances
Events&Webinars
Innovation
Browse
Communications
Actions
Create
ProcessIntegration(PI)&SOAMiddleware
IntegratingSchedulerSoftwarewithSAPPI
PostedbyDeepakShahinProcessIntegration(PI)&SOAMiddlewareonAug20,20121:27:37PM
Share
Tweet
Like 3
ThisblogdescribesasolutiontointegratefileschedulerwithSAPPI.Largeenterprisesmostlyuse
schedulingsoftware(Fore.g.ControlM)forschedulingtheirfileinterfaces(bothInbound&OutboundFileinterfaces).
JobofthefileschedulerincaseofoutboundfileinterfaceistofetchthefilefromlegacysystemsandplaceitontoPI
applicationserverfromwherePIfilechannelwillpickupthefiletotriggermessageprocessing.Incaseofinbound
interface, once the file has been created on target folder, scheduler will move the file from PI application server to
legacysystem.ThesolutionisbasedontheideaofgeneratingstatusfilesonPIApplicationserverwithappropriate
namesatseveralstagesofmessagelifecycle.Thesestatusfileswillinturnnotifythefilescheduleraboutthestatusof
theinterfaceatappropriatestage.WecanhaveadesignatedmonitoringfolderonPIapplicationserverwhereinthese
statusfilesarecreated.Fileschedulerwillinturnmonitorthisfolderforthestatusfilesandupdatethejobsaccordingly.
Requirement: File scheduler software is used for controlling (start/stop of channels) the file interfaces. So the
scheduler wanted to know the status of the message in PI and ECC system so that it can update its Batch jobs
accordingly.Sowehadtogeneratethesestatusfiles(withfixedfilenameformat)soastolettheschedulerknowthe
statusofmessagesineachsystem.
ApproachforINBOUND&OUTBOUNDfilebasedinterfaces:
A.OutboundFileInterfaces:
1.ForOutboundcases,FileschedulerwillmovethefilefromanylegacysystemtoPIapplicationserverdesignated
folder.PIwilldosubsequentprocessingtoputthedatainECCsystem(viaproxy).
2.OncethefileisavailableinapplicationfolderschedulerwillstartthePIchannelandwhenfiledisappears,stop
PIchannelwhenfiledisappearstoconfirmPIchannelpickedupthefile.
3.Oncethefiledisappears,schedulethe2ndfilewatchertopollforthestatusfiles.Statusescanbedefinedbased
onfilenames.
4.IfprocessingfailsinPIthenPIFAILfilewillbecreatedonPIapplicationserverandtheJobswillendatthispoint.
5.IfDataispassedfromPItoECCsystemsuccessfully,howeverfailsinBackendsystemthenECCFAILfilewillbe
createdonPIapplicationserver.
6.IfmessageisprocessedsuccessfullyinbackendsystemthenECCOKfilewillbecreated.
B.InboundFileInterfaces:
1.ForInboundcases,SchedulethebackendjobthatwillsenddatatoSAPPI.
2.On receiving completion confirmation of batch job in ECC system, schedule a file watcher for the
designatedfileindesignatedfolder.
3.IftheFilehasbeencreatedsuccessfullyinappropriatefolder,thenschedulerwillsendthefileaheadto
legacysystem.
4.AdditionallyECCOK file will be created on PI Application server which in turn notifies scheduler about
thefilecreation.
5.IfprocessingfailsinPIthenPIFAILfilewillbecreatedonPIapplicationserverandtheJobswillendat
thispoint.
ImplementationScenarios:
1.InordertogenerateECCOKfileforfileinboundscenarios,wemakeuseofOperatingsystemcommandsoptionthat
isavailableinreceiverfilecommunicationchannels.Inthiscaseoncethemessageprocessingiscompleted(Fileis
generatedinthetargetfolder),thenECCOKfilewillbecreatedusingtheShellscriptasshownbelow.Inthiscasea
dummyfileisplacedinappropriatefolderandassoonasmessagehasbeenprocessedsuccessfully,dummyfileis
copiedtocreateECCOKfileusingcopycommandintheshellscript.Usefollowingcommandin"RunOperating
SystemCommandAfterMessageProcessing"inreceivercommunicationchannel:
sh<Path/Scriptname.sh><Path/Sourcefilename><path/destinationFileName>
http://scn.sap.com/community/piandsoamiddleware/blog/2012/08/20/integratingfileschedulerwithsappi
1/7
9/29/2016
IntegratingSchedulerSoftwarewithSAPPI|SCN
AnExampleforcommandlinecanbe:sh/In/CopyScript.sh/In/Dummy.txt/In/ECC
TheshellscriptcodetogenerateECCOKfileisasgivenbelow.Exampleofthefilenamegeneratedusingabove
scriptisECC_120718_OK
2.Incaseoutboundfileinterface,oncethefileispickedup,thedatacanbesenttoECCsystemviaserver
proxy.WithinserverproxyafunctionmodulecanbecalledforpostingthedataintoECCsystem.Soifthe
functionmodulehassuccessfullyupdatedtheDatainthenECCOKfilecanbegeneratedonapplication
server.Ifdataisnotpostedsuccessfullythenfunctionmodulecanreturnappropriatereturncodestogenerate
ECCFAILfile.Samplecodeforimplementingabovescenarioisasshownbelow:
DATA:filenameTYPEstring.
CALLFUNCTION'Z_FXNMODULE'
EXPORTING
x_input=input
EXCEPTIONS
data_error=1.
IFsysubrcEQ'1'.
filename='/In/ECC'."Filenamealongwithfilepath.
CONCATENATEfilename'_'sydatumsyuzeit'_FAIL'INTOfilename.
OPENDATASETfilenameFOROUTPUTINTEXTMODEENCODINGDEFAULT.
CLOSEDATASETfilename.
ELSEIFsysubrcISINITIAL.
filename='/In/ECC'."Filenamealongwithfilepath.
CONCATENATEfilename'_'sydatumsyuzeit'_OK'INTOfilename.
OPENDATASETfilenameFOROUTPUTINTEXTMODEENCODINGDEFAULT.
CLOSEDATASETfilename.
ENDIF.
3.InordertogeneratePIFAILfile,wecanimplementBADIALERT_EXITinSAPPISystem.StandardAlert
Managementonlyallowsnotifyingaparticularrecipientregardingfailureoftheinterfaceviaemails.Itdoesnot
generateanystatusfilesthatwillnotifyfileschedulerabouttheinterfacefailure.Soinordertogeneratestatus
filesfromAlertswewillimplementBADIALERT_EXITandusemethodMODIFY_LONG_TEXTtogenerate
statusfiles.StepstoimplementBADIarementionedbelow.
BADIImplementation:
InordertogeneratestatusfilesBADIALERT_EXITisimplementedinPIserverwithnamesayZALERT_EXIT.This
BADIiscalledeverytimeanalertisraisedinsystem.ThisBADIimplementationusesAlertCategoryasafiltersothat
theBADIiscalledforconfiguredalertcategoryonly.InthiscasecategoryCUSTOMALERTSisused.
1.GotoTcodeSE18toviewBADIALERT_EXIT:AshighlightedbelowwewillutilizemethodMODIFY_LONG_TEXT
togeneratestatusfilesfromthealerts.
http://scn.sap.com/community/piandsoamiddleware/blog/2012/08/20/integratingfileschedulerwithsappi
2/7
9/29/2016
IntegratingSchedulerSoftwarewithSAPPI|SCN
2.GotoMenu>Implementation>createtocreatenewimplementationforBADIALERT_EXIT
3.GiveappropriateImplementationname.Providealertcategorytobeusedasfilterasshownbelow:
4.ClickonInterfacetabandthendoubleclickonMODIFY_LONG_TEXTtoaddappropriateABAPcodeto
generatestatusfiles:
http://scn.sap.com/community/piandsoamiddleware/blog/2012/08/20/integratingfileschedulerwithsappi
3/7
9/29/2016
IntegratingSchedulerSoftwarewithSAPPI|SCN
5.FollowingistheABAPCODElogicofMethodMODIFY_LONG_TEXT:
Theentirealertlongtextispassedinthismethodasinputparameter.ThislongtextismaintainedinAlertCategory
withallrequiredcontainerelements.
InthelogictwomainelementsareusedSXMS_RULE_NAMEandSXMS_ERROR_CODE.
SXMS_RULE_NAMEisthedescriptionofAlertRulewemaintainforeachinterface.Afixedpatternwasdecidedfor
thisdescriptionsothatwecanderiveinterfaceBusinessAreaandInterfaceIdfromit.
SXMS_ERROR_CODEisthecodeoftheerrorandbasedonthiserrorcodewedecidewhatexactistheerrorand
whatshouldbethestatusfilename.
OnlysampleABAPcodeforgenerating'PIFAIL'fileisprovidedbelow.ThecompleteABAPcodedevelopedforour
implementationisoutofscopeofthisblog.
DATA:filenameTYPEstring.
filename='/In/PIFAIL'."Filenameconsistoffilepathandactualfilename
CONCATENATEfilename'_'sydatumINTOfilename.
OPENDATASETfilenameFOROUTPUTINTEXTMODEENCODINGDEFAULT.
CLOSEDATASETfilename.
AlertConfiguration:
WehavecreatedalertcategoryCUSTOMALERTS,whichwillbeusedasfilterwhileimplementingBADI
ALERT_EXITasshownabove.
Containervariableusedareasfollows:
http://scn.sap.com/community/piandsoamiddleware/blog/2012/08/20/integratingfileschedulerwithsappi
4/7
9/29/2016
IntegratingSchedulerSoftwarewithSAPPI|SCN
AlertMessagetitle&Shorttextis:
Longtextforalertis:
Erroroccuredwhileinterfaceexecution
Detailsoferror:
Messageidforerrormessageis:&SXMS_MSG_GUID&
Sendersystemis:&SXMS_FROM_SERVICE&
Senderinterfaceis:&SXMS_FROM_INTERFACE&
Receiversystemis:&SXMS_TO_SERVICE&
Errortextis:&SXMS_TO_ADAPTER_ERRLINES[]&
TechnicalInformation:
AlertRuleis:&SXMS_RULE_NAME&
ErrorCodeis:&SXMS_ERROR_CODE&
Pointstobeconsidered:
1.ThisapproachistestedwithControlMscheduleronly.Perhapsthedesignmightneedtobeenhancedabitto
makeitworkwithotherschedulers.
2.ThisapproachwasonlyconsideredforFILEadapter.Howeveranyasynchronousadaptershouldworkfinewith
thisapproach.ForSynchronousscenarioyouneednottohavethismechanism.
3.AlertUserIDusedtoraisealertsmusthaveS_DATASETauthorityobjectandwritepermissiontocreatestatus
filesinthedesignatedfolder.
4.ThisapproachistestedinSAPPI7.11system.HoweverthisapproachwillalsoworkforDUALstackSAPPI7.3
asAlertframeworkstillexistswithinABAPstackin7.3.
http://scn.sap.com/community/piandsoamiddleware/blog/2012/08/20/integratingfileschedulerwithsappi
5/7
9/29/2016
2955Views
IntegratingSchedulerSoftwarewithSAPPI|SCN
Categories:ProcessIntegration
AverageUserRating
Topics:process_integration
MyRating:
(13ratings)
Share
Tweet
Like 3
6Comments
SravyaTalankiMar20,20131:01PM
IthinkIammissingthepointhere.WhyshouldyoucreatestatusfilesinthePIforthefileinterface
whichisanadditionaloverheadandcomplexitytothedesign?Whyshouldyoubothertoevensend
fileviaanRFCorproxy?IamsorrybutIprobablydidntunderstandwhyinterfacehastobedesigned
thatway:(
Youcanconfigurestandardalertframeworktoraisealertsforeachpointoffailure.
Like(1)
DeepakShahMay2,20132:44PM(inresponsetoSravyaTalanki)
HiSravya,
Ourclientwasusingfileschedulersoftwareforcontrolling(start/stopofchannels)thesefile
interfaces.SotheschedulerwantedtoknowthestatusofthemessageinPIandECC
systemsothatitcanupdateitsBatchjobsaccordinglytoletthemknowifthemessagewas
successfulatalllevels.
Byusingstandardalertsitwasnotpossibletosendthesestatusbacktothescheduler
software.Sowehadtogeneratethesestatusfilessoastolettheschedulerknowthestatus
ofmessages.
Like(0)
SravyaTalankiMay2,20135:45PM(inresponsetoDeepakShah)
WithnewreleasesofSAPPI,Wecanschedulethecommunicationchannelsvia
RWB?
Iamabitconfusedandprobablydidntunderstandwhyanyonewanttotrackeach
stepofthemessagetransmissonwhenthemessagehadbeenprocessed
successfully.Thebusinessalwaysexpectsanalertwhensomethingfailedbutnot
whensomethinghadbeenprocessedsuccessfully?Whatisthebenefittothe
business?
Whatifshellscriptsfail?Igenerallytendtokeeptheinterfacedesignsimpleto
decreasethemaintenancecosts.Isn'titanadditionaloverheadtogenerate
additonalstatusfileandovercomplicatingtheinterfacedesign?
Amimissingtheobviouspoint?
Like(1)
KevinWilsonMay2,20134:23PM
IfounditquiteinformativeKeeponsharing.thanks
Like(0)
MadhumitaDeySep27,201610:48AM
HelpfulandhandyforusspeciallywhoworkonABAPandPIinterfacesmanyatimes.
Like(0)
adityadhurandharSep28,201611:07AM
Averyniceinformativeblog!!!
Like(0)
http://scn.sap.com/community/piandsoamiddleware/blog/2012/08/20/integratingfileschedulerwithsappi
6/7
9/29/2016
SiteIndex
Privacy
IntegratingSchedulerSoftwarewithSAPPI|SCN
ContactUs
TermsofUse
SAPHelpPortal
LegalDisclosure
Copyright
http://scn.sap.com/community/piandsoamiddleware/blog/2012/08/20/integratingfileschedulerwithsappi
FollowSCN
7/7