Documente Academic
Documente Profesional
Documente Cultură
ValidationsforESSLeaverequestERPHumanCapitalManagementSCNWiki
GettingStarted Newsletters
Welcome,Guest
Login
Register
Store
SearchtheCommunity
Products
Services&Support
AboutSCN
Downloads
Industries
Training&Education
Partnership
DeveloperCenter
LinesofBusiness
UniversityAlliances
Events&Webinars
Innovation
ERPHumanCapitalManagement / / PTonESS
ValidationsforESSLeaverequest
CreatedbyAshutoshGulkhobre,lastmodifiedbyMarcioLeonionJun04,2009
Scenario:
Generallyanorganisationhas45typesofleaves.CasualLeave,AnnualorPriviledgeleave,SickLeave,MaternityLeaveetc.Ihavecomeacrossarequirementtoimplementvalidationsbeforeapplying
leave.Foreg:MaleemployeescannotapplyforMaternityleaveorYoucannottake3daysconsecutiveCasualLeave.ImplementingthesevalidationsanddisplayinganerrormessageonESS(
WebDynprobased)isaverycommonrequirement.Letsseehowtogoaboutitinthisblog.
Guidelines:
1.UseBADI:PT_ABS_REQ.
ABADIisdeliveredbySAPtocontrolleaveprocessing.Definition:PT_ABS_REQ.
CreateanimplementationforthisBADI.Standardimplementationisdelivered:ImplementationNameCL_PT_ARQ_REQ.InEcc5(ERP2004)system,itsaBADIImplementationCL_PT_ARQ_REQandin
ECC6systemitsanEnhancementimplementation.WewilldiscussaboutEnhancementImplementationhere.
YoucancopytheimplementationCL_PT_ARQ_REQandtheimplementingclass.Addyournewimplementingclasstothenewlycopiedimplementation.Unchecktheoptionimplementationisactiveinthe
originalBADIimplementation(CL_PT_ARQ_REQ)intheRuntimeBehavioroftheEnh.ImplementationElements.Youwilladdyourcodeinthisimplementingclass.ReferenceInterfaceforthisclassis"
IF_EX_PT_ABS_REQ".Aftercopyingimplementationandtheclass,youarenowreadytoaddvalidations.
2.Methodsinimplementingclass.
Theimplementingclasshasamethod"SIMULATE_VIA_BLOP".Addvalidationcodeinthismethod.ReadtheIM_ATTABS_TABdeepstructuretogetthecurrentabsencedetails.Youcanvalidateyourrules
dependingonthecurrentabsencerecord.CurrentabsencerecordwillgiveyouPernr,Leavetype,Datesappliedfor,Time,Approveretc.LetssayweareimplementingaCheckforMaternityleave.We
knowPernrandLeavetypeapplied.FromPernrwecanfindoutthegenderandcheckagainsttheleavetype.IftheemployeeismalethenwewanttodisplayappropriateerrormessageonESSscreen.
3.HowtodisplayanerrormessageonESSleaverequest.
Thisisthemostimportantpart.Createamessageclassusingse91andaddanerrormessagetoit.ThenusefollowingmethodtodisplaythismessageonESS.
CALLMETHODMESSAGE_HANDLER>ADD_MESSAGE
EXPORTING
IM_TYPE='E'"TypeofMessage
IM_CL='XXX'"Messageclassthatyoucreated
IM_NUMBER='XXX'"Messageno
IM_PAR1='SIMULATE_VIA_BLOP'
IM_PAR2='IF_EX_PT_ABS_REQ~SIMULATE_VIA_BLOP'"Methodnameasinyourimpl.
IM_PAR3='BLOP'
IM_CONTEXT=''
IM_SUBCONTEXT=''
IM_CLASSNAME='CL_PT_ARQ_BLOP_ADAPTER'
IM_METHODNAME='MESSAGE'.
ThismethodwillraiseanerrormessageonESSleaverequest(WebDynprobased).
NowmanywillarguethatthereareBADIslikeHRPAD00INFTYanduserexitsthatcanbeusedforthissametask.ButproblemwiththeseBADIsisyoucannotdisplayanerrormessageonESSscreen.
YoucandisplayanerrormessageinR/3(forPA30).
ThegoodolduserexitsdonotworkonWDbasedESSanymore.YouhavetoreplicatethevalidationsinthisleavespecificBADIanduseMETHODMESSAGE_HANDLER>ADD_MESSAGEtodisplay
erroronESSscreenandrestictusers.
Nolabels
1Comment
https://wiki.scn.sap.com/wiki/display/ERPHCM/Validations+for+ESS+Leave+request
1/2
5/20/2016
ValidationsforESSLeaverequestERPHumanCapitalManagementSCNWiki
BhaskarTripathi
Hello,
Forusingmessagehandlingfunctionality,dowehavetocopythestandardimplementationofPT_ABS_REQ?Oristhereanyotherwaywecanaddmessage?
ActuallyBADIinterfacedoesn'thaveanythingrelatedtomessagehandling.SoIamabitconfusedhowtheerrorswouldberoutedtoESSscreen.
BestRegards!
Bhaskar
ContactUs
Privacy
SAPHelpPortal
TermsofUse
LegalDisclosure
Copyright
https://wiki.scn.sap.com/wiki/display/ERPHCM/Validations+for+ESS+Leave+request
FollowSCN
2/2