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: 

hi problem in the selection screen

Former Member
0 Kudos

here is my query......

SELECT-OPTIONS: bldat FOR bkpf-budat MODIF ID grp1,

monat FOR bkpf-monat MODIF ID grp2,

gjahr FOR bkpf-gjahr MODIF ID grp2,

xblnr FOR bkpf-xblnr,

kunnr FOR bseg-kunnr,

frmty FOR j_1ifrdtso-j_1ifrmtyp.

when i put the cursor in the field "budat" i.e grp1 then the fields which r under the grp2 should be disabled and viceversa

awaiting for u r reply

6 REPLIES 6

Former Member
0 Kudos

hi,

use 2 radio button with USER-COMMAND.

and use the logic below ur problem will be solved.

u cant use field to trigger event; but u can use radio buttons to trigger

when u use radio button; add USER-COMMAND option to one of the radio button in the group

for u there will be one group with 2 radio buttons

PARAMETERS : rad1 RADIOBUTTON GROUP rad1 USER-COMMAND radio DEFAULT 'X'.

PARAMETERS : rad2 RADIOBUTTON GROUP rad1

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF rad1 = 'X'.

IF screen-group1 = 'GRP1'.

screen-input = '0'.

MODIFY SCREEN.

ENDIF.

ENDIF.

IF rad2 = 'X'.

IF screen-group1 = 'GRP2'.

screen-input = '0'.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

when u use this one of the select option or field will disable based on ur group(MODIF ID) and active radio button .

u can change activation at runtime.

dont write activation logic it is done automatically for MODIF id

Message was edited by: Manoj Gupta

Former Member
0 Kudos

REPORT ZSUMA_TEST .

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

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

PARAMETERS: RB_1 RADIOBUTTON GROUP RC USER-COMMAND RAD DEFAULT 'X'.

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

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

SELECTION-SCREEN END OF BLOCK A1.

PARAMETERS: RB_2 RADIOBUTTON GROUP RC.

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.

AT SELECTION-SCREEN OUTPUT.

BREAK-POINT.

LOOP AT SCREEN.

IF RB_2 = 'X'.

IF SCREEN-GROUP1 = 'XYZ'.

SCREEN-INPUT = '0'.

  • SCREEN-INVISIBLE = '1'.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

Former Member
0 Kudos

Hi Ravi,

In your case, when u put cursor on grp1, fields in grp2 would be disabled..

However, to do vice versa, how will u be able to get ur cursor on the grp2 to make grp1 disable...

A better option would be to go in for a radio button or a checkbox which shall decide which fields are to be enabled or disabled..

This can be handled with a simple loop at screen where u can check the group and enable/disable the fields..

Regards,

Tanveer.

Former Member
0 Kudos

Hi Ravi,

Go through the code which i have posted above.

declare the ur parameter with additional 2 parameter which i have given u .

use the same logic which i have mentioned.

i have solved many problem related to screen activation & deactivation.

<b>if u have further query ; feel free to ask any question

if problem is solved then close the thread by marking helfull answers</b>

Regards

Manoj

E-MAIL :- manoj.baijnath@wipro.com

Former Member
0 Kudos

Hey ,

Try out this code.

&----


*& Report ZKUN_SELSCREEN *

*& *

&----


*& *

*& *

&----


REPORT zkun_selscreen .

TABLES : bkpf,bseg,j_1ifrdtso.

SELECT-OPTIONS:

budat FOR bkpf-budat MODIF ID gr1,

monat FOR bkpf-monat MODIF ID gr2,

gjahr FOR bkpf-gjahr MODIF ID gr2,

xblnr FOR bkpf-xblnr,

kunnr FOR bseg-kunnr,

frmty FOR j_1ifrdtso-j_1ifrmtyp.

PARAMETERS: p1 RADIOBUTTON GROUP gr user-command rad1,

p2 RADIOBUTTON GROUP gr .

at selection-screen output .

LOOP AT SCREEN.

CASE screen-group1.

WHEN 'GR1'.

IF p2 = 'X'.

screen-input = 0.

screen-output = 1.

ENDIF.

WHEN 'GR2'.

IF p1 = 'X'.

screen-output = 1.

screen-input = 0.

ENDIF.

ENDCASE.

Modify Screen.

ENDLOOP.

Note :

P1 refers to the group 1.

P2 refers to the group 2.

Regards,

Kunal.