Register Login

How to take Screen shot using Abap program

Updated May 18, 2018

Hi ALL,

I am new to Abap program and my requriement is to call tcode and than take screen shot of the screen and save to desktop using ABAP Program.I am not able to create screen shot .Please help me on this.

 

  Report Z_STMS_COPY.

Data:OK_CODE TYPE SY-UCOMM.
Data:lv_mime Type string.
Data:lv_data Type xstring.
DATA: BEGIN OF graphic_table OCCURS 0,
        line(255) TYPE x,
      END OF graphic_table.

DATA: graphic_size TYPE i.
DATA: graphic_url(255).

DATA: l_graphic_conv TYPE i,
      l_graphic_offs TYPE i.

DATA: lo_picture TYPE REF TO cl_gui_picture,
      lo_container TYPE REF TO cl_gui_docking_container.
data lv_result type i.
CASE OK_CODE.
  When 'WBOC'.
 CALL FUNCTION 'TMS_UI_TRANS_PATH_OVERVIEW'.
ENDCASE.
AT SELECTION-SCREEN OUTPUT.

    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_SCREENSHOT
      IMPORTING
        MIME_TYPE_STR        = lv_mime
        IMAGE                = lv_data.

      graphic_size = XSTRLEN( lv_data ).
      CHECK graphic_size > 0.
Data:lt_doc_content type solix_tab.

call method cl_bcs_convert=>xstring_to_solix
EXPORTING
  iv_xstring = lv_data
RECEIVING
et_solix = lt_doc_content.


×