-2

I have created a screen 9000 for a program and I am trying to display to tables on top of each other using splitting container. Here is the code (copied):

REPORT  zsam12.
DATA: i_t000  TYPE TABLE OF t000,
      i_tcurr TYPE TABLE OF tcurr.
"Declaration for all the objects required
DATA: o_container       TYPE REF TO cl_gui_custom_container,
      o_splitter        TYPE REF TO cl_gui_easy_splitter_container,
      o_container_left  TYPE REF TO cl_gui_container,
      o_container_right TYPE REF TO cl_gui_container,
      o_salv_table1     TYPE REF TO cl_salv_table,
      o_salv_table2     TYPE REF TO cl_salv_table.

START-OF-SELECTION.
  "Select Data
  SELECT * FROM t000 INTO TABLE i_t000.
  SELECT * FROM tcurr INTO TABLE i_tcurr.
  CALL SCREEN 9000.
  "&----
*& Module init_9000 OUTPUT
  "&----
  "text
  "----
MODULE init_9000 OUTPUT.
  DATA: lv_cx_salv_msg TYPE REF TO cx_salv_msg,
        lw_bal_s_msg   TYPE bal_s_msg.
  IF NOT o_container IS BOUND.
    "Create a Custom Control
    CREATE OBJECT o_container
      EXPORTING
        container_name              = 'CONTAINER'
        repid                       = sy-repid
        dynnr                       = '9000'
      EXCEPTIONS
        cntl_error                  = 1
        cntl_system_error           = 2
        create_error                = 3
        lifetime_error              = 4
        lifetime_dynpro_dynpro_link = 5
        OTHERS                      = 6.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    "Create splitter control
    CREATE OBJECT o_splitter
      EXPORTING
        parent            = o_container
        orientation       = 1
        sash_position     = 30
        with_border       = 1
      EXCEPTIONS
        cntl_error        = 1
        cntl_system_error = 2
        OTHERS            = 3.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    "Assign the left and right control that were splitted
    o_container_left = o_splitter->top_left_container.
    o_container_right = o_splitter->bottom_right_container.
  ENDIF. " IF NOT o_container IS BOUND.
  TRY.
      CALL METHOD cl_salv_table=>factory
        EXPORTING
          r_container  = o_container_left
        IMPORTING
          r_salv_table = o_salv_table1
        CHANGING
          t_table      = i_t000.
    CATCH cx_salv_msg INTO lv_cx_salv_msg.
      lv_cx_salv_msg->if_alv_message~get_message(
      RECEIVING
      r_s_msg = lw_bal_s_msg ).
      MESSAGE ID lw_bal_s_msg-msgid
      TYPE lw_bal_s_msg-msgty
      NUMBER lw_bal_s_msg-msgno
      WITH lw_bal_s_msg-msgv1 lw_bal_s_msg-msgv2
      lw_bal_s_msg-msgv3 lw_bal_s_msg-msgv4.
  ENDTRY.
  TRY.
      CALL METHOD cl_salv_table=>factory
        EXPORTING
          r_container  = o_container_right
        IMPORTING
          r_salv_table = o_salv_table2
        CHANGING
          t_table      = i_tcurr.
    CATCH cx_salv_msg INTO lv_cx_salv_msg.
      lv_cx_salv_msg->if_alv_message~get_message(
      RECEIVING
      r_s_msg = lw_bal_s_msg ).
      MESSAGE ID lw_bal_s_msg-msgid
      TYPE lw_bal_s_msg-msgty
      NUMBER lw_bal_s_msg-msgno
      WITH lw_bal_s_msg-msgv1 lw_bal_s_msg-msgv2
      lw_bal_s_msg-msgv3 lw_bal_s_msg-msgv4.
  ENDTRY.
  "Display the ALV Grid
  o_salv_table1->display( ).
  o_salv_table2->display( ).
ENDMODULE. " init_9000 OUTPUT
*&---------------------------------------------------------------------*
*&      Module  STATUS_9000  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_9000 OUTPUT.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.
ENDMODULE.                 " STATUS_9000  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_9000  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_9000 INPUT.
ENDMODULE.                 " USER_COMMAND_9000  INPUT

The problem is when I try to execute this I get a blank screen. Cannot figure out why I cannot display anything in the screen. Any reason why and how to fix?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
mj1261829
  • 1,200
  • 3
  • 26
  • 53
  • It is hard to help you without knowing how the dependency of the screen 9000 look like. – Jagger Aug 21 '19 at 15:01
  • 1
    What does the code in your 9000 dynpro look like? You probably forgot to call the init_9000 module. It should look like this: `PROCESS BEFORE OUTPUT.` `MODULE STATUS_9000.` `MODULE init_9000.` `PROCESS AFTER INPUT.` `MODULE USER_COMMAND_9000.` – Legxis Aug 21 '19 at 15:13
  • I did like you said but still blank screen, do not know why – mj1261829 Aug 21 '19 at 19:02
  • 1
    Then you probably didn't create a custom control on your dynpro, called 'CONTAINER'. You can't reference to it if it doesn't exist. – Legxis Aug 22 '19 at 08:08
  • Yah I created a custom container in the screen then it worked. Thank you. – mj1261829 Aug 22 '19 at 10:02
  • @legxis please turn your latest comment into an answer because the OP said it was the issue. – Sandra Rossi Aug 22 '19 at 12:24

1 Answers1

0

Legxis is right, call the dialog modules like this and it will work:

PROCESS BEFORE OUTPUT.
  MODULE init_9000.
  MODULE status_9000.

PROCESS AFTER INPUT.
  MODULE user_command_9000.
Suncatcher
  • 10,355
  • 10
  • 52
  • 90