Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem in Selection Screen.

Dear Experts,

I am facing a problem in Selection Screen.

<b>I have 2 radio buttons ,</b>

<b>Radio Button 1</b> - Choosing the file from desktop and

<b>Radio Button 2</b> - Executing from Database

Under Option1 - i have a <b>FILE</b> parameter which is <b><u>Mandatory.</u></b>

Problem Case -

<b>when I choose option 2, Option 1 should be disabled. in the sense the file name which is mandatory here should not be mandatory . Currently, when i choose option 2 - i have to provide some dummy characters in the file parameter because the file parameter is mandatory, and <u><b>I want to avoid this.</b></u>

Please see the entire code .</b>

REPORT ZTEST.

DATA: LV_FILE_PATH(20) TYPE  C.
DATA: LV_MASK(20)      TYPE  C VALUE   ',*.XLS ,*.XLS.     '.


*-- Macro to put radiobutton on selection screen
*-- &1 - radiobutton parameter name
*-- &2 - text element (description)
*-- &3 - radiobutton group
DEFINE MAKE_RADIOBUTTON.
  SELECTION-SCREEN BEGIN OF LINE.
  PARAMETERS: &1 RADIOBUTTON GROUP &3.
  SELECTION-SCREEN COMMENT 3(60) &2.
  SELECTION-SCREEN END OF LINE.
END-OF-DEFINITION.

SELECTION-SCREEN BEGIN OF BLOCK A0 WITH FRAME TITLE T000.

* From Config File
MAKE_RADIOBUTTON RB_1  ALL_DATA SRC.

SELECTION-SCREEN BEGIN OF BLOCK A1 WITH FRAME TITLE T001.
* Config file from Presentation server
PARAMETERS: P_FILE1   LIKE T390D-DBNAME  OBLIGATORY. "

SELECTION-SCREEN END OF BLOCK A1.

* From database table
MAKE_RADIOBUTTON RB_2 INC_DOWN SRC.

SELECTION-SCREEN END OF BLOCK A0.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE1.

  CALL FUNCTION 'WS_QUERY'
       EXPORTING
            QUERY  = 'CD'  "// Current Directory
       IMPORTING
            RETURN = LV_FILE_PATH.


  CALL FUNCTION 'WS_FILENAME_GET'
       EXPORTING
            DEF_FILENAME     = 'TA_DOWNLOAD.MDB'
            DEF_PATH         = LV_FILE_PATH
            MASK             = LV_MASK
            MODE             = 'O'
       IMPORTING
            FILENAME         = P_FILE1
       EXCEPTIONS
            INV_WINSYS       = 1
            NO_BATCH         = 2
            SELECTION_CANCEL = 3
            SELECTION_ERROR  = 4
            OTHERS           = 5.

INITIALIZATION.

  ALL_DATA = 'From Desktop     : ? '.
  INC_DOWN = 'From Database    : ?'.
  T000     = 'Configuration Upload'.

Please help

Thanks

Tags:
replied

Hi

You should do some modifications like these:

DEFINE MAKE_RADIOBUTTON_1.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: &1 RADIOBUTTON GROUP &3 USER-COMMAND &4.

SELECTION-SCREEN COMMENT 3(60) &2.

SELECTION-SCREEN END OF LINE.

END-OF-DEFINITION.

DEFINE MAKE_RADIOBUTTON_2.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: &1 RADIOBUTTON GROUP &3.

SELECTION-SCREEN COMMENT 3(60) &2.

SELECTION-SCREEN END OF LINE.

END-OF-DEFINITION.

SELECTION-SCREEN BEGIN OF BLOCK A0 WITH FRAME TITLE T000.

  • From Config File

MAKE_RADIOBUTTON_1 RB_1 ALL_DATA SRC AAA.

SELECTION-SCREEN BEGIN OF BLOCK A1 WITH FRAME TITLE T001.

  • Config file from Presentation server

PARAMETERS: P_FILE1 LIKE T390D-DBNAME MODIF ID FIL. "

SELECTION-SCREEN END OF BLOCK A1.

  • From database table

MAKE_RADIOBUTTON_2 RB_2 INC_DOWN SRC.

SELECTION-SCREEN END OF BLOCK A0.

AT SELECTION-SCREEN OUTPUT.

IF RB_2 = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'FIL'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Max

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question