首页 > 其他 > 详细

获取照片信息

时间:2019-03-19 23:25:29      阅读:149      评论:0      收藏:0      [点我收藏+]
MODULE DISPLAY_PICTURE OUTPUT.
  DATA: REPID LIKE SY-REPID.
  DATA:L_RESULT TYPE I.
  REPID = SY-REPID.

  IF PICTURE IS INITIAL.                                    "TC_0100
    CREATE OBJECT WCL_CONTAINER_PHOTO
      EXPORTING
        CONTAINER_NAME = TC_0300.
*Object To Create the Custom Container
    CREATE OBJECT PICTURE
      EXPORTING
        PARENT = WCL_CONTAINER_PHOTO.
    CHECK SY-SUBRC = 0.
*Method To Set Position of Image
*    CALL METHOD PICTURE->SET_POSITION
*      EXPORTING
*        HEIGHT = 47
*        LEFT   = 610
*        TOP    = 25
*        WIDTH  = 70.
  ELSE.
*Function Module To Reset Image
    CALL FUNCTION HR_IMAGE_RESET
      EXPORTING
        HANDLE         = HANDLE
      EXCEPTIONS
        INVALID_HANDLE = 1
        OTHERS         = 2.
    IF SY-SUBRC <> 0.
    ENDIF.
  ENDIF.

  CLEAR:P_CONNECT_INFO,P_CONNECT_INFO[],URL.
*FUNCTION MODULE TO CHECK EXISTANCE OF IMAGE
  CALL FUNCTION HR_IMAGE_EXISTS
    EXPORTING
      P_PERNR        = <PERNR_PHOTO>
    IMPORTING
      P_CONNECT_INFO = P_CONNECT_INFO
    EXCEPTIONS
      OTHERS         = 2.
  P_DOCUMENT_TYPE = P_CONNECT_INFO-RESERVE.
*Function Module To Get the URL of Image
  CALL FUNCTION SCMS_DOC_URL_READ
    EXPORTING
      STOR_CAT    = SPACE
      CREP_ID     = P_CONNECT_INFO-ARCHIV_ID
      DOC_ID      = P_CONNECT_INFO-ARC_DOC_ID
      COMP_ID     = DATA
      DP_URL_ONLY = X
    IMPORTING
      URL         = URL
    EXCEPTIONS
      OTHERS      = 10.
  IF SY-SUBRC <> 0.
  ENDIF.
*Method To Set Display Mode Fit to Container
  CALL METHOD PICTURE->SET_DISPLAY_MODE
    EXPORTING
      DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_FIT.
*Method To load Image from URL
  CALL METHOD PICTURE->LOAD_PICTURE_FROM_URL_ASYNC
    EXPORTING
      URL = URL.

ENDMODULE.

 

获取照片信息

原文:https://www.cnblogs.com/ckstock/p/10562118.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!