0% found this document useful (0 votes)
448 views3 pages

Taking SAP GUI Screenshot Automatically and Sen..

This document explains how to take a screenshot of the SAP GUI screen and send it as an email attachment using ABAP. It describes using the CL_GUI_FRONTEND_SERVICES class to take a screenshot and get the screenshot data as a hexadecimal string. It then shows how to convert the hexadecimal string to binary data and add it as an attachment to an email sent using the CL_BCS class. The code sample demonstrates capturing a screenshot, converting it to binary, and attaching it to an email that is then sent programmatically through ABAP.

Uploaded by

nlpatel22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
448 views3 pages

Taking SAP GUI Screenshot Automatically and Sen..

This document explains how to take a screenshot of the SAP GUI screen and send it as an email attachment using ABAP. It describes using the CL_GUI_FRONTEND_SERVICES class to take a screenshot and get the screenshot data as a hexadecimal string. It then shows how to convert the hexadecimal string to binary data and add it as an attachment to an email sent using the CL_BCS class. The code sample demonstrates capturing a screenshot, converting it to binary, and attaching it to an email that is then sent programmatically through ABAP.

Uploaded by

nlpatel22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

7/3/2015

TakingSAPGUIscreenshotautomaticallyandsen...|SCN

GettingStarted Newsletters

Hi,Guest

LogOn

JoinUs

Store

SearchtheCommunity

Products

Services&Support

AboutSCN

Downloads

Industries

Training&Education

Partnership

DeveloperCenter

Activity

LinesofBusiness

UniversityAlliances

Events&Webinars

Innovation

Browse

TakingSAPGUIscreenshotautomatically
andsendasattachmentthroughmail
programmatically

Communications

Actions

Version3

createdbyArunaKumaraKonMar4,201412:01PM,lastmodifiedbyArunaKumaraKonMay5,20147:20AM

Tweet

ThisdocumentexplainshowscreenshotofSAPGUIscreencanbetakenandsendsitas
mailattachmentbyABAPprogram.
Requirement:TakingscreenshotofGUIscreenlikeshownbelowandsenditasmail
attachmentsthroughABAP.(NoteIhaveenhancedstddemoprogram
GRAPHICS_GUI_CE_DEMOtodemonstratescreenshotfeature).

Approach
UsefrontendGUIserviceclasstotakescreenshotMethodGET_SCREENSHOT
ofCL_GUI_FRONTEND_SERVICES.
Whenyoucalledthismethod,systemwilltakescreenshotofactivescreenand
returnscreenshotdatainternof
hexadecimalvalues(xstring).

Asshowninabovecode,screenshotdataisimportedbyimageparameter.
ConvertxstringdataintobinarydatatosenditasattachmentUsemethod
http://scn.sap.com/docs/DOC52966

1/5

7/3/2015

TakingSAPGUIscreenshotautomaticallyandsen...|SCN

XSTRING_TO_SOLIXofclassCL_BCS_CONVERT

LT_DOC_CONTENTcontainsbinarydatawhichwillbeusedlatertosendas
attachmentinmail.

SendscreenshotasmailattachmentUseclassCL_BCStosendmailwith
attachment.
a)CreatepersistentobjectoftypeCL_BCSforamailsendrequest

b)CreateMaildocumenttoincludebody,attachmentetc.Maildocumenttype
CL_DOCUMENT_BCS

AbovecodeMailsubjectasProjectStatusInfo.MailbodycanbeinI_TEXT
parameter.ForthisexampleInotused
anymailcontent.
c)Addscreenshotasanattachmenttomaildocument.screenshotcanbePNG,
BMP,GIF,JPGetc.Notewhateverthe
screenshotdatatakeninpreviousstep1and2attachedasdocumenthere

BinarycontentofscreenshotdataLT_DOC_CONTENTwhichpreparedinstep1
andstep2
passedtoI_ATT_CONTENT_HEX.
d)Attachmaildocumentobjecttosendrequest.

http://scn.sap.com/docs/DOC52966

2/5

7/3/2015

TakingSAPGUIscreenshotautomaticallyandsen...|SCN

e)Attachsenderandrecipientaddress.Addsender,TO,CC,BCaddresstosend
request.

f)SendMailCallsendmethodtosendmailwithattachment

Result:
Whenuserclickonscreenshotbuttonthensystemtakesscreenshotandsenditasemail
attachment.

http://scn.sap.com/docs/DOC52966

3/5

You might also like