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

Multiple screens in dock container



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



Joined: 01 Sep 2007
Posts: 1636

PostPosted: Wed May 26, 2010 3:07 pm    Post subject: Multiple screens in dock container Reply with quote

Code:
REPORT yztest .

TYPE-POOLS: slis.

* Tables
TABLES: mara.

TYPES: BEGIN OF ty_name,
name TYPE char10,
age TYPE i,
END OF ty_name.

TYPES: BEGIN OF ty_marks,
sub1 TYPE i,
sub2 TYPE i,
total TYPE i,
END OF ty_marks.

TYPES: BEGIN OF ty_phone,
phnum TYPE char10,
END OF ty_phone.

TYPES: BEGIN OF ty_addr,
address TYPE char20,
END OF ty_addr .

* Output internal table
DATA: itab TYPE TABLE OF ty_name,
wa TYPE ty_name,
itab1 TYPE TABLE OF ty_marks,
wa1 TYPE ty_marks,
itab2 TYPE TABLE OF ty_phone,
wa2 TYPE ty_phone,
itab3 TYPE TABLE OF ty_addr,
wa3 TYPE ty_addr.

* ALV Grid
DATA: r_grid TYPE REF TO cl_gui_alv_grid,
r_grid1 TYPE REF TO cl_gui_alv_grid,
r_grid2 TYPE REF TO cl_gui_alv_grid,
r_grid3 TYPE REF TO cl_gui_alv_grid,
g_dock TYPE REF TO cl_gui_docking_container,
g_dock1 TYPE REF TO cl_gui_docking_container,
g_dock2 TYPE REF TO cl_gui_docking_container,
g_dock3 TYPE REF TO cl_gui_docking_container,
g_dock4 TYPE REF TO cl_gui_docking_container,
it_fieldcat TYPE lvc_t_fcat,
it_fieldcat1 TYPE lvc_t_fcat,
it_fieldcat2 TYPE lvc_t_fcat,
it_fieldcat3 TYPE lvc_t_fcat,
wa_fieldcat TYPE lvc_s_fcat.

DATA picture TYPE REF TO cl_gui_picture.

DATA url(255).
CLEAR url.
DATA init.

START-OF-SELECTION.

  wa-name = 'test01'.
  wa-age = '1'.
  APPEND wa TO itab.

  wa-name = 'test02'.
  wa-age = '2'.
  APPEND wa TO itab.

  wa-name = 'test03'.
  wa-age = '3'.
  APPEND wa TO itab.

  wa1-sub1 = '11'.
  wa1-sub2 = '22'.
  wa1-total = wa1-sub1 + wa1-sub2.
  APPEND wa1 TO itab1.

  wa1-sub1 = '22'.
  wa1-sub2 = '33'.
  wa1-total = wa1-sub1 + wa1-sub2.
  APPEND wa1 TO itab1.

  wa2-phnum = '99999999999'.
  APPEND wa2 TO itab2.

  wa2-phnum = '888888888888'.
  APPEND wa2 TO itab2.

  wa2-phnum = '777777777777'.
  APPEND wa2 TO itab2.

  wa3-address = 'HItech City'.
  APPEND wa3 TO itab3.

  wa3-address = 'Secunderabad'.
  APPEND wa3 TO itab3.

  wa3-address = 'Hyderabad'.
  APPEND wa3 TO itab3.

  PERFORM display_image.

  CALL SCREEN 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.

  SET PF-STATUS 'LISTOUT1'.
  SET TITLEBAR 'LIST1'.

  wa_fieldcat-fieldname = 'NAME'.
  wa_fieldcat-seltext = 'NAME OF THE STUDENT'.
  wa_fieldcat-coltext = 'NAME OF THE STUDENT'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR wa_fieldcat.

  wa_fieldcat-fieldname = 'AGE'.
  wa_fieldcat-seltext = 'AGE OF THE STUDENT'.
  wa_fieldcat-coltext = 'AGE OF THE STUDENT'.
  APPEND wa_fieldcat TO it_fieldcat.

  wa_fieldcat-fieldname = 'SUB1'.
  wa_fieldcat-seltext = 'SUBJECT1'.
  wa_fieldcat-coltext = 'SUBJECT1'.
  APPEND wa_fieldcat TO it_fieldcat1.

  wa_fieldcat-fieldname = 'SUB2'.
  wa_fieldcat-seltext = 'SUBJECT2'.
  wa_fieldcat-coltext = 'SUBJECT2'.
  APPEND wa_fieldcat TO it_fieldcat1.

  wa_fieldcat-fieldname = 'TOTAL'.
  wa_fieldcat-seltext = 'TOTAL'.
  wa_fieldcat-coltext = 'TOTAL'.
  APPEND wa_fieldcat TO it_fieldcat1.

  wa_fieldcat-fieldname = 'PHNUM'.
  wa_fieldcat-seltext = 'PHONE NO'.
  wa_fieldcat-coltext = 'PHONE NO'.
  APPEND wa_fieldcat TO it_fieldcat2.

  wa_fieldcat-fieldname = 'ADDRESS'.
  wa_fieldcat-seltext = 'ADDRESS'.
  wa_fieldcat-coltext = 'ADDRESS'.
  APPEND wa_fieldcat TO it_fieldcat3.


  IF g_dock IS INITIAL.
    CREATE OBJECT g_dock
      EXPORTING
        repid     = sy-repid
        dynnr     = sy-dynnr
        side      = g_dock->dock_at_left
        extension = 300.

    CREATE OBJECT r_grid
      EXPORTING
        i_parent = g_dock.

  ENDIF.

  IF g_dock1 IS INITIAL.
    CREATE OBJECT g_dock1
      EXPORTING
        repid     = sy-repid
        dynnr     = sy-dynnr
        side      = g_dock1->dock_at_right
        extension = 300.

    CREATE OBJECT r_grid1
      EXPORTING
        i_parent = g_dock1.

  ENDIF.

  IF g_dock2 IS INITIAL.
    CREATE OBJECT g_dock2
      EXPORTING
        repid     = sy-repid
        dynnr     = sy-dynnr
        side      = g_dock2->dock_at_top
        extension = 100.

    CREATE OBJECT r_grid2
      EXPORTING
        i_parent = g_dock2.

    IF g_dock3 IS INITIAL.
      CREATE OBJECT g_dock3
        EXPORTING
          repid     = sy-repid
          dynnr     = sy-dynnr
          side      = g_dock3->dock_at_top
          extension = 100.

      CREATE OBJECT r_grid3
        EXPORTING
          i_parent = g_dock3.

    ENDIF.

    IF NOT itab[] IS INITIAL.
      CALL METHOD r_grid->set_table_for_first_display
        CHANGING
          it_outtab       = itab
          it_fieldcatalog = it_fieldcat.
    ENDIF.

    IF NOT itab1[] IS INITIAL.
      CALL METHOD r_grid1->set_table_for_first_display
        CHANGING
          it_outtab       = itab1
          it_fieldcatalog = it_fieldcat1.
    ENDIF.

    IF NOT itab2[] IS INITIAL.
      CALL METHOD r_grid2->set_table_for_first_display
        CHANGING
          it_outtab       = itab2
          it_fieldcatalog = it_fieldcat2.
    ENDIF.

    IF NOT itab3[] IS INITIAL.
      CALL METHOD r_grid3->set_table_for_first_display
        CHANGING
          it_outtab       = itab3
          it_fieldcatalog = it_fieldcat3.
    ENDIF.

    IF g_dock4 IS INITIAL.
      CREATE OBJECT g_dock4
        EXPORTING
          repid     = sy-repid
          dynnr     = sy-dynnr
          side      = g_dock4->dock_at_bottom
          extension = 100.

      CREATE OBJECT picture
        EXPORTING
          parent = g_dock4.

      CALL METHOD picture->load_picture_from_url
        EXPORTING
          url = url.
      init = 'X'.
    ENDIF.

  ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
  CASE sy-ucomm.
    WHEN 'BACK'.
      LEAVE PROGRAM.
  ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
*& Form display_image
*----------------------------------------------------------------------*
FORM display_image .

  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. " display_image
*&---------------------------------------------------------------------*
*& Module EXIT INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE exit INPUT.

  CALL METHOD g_dock->free.
  CALL METHOD g_dock1->free.
  CALL METHOD g_dock2->free.
  CALL METHOD g_dock3->free.

ENDMODULE. " EXIT INPUT



dock_alv.jpg
 Description:
 Filesize:  16.96 KB
 Viewed:  7010 Time(s)

dock_alv.jpg


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 -> ALV Grid / ALV Tree / ALV List 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.