Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

module-pool: how to create different blocks at same screen

Former Member
0 Kudos

hi experts,

can i create different blocks at same selection-screen in module-pool? if yes,how?and can i use 'loop at screen' in dat case?

thanks.

1 REPLY 1

former_member188685
Active Contributor
0 Kudos

you can do that...

you have create subscreen areas in the screen painter and call the selection screen on those areas..

Just see the stpes..and follow the sample code..

REPORT  ztest_mod.
 
DATA: kunnr TYPE kunnr.
 "if you want to create blocks same like selection screen the
 "you have to create them as subscreen,
"place them in subscreen area.
* Custom Selection Screen a
SELECTION-SCREEN BEGIN OF SCREEN 0200 AS SUBSCREEN.
SELECT-OPTIONS: s_kunnr FOR  kunnr.
SELECTION-SCREEN END OF SCREEN 0200.
 

 
START-OF-SELECTION.
  "in this screen i have a button with function code 'SEARCH'
  " and a subscreen area with name sub
  CALL SCREEN 100.
 
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'STATUS'.
ENDMODULE.                    "status_0100 OUTPUT
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
"for reading the selection screen fields
  DATA:
      i_dyn_fields LIKE TABLE
                     OF dynpread
                   WITH HEADER LINE.
  MOVE:
    'S_KUNNR-LOW' TO i_dyn_fields-fieldname.
  APPEND i_dyn_fields.
  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname               = sy-repid
      dynumb               = '0200'
    TABLES
      dynpfields           = i_dyn_fields
    EXCEPTIONS
      invalid_abapworkarea = 1
      invalid_dynprofield  = 2
      invalid_dynproname   = 3
      invalid_dynpronummer = 4
      invalid_request      = 5
      no_fielddescription  = 6
      invalid_parameter    = 7
      undefind_error       = 8
      double_conversion    = 9
      stepl_not_found      = 10
      OTHERS               = 11.
  IF sy-subrc eq 0. 
   read table i_dyn_fields index 1.
    s_kunnr-low = i_dynp_fields-VALUE
    s_kunnr-sign = 'I'.
    s_kunnr-option = 'EQ'.
    append s_kunnr.
  ENDIF.
 
  DATA: it_kunnr TYPE TABLE OF kna1.
  CASE sy-ucomm.
    WHEN 'SEARCH'.
      SELECT * FROM kna1
      INTO TABLE it_kunnr
      WHERE kunnr IN s_kunnr.
    WHEN 'BACK'.
      LEAVE TO SCREEN 0.
  ENDCASE.
ENDMODULE.                    "user_command_0100 INPUT

Flow Logic

PROCESS BEFORE OUTPUT.
*
  MODULE status_0100.
*
  CALL SUBSCREEN sub INCLUDING sy-repid '0200'.
*
PROCESS AFTER INPUT.
*
  MODULE user_command_0100.

Regards

Vijay Babu Dudla