Taking SAP GUI Screenshot Automatically and Sen..

3
Getting Started Newsletters Store Products Services & Support About SCN Downloads Industries Training & Education Partnership Developer Center Lines of Business University Alliances Events & Webinars Innovation Log On Join Us Hi, Guest Search the Community Activity Communications Actions Browse 0 Tweet created by Aruna Kumara K on Mar 4, 2014 12:01 PM, last modified by Aruna Kumara K on May 5, 2014 7:20 AM This document explains how screen shot of SAP GUI screen can be taken and sends it as mail attachment by ABAP program. Requirement: Taking screenshot of GUI screen like shown below and send it as mail attachments through ABAP.(Note I have enhanced std demo program GRAPHICS_GUI_CE_DEMO to demonstrate screen shot feature ). Approach Use front end GUI service class to take screenshot – Method GET_SCREENSHOT of CL_GUI_FRONTEND_SERVICES. When you called this method, system will take screenshot of active screen and return screenshot data intern of hexadecimal values (xstring). As shown in above code, screenshot data is imported by image parameter. Convert xstring data into binary data to send it as attachment – Use method Taking SAP GUI screenshot automatically and send as attachment through mail programmatically Version 3

description

Taking SAP GUI Screenshot Automatically and Sen..

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.