Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata
Error rendering macro 'code': Invalid value specified for parameter 'lang'
*&---------------------------------------------------------------------*
*& Report  YKC_ALV_OOPS_LOGO_DISPALY
*& Programmer : Krishna Chauhan
*& Dt:          18 Dec 08
*&---------------------------------------------------------------------*
*&This prog will display LOGO
*&
*&---------------------------------------------------------------------*
REPORT  YKC_ALV_OOPS_LOGO_DISPALY.
TYPE-POOLS CNDP.
*----declaration for logo display custom container
DATA  URL(132).
* custom container
DATA PIC_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
* picture Control.
DATA PICTURE TYPE REF TO CL_GUI_PICTURE.
* Definition of Control Framework
CLASS CL_GUI_CFW DEFINITION LOAD.
CALL SCREEN 100.
*ENDFORM.                    " field_catalog
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
* create the custom container
  CREATE OBJECT PIC_CONTAINER
                EXPORTING CONTAINER_NAME = 'CUSTOM'. "name given in screen container
* create the picture control
* create the picture control
  CREATE OBJECT PICTURE
                EXPORTING PARENT = PIC_CONTAINER.
* Request an URL from the data provider by exporting the pic_data.
  CLEAR URL.
  PERFORM LOAD_PIC_FROM_DB CHANGING URL.
* load picture
  CALL METHOD PICTURE->LOAD_PICTURE_FROM_URL
    EXPORTING
      URL = URL.
*    init = 'X'.
  CALL METHOD CL_GUI_CFW=>FLUSH
    EXCEPTIONS
      CNTL_SYSTEM_ERROR = 1
      CNTL_ERROR        = 2.
  IF SY-SUBRC <> 0.
* error handling
  ENDIF.
ENDMODULE.                 " exit  INPUT
*&---------------------------------------------------------------------*
*&      Form  LOAD_PIC_FROM_DB
*&---------------------------------------------------------------------*
*       text : loading logo
*----------------------------------------------------------------------*
FORM LOAD_PIC_FROM_DB  CHANGING P_URL.
  DATA QUERY_TABLE LIKE W3QUERY OCCURS 1 WITH HEADER LINE.
  DATA HTML_TABLE LIKE W3HTML OCCURS 1.
  DATA RETURN_CODE LIKE  W3PARAM-RET_CODE.
  DATA CONTENT_TYPE LIKE  W3PARAM-CONT_TYPE.
  DATA CONTENT_LENGTH LIKE  W3PARAM-CONT_LEN.
  DATA PIC_DATA LIKE W3MIME OCCURS 0.
  DATA PIC_SIZE TYPE I.
  REFRESH QUERY_TABLE.
  QUERY_TABLE-NAME = '_OBJECT_ID'.
  QUERY_TABLE-VALUE = 'ENJOYSAP_LOGO'."name of logo
  APPEND QUERY_TABLE.
  CALL FUNCTION 'WWW_GET_MIME_OBJECT'
    TABLES
      QUERY_STRING        = QUERY_TABLE
      HTML                = HTML_TABLE
      MIME                = PIC_DATA
    CHANGING
      RETURN_CODE         = RETURN_CODE
      CONTENT_TYPE        = CONTENT_TYPE
      CONTENT_LENGTH      = CONTENT_LENGTH
    EXCEPTIONS
      OBJECT_NOT_FOUND    = 1
      PARAMETER_NOT_FOUND = 2
      OTHERS              = 3.
  IF SY-SUBRC = 0.
    PIC_SIZE = CONTENT_LENGTH.
  ENDIF.
  CALL FUNCTION 'DP_CREATE_URL'
    EXPORTING
      TYPE     = 'image'
      SUBTYPE  = CNDP_SAP_TAB_UNKNOWN
      SIZE     = PIC_SIZE
      LIFETIME = CNDP_LIFETIME_TRANSACTION
    TABLES
      DATA     = PIC_DATA
    CHANGING
      URL      = URL
    EXCEPTIONS
      OTHERS   = 1.
ENDFORM.                    " LOAD_PIC_FROM_DB