SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Demo: Easy Splitter Container



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Sun Nov 04, 2007 8:18 pm    Post subject: Demo: Easy Splitter Container Reply with quote

Code:
*&---------------------------------------------------------------------*
*& Report  RSDEMO_EASY_SPLITTER_CONTROL                                *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*

REPORT  rsdemo_easy_splitter_control         .

* splitter control
DATA splitter TYPE REF TO cl_gui_easy_splitter_container.
* container for the splitter control
DATA container TYPE REF TO cl_gui_custom_container.
* containers created by the splitter control
DATA container_1 TYPE REF TO cl_gui_container.
DATA container_2 TYPE REF TO cl_gui_container.
* picture controls
DATA picture_1 TYPE REF TO cl_gui_picture.
DATA picture_2 TYPE REF TO cl_gui_picture.
* load control framework definition
TYPE-POOLS cndp.

DATA  init.
DATA ok_code TYPE sy-ucomm.

CALL SCREEN 100.

*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'STATUS'.
  IF init is initial.
* create a container for the splitter control
    CREATE OBJECT container
                  EXPORTING container_name = 'CUSTOM'.
* create the splitter control
    CREATE OBJECT splitter
                  EXPORTING parent = container
                            orientation    = 1.
* get the containers of the splitter control
    container_1 = splitter->top_left_container.
    container_2 = splitter->bottom_right_container.
* create the picture controls inside the containers of the splitter
    CREATE OBJECT picture_1
                  EXPORTING parent  = container_1.

    CREATE OBJECT picture_2
                  EXPORTING parent  = container_2.
* Request an URL from the data provider by exporting the pic_data.
    DATA url(255).
    CLEAR url.
    PERFORM load_pic_from_db CHANGING url.

* load picture
    CALL METHOD picture_1->load_picture_from_url
        EXPORTING url = url.

    CALL METHOD picture_2->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.
  ENDIF.
ENDMODULE.                             " STATUS_0100  OUTPUT

*&---------------------------------------------------------------------*
*&      Module  EXIT  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE exit INPUT.
  CALL METHOD container->free.
  LEAVE PROGRAM.
ENDMODULE.                             " EXIT  INPUT

*&---------------------------------------------------------------------*
*&      Form  LOAD_PIC_FROM_DB
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
FORM load_pic_from_db CHANGING 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'.
  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


****************************************************************
* This file was generated by Direct Download Enterprise. *
* Please do not change it manually. *
****************************************************************
%_DYNPRO
RSDEMO_EASY_SPLITTER_CONTROL
0100
620
40
%_HEADER
RSDEMO_EASY_SPLITTER_CONTROL 0100 0100 21 81192 35 0 0 21 83 0G D 19990224041651
%_DESCRIPTION
Screen 100
%_FIELDS
CUSTOM 81 00 00 00 00 00 1 2 0 0 0 21 U 1 1 101
OK_CODE CHAR 20 80 10 00 00 00 255 1 O 0 0 0 0 0 0 ____________________
%_FLOWLOGIC
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
*
PROCESS AFTER INPUT.
module exit.
* MODULE USER_COMMAND_0100.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.