Skip to Content
avatar image
Former Member

Automatic screenshot attachement in Create support message

Dear Experts,

We have a requirement to include a screenshot of the current screen whenever the user uses the option Help --> Create support message.

To do so I created an implementation for BADI SBCOS001 and included the below code in method PREPARE_FEEDBACK_BO:

DATA: LV_MIME TYPE STRING,
LV_DATA TYPE XSTRING, 
LT_CONTENT_BIN TYPE STANDARD TABLE OF SDOKCNTBIN,
LEN TYPE I. DATA LT_SOLIX TYPE SOLIX_TAB. 
DATA LS_SOLIX TYPE SOLIX. 
DATA LV_LEN TYPE SO_OBJ_LEN. 
DATA CP TYPE CPCODEPAGE. 

CP = '4110'. 

CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_SCREENSHOT 
IMPORTING 
MIME_TYPE_STR = LV_MIME 
IMAGE = LV_DATA. 

TRY. 
CALL METHOD CL_BCS_CONVERT=>XSTRING_TO_STRING 
EXPORTING IV_XSTR = LV_DATA 
IV_CP = CP 
RECEIVING 
RV_STRING = AT_DATA. 
CATCH CX_BCS . 
ENDTRY. 

AT_DESCR = 'Error.png'. 
AT_FILET = 'PNG'. 
AT_FILEN = 'ERROR_ATTACHEMENT.png'.

The attachment is created but failed to be opened when downloaded.

Your support will be highly appreciated

Thanks and Regards

Sara Kadry

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers