Skip to Content
1
Jul 23, 2020 at 02:19 AM

Disabling Fields in Selection-Screen Subscreen

580 Views

Hi,

I am currently creating a module pool program that uses subscreens for selection-screens. Currently I have 3 subscreens: Subscreen 1 - radiobutton group
Subscreen 2 - manual input of data
Subscreen 3 - upload excel filepath

I want to disable the fields in subscreen 2 and 3 depending on the selection in subscreen 1. Is there any way to do this? I have tried inputting this into both PBO and PAI but nothing seems to be working.

IF p_manual = 'X'. "if user chooses to input manually
  LOOP AT SCREEN.
      IF screen-name = 'p_vers'.
        screen-input = '1'.
        MODIFY SCREEN.
      ENDIF.
      IF screen-name = 'p_file'.
        screen-input = '0'.
        MODIFY SCREEN.
      ENDIF.
      ENDLOOP.

    ELSEIF p_excel = 'X'. "if user wants to upload the file
    LOOP AT SCREEN.
      IF screen-name = 'p_vers'.
        screen-input = '0'.
        MODIFY SCREEN.
      ENDIF.
      IF screen-name = 'p_file'.
        screen-input = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
    ENDIF.

My code for the selection screens are:

SELECTION-SCREEN BEGIN OF SCREEN 9210 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE TEXT-030. "upload option
PARAMETERS:
  p_manual RADIOBUTTON GROUP grp3, "manual upload
  p_excel  RADIOBUTTON GROUP grp3 DEFAULT 'X'. "excel/ flat file upload
SELECTION-SCREEN END OF BLOCK b3.
SELECTION-SCREEN END OF SCREEN 9210.

SELECTION-SCREEN BEGIN OF SCREEN 9230 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE TEXT-050. "manual select 
PARAMETERS:
  p_vers TYPE zbi_fin_consol-version MODIF ID upm, "company code
  p_year TYPE zbi_fin_consol-zyear MODIF ID upm. "customer
SELECT-OPTIONS:
  s_month FOR zbi_fin_consol-zmonth OBLIGATORY MODIF ID upm.
SELECTION-SCREEN END OF BLOCK b5.
SELECTION-SCREEN END OF SCREEN 9230.

SELECTION-SCREEN BEGIN OF SCREEN 9240 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b6 WITH FRAME TITLE TEXT-060. "excel upload
PARAMETERS:
  p_file   TYPE rlgrap-filename MODIF ID upf, "filepath
  p_test   RADIOBUTTON GROUP grp5 MODIF ID upf,   "test file
  p_upload RADIOBUTTON GROUP grp5 MODIF ID upf. "upload data

SELECTION-SCREEN END OF BLOCK b6.
SELECTION-SCREEN END OF SCREEN 9240.

My code for PBO and PAI on the screen are:

PROCESS BEFORE OUTPUT.
 MODULE STATUS_9100.
call subscreen area_option including sy-repid '9210'.
call subscreen area_manual including sy-repid '9230'.
call subscreen area_excel  including sy-repid '9240'.
module modify_screen_9200_pbo.

PROCESS AFTER INPUT.
module cancel at EXIT-COMMAND.
 MODULE USER_COMMAND_9200.
call subscreen area_option.
call subscreen area_manual.
call subscreen area_excel.
module modify_screen_9200_pai.