Taking SAP GUI Screenshot Automatically and Sen..
description
Transcript of Taking SAP GUI Screenshot Automatically and Sen..
7/3/2015 TakingSAPGUIscreenshotautomaticallyandsen...|SCNhttp://scn.sap.com/docs/DOC52966 1/5GettingStarted Newsletters StoreProducts Services&Support AboutSCN DownloadsIndustries Training&Education Partnership DeveloperCenterLinesofBusiness UniversityAlliances Events&Webinars InnovationLogOn JoinUs Hi,Guest SearchtheCommunityActivity Communications ActionsBrowse0TweetcreatedbyArunaKumaraKonMar4,201412:01PM,lastmodifiedbyArunaKumaraKonMay5,20147:20AMThisdocumentexplainshowscreenshotofSAPGUIscreencanbetakenandsendsitasmailattachmentbyABAPprogram.Requirement:TakingscreenshotofGUIscreenlikeshownbelowandsenditasmailattachmentsthroughABAP.(NoteIhaveenhancedstddemoprogramGRAPHICS_GUI_CE_DEMOtodemonstratescreenshotfeature).ApproachUsefrontendGUIserviceclasstotakescreenshotMethodGET_SCREENSHOTofCL_GUI_FRONTEND_SERVICES.Whenyoucalledthismethod,systemwilltakescreenshotofactivescreenandreturnscreenshotdatainternofhexadecimalvalues(xstring).Asshowninabovecode,screenshotdataisimportedbyimageparameter.ConvertxstringdataintobinarydatatosenditasattachmentUsemethodTakingSAPGUIscreenshotautomaticallyandsendasattachmentthroughmailprogrammaticallyVersion37/3/2015 TakingSAPGUIscreenshotautomaticallyandsen...|SCNhttp://scn.sap.com/docs/DOC52966 2/5XSTRING_TO_SOLIXofclassCL_BCS_CONVERTLT_DOC_CONTENTcontainsbinarydatawhichwillbeusedlatertosendasattachmentinmail.SendscreenshotasmailattachmentUseclassCL_BCStosendmailwithattachment.a)CreatepersistentobjectoftypeCL_BCSforamailsendrequestb)CreateMaildocumenttoincludebody,attachmentetc.MaildocumenttypeCL_DOCUMENT_BCSAbovecodeMailsubjectasProjectStatusInfo.MailbodycanbeinI_TEXTparameter.ForthisexampleInotusedanymailcontent.c)Addscreenshotasanattachmenttomaildocument.screenshotcanbePNG,BMP,GIF,JPGetc.Notewhateverthescreenshotdatatakeninpreviousstep1and2attachedasdocumenthereBinarycontentofscreenshotdataLT_DOC_CONTENTwhichpreparedinstep1andstep2passedtoI_ATT_CONTENT_HEX.d)Attachmaildocumentobjecttosendrequest.7/3/2015 TakingSAPGUIscreenshotautomaticallyandsen...|SCNhttp://scn.sap.com/docs/DOC52966 3/5e)Attachsenderandrecipientaddress.Addsender,TO,CC,BCaddresstosendrequest.f)SendMailCallsendmethodtosendmailwithattachmentResult:Whenuserclickonscreenshotbuttonthensystemtakesscreenshotandsenditasemailattachment.