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: 

My selection screen breaks when I added a file upload option.

0 Kudos

Hi fellow abapers,

I've my code working for disabling screen input based on radio button selection. But it seems to break when I added a third option for file upload. If commented out the code for "AT SELECTION SCREEN ON" and below. It is working fine.

I guess AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file. and AT SELECTION-SCREEN ON p_file

break my current selection screen output logic. Anyone know how to solve this?

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    CASE 'X'.
      WHEN p_rad1.
        IF screen-group1 = 'RB1'.
          screen-input = 1.
        ELSEIF screen-group1 = 'RB2' OR screen-group1 = 'RB3'.
          screen-input = 0.
        ENDIF.
      WHEN p_rad2.
        IF screen-group1 = 'RB2'.
          screen-input = 1.
        ELSEIF screen-group1 = 'RB1' OR screen-group1 = 'RB3'.
          screen-input = 0.
        ENDIF.
      WHEN p_rad3.
        IF screen-name = 'RB3'.
          screen-input = 1.
        ELSEIF screen-group1 = 'RB1' OR screen-group1 = 'RB2'.
          screen-input = 0.
        ENDIF.
    ENDCASE.
    MODIFY SCREEN.
  ENDLOOP.


"Below code will break my selection screen.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
  "F4 File Request Pop Up
  CALL METHOD ycl_otc_cust_lot=>get_local_file
    IMPORTING
      ev_file = p_file.

AT SELECTION-SCREEN ON p_file.
  "In Screen Validation for File Name
  CALL METHOD ycl_otc_cust_lot=>check_if_excel_format
    EXPORTING
      iv_file = p_file
    IMPORTING
      ev_ext  = gv_ext.
8 REPLIES 8

venkateswaran_k
Active Contributor
0 Kudos

Hi

Please change your code == screen-name to screen-group

      WHEN p_rad3.
        IF screen-group1 = 'RB3'.  <================ change here
          screen-input = 1.
        ELSEIF screen-group1 = 'RB1' OR screen-group1 = 'RB2'.
          screen-input = 0.
        ENDIF.

0 Kudos

Oopps that is an old code. I've already changed that. It is still not working. The selection screen is not the case here. I think the culprit is at the line I wrote , "Below code will break my selection screen.

Sandra_Rossi
Active Contributor
0 Kudos

I'd like to help but I don't understand. You say "it works, it breaks" but you don't explain what it happens when "it works" and what it happens when "it breaks", and when it breaks, you don't say what you expect. Can you clarify all these points please?

0 Kudos

It works, means my radio button is working. I'm able to select any of the radio button just fine and the non active input parameter can be disabled.

It breaks when I added a 3rd radio button. When I added a 3rd one. I'm not able to select the radio button anymore. The radio button will freezed and the disable screen group is not working as expected.

0 Kudos

Oopps that is an old code. I've already changed that. It is still not working. The selection screen is not the case here. I think the culprit is at the line I wrote , "Below code will break my selection screen.

venkateswaran_k
Active Contributor
0 Kudos

Please provide your Data statements for the Radio Button and how you grouped.

0 Kudos
SELECTION-SCREEN: BEGIN OF BLOCK b4 WITH FRAME TITLE TEXT-011.
PARAMETERS : p_rad1 RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND on MODIF ID r1.
PARAMETERS : p_rad2 RADIOBUTTON GROUP g1 MODIF ID r2.
PARAMETERS : p_rad3 RADIOBUTTON GROUP g1 MODIF ID r3.
SELECTION-SCREEN: END OF BLOCK b4.

SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS s_werks FOR  ycust_lot_data-werks MODIF ID rb1.
SELECT-OPTIONS s_date  FOR  ycust_lot_data-erdat MODIF ID rb1.
SELECTION-SCREEN: END OF BLOCK b1.

SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE TEXT-009.
SELECT-OPTIONS p_date  FOR  ycust_lot_data-erdat MODIF ID rb2.
SELECTION-SCREEN: END OF BLOCK b2.

SELECTION-SCREEN: BEGIN OF BLOCK b3 WITH FRAME TITLE TEXT-010.
PARAMETERS:    p_file  TYPE rlgrap-filename MODIF ID rb3.
SELECTION-SCREEN: END OF BLOCK b3.

Sandra_Rossi
Active Contributor
0 Kudos

I tested your code (with correction -> IF screen-group1 = 'RB3' instead of screen-name), and I'm able to select the radio button. Sorry! If you don't believe me, please paste the code you have posted in a new program and try. So please provide the additional code and information that will help us reproduce (and solve) your issue.