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: 

Enable / Disable selection screen block

Former Member
0 Kudos

Hi, could u pls tell me how do I enable/disable selection screen block written below based on radio button selected??

Block to be enabled / disabled :

*----APO Version and RFC destination block

SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-013.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 01(20) text-e11. "APO Planning Version

SELECTION-SCREEN POSITION 29.

SELECT-OPTIONS s_apover FOR w_version NO INTERVALS.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 01(20) text-e09. "APO RFC Destination

SELECTION-SCREEN POSITION 32.

PARAMETERS : p_aporfc LIKE rfcdes-rfcdest.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b4.

Radiobuttons :

  • Material Type

SELECTION-SCREEN BEGIN OF BLOCK ss04 WITH FRAME TITLE text-072 .

PARAMETERS :

  • Load only FERTs

p_FERT RADIOBUTTON GROUP styp DEFAULT 'X' USER-COMMAND rusr ,

  • Load ROH/HALBs

p_HALB RADIOBUTTON GROUP styp .

SELECTION-SCREEN END OF BLOCK ss04 .

Thanx in advance

8 REPLIES 8

Former Member
0 Kudos

Hi Amit,

you need to assign a modif ID to select options.

Then use AT SELECTION SCREEN OUTPUT.

Just search forum there are already lots of threads on the same topic.

Regards,

Atish

Message was edited by:

Atish Sarda

Former Member
0 Kudos

Hi

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: pa_file TYPE rlgrap-filename MODIF ID abc,

pa_lifnr TYPE lfa1-lifnr MODIF ID abc,

pa_vkorg TYPE vbak-vkorg MODIF ID abc.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

PARAMETERS: pa_kunnr TYPE vbak-kunnr MODIF ID def.

SELECT-OPTIONS: s_lifnr FOR gs_lfa1-lifnr MODIF ID def,

s_date FOR gs_lfa1-erdat MODIF ID def,

s_augru FOR gs_vbak-augru MODIF ID def,

s_vbeln FOR gs_vbak-vbeln MODIF ID def.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pa_upd RADIOBUTTON GROUP g1 USER-COMMAND uc01 DEFAULT 'X'."#EC *

SELECTION-SCREEN COMMENT 3(60) text-004 FOR FIELD pa_upd.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pa_rep RADIOBUTTON GROUP g1 ."#EC *

SELECTION-SCREEN COMMENT 3(60) text-005 FOR FIELD pa_rep.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b3.

IF pa_rep EQ gc_x.

LOOP AT SCREEN.

IF screen-group1 = gc_abc.

screen-input = gc_zero_num.

ELSEIF screen-group1 = gc_def.

screen-active = gc_one_num.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSEIF pa_upd EQ gc_x.

*For Reprocessing

LOOP AT SCREEN.

IF screen-group1 = gc_def.

screen-input = gc_zero_num.

ELSEIF screen-group1 = gc_abc.

screen-active = gc_one_num.

ENDIF.

MODIFY SCREEN.

CLEAR pa_upd.

ENDLOOP.

ENDIF.

***********************************************************

REPORT zrich_001.

PARAMETERS: p_rad1 RADIOBUTTON GROUP grp1 DEFAULT 'X'

user-command chk,

p_rad2 RADIOBUTTON GROUP grp1.

SELECT-OPTIONS: s_datum1 FOR sy-datum MODIF ID d1,

s_datum2 FOR sy-datum MODIF ID d2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF p_rad1 = 'X'

AND screen-group1 = 'D2'.

screen-active = '0'.

ENDIF.

IF p_rad2 = 'X'

AND screen-group1 = 'D1'.

screen-active = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Regards

Anji

Former Member
0 Kudos

use the following code

PARAMETERS show_all AS CHECKBOX USER-COMMAND flag.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

PARAMETERS: p1(10) TYPE c,

p2(10) TYPE c,

p3(10) TYPE c.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.

PARAMETERS: p4(10) TYPE c MODIF ID bl2,

p5(10) TYPE c MODIF ID bl2,

p6(10) TYPE c MODIF ID bl2.

SELECTION-SCREEN END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF show_all <> 'X' AND

screen-group1 = 'BL2'.

screen-active = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Regards

Lalit

Former Member
0 Kudos

Hi Amit,

You need to write MODIF ID along with select options declarations.

Then change the screen attributes in at selction-screen output event.

Refer this logic to write ur code.

  • Selection Screen for the Application Layer file path.

SELECTION-SCREEN BEGIN OF BLOCK APPL WITH FRAME TITLE TEXT-002.

PARAMETERS : P_AFILE1 LIKE FILENAME-FILEINTERN MODIF ID SL1,

P_AFILE2 TYPE DXFILE-FILENAME MODIF ID SL1.

SELECTION-SCREEN END OF BLOCK APPL.

  • Selection Screen for the Presenation Layer file path.

SELECTION-SCREEN BEGIN OF BLOCK PRES WITH FRAME TITLE TEXT-003.

PARAMETERS : P_PFILE1 TYPE IBIPPARMS-PATH MODIF ID SL2,

P_PFILE2 TYPE IBIPPARMS-PATH MODIF ID SL2.

SELECTION-SCREEN END OF BLOCK PRES.

SELECTION-SCREEN END OF BLOCK UPLOAD.

AT SELECTION-SCREEN OUTPUT.

IF P_APPL = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'SL2'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSEIF P_PRES = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'SL1'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Reward points if helpful.

Regards,

Hemant

Former Member
0 Kudos

Thanx for reply, my problem is, in existing code, Selct-option & parameter is defined with BEGIN OF LINE & END OF LINE option, if I associate MODIF ID with select option then, it enables/disables block. BUT when it is enabled, select option and parameters are also disabled i.e. only there desc. exists............

Former Member
0 Kudos

hi amit,

hope this helps u:

loop at screen.

if screen-name = 'S_INPUT-LOW'.

if checkbox_get ne 'X'.

screen-input = 0.

modify screen.

endif.

ENDIF.

u can also give various options for eg screen invisible etc if required.

regards,

sohi

Former Member
0 Kudos

Hi Amit,

Use the below code.

SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-013.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 01(20) text-e11. "APO Planning Version

SELECTION-SCREEN POSITION 29.

SELECT-OPTIONS s_apover FOR w_version NO INTERVALS modif id ABC.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 01(20) text-e09. "APO RFC Destination

SELECTION-SCREEN POSITION 32.

PARAMETERS : p_aporfc LIKE rfcdes-rfcdest modif id ABC.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b4.

*Radiobuttons :

  • Material Type

SELECTION-SCREEN BEGIN OF BLOCK ss04 WITH FRAME TITLE text-072 .

PARAMETERS :

  • Load only FERTs

p_FERT RADIOBUTTON GROUP styp DEFAULT 'X' USER-COMMAND rusr ,

  • Load ROH/HALBs

p_HALB RADIOBUTTON GROUP styp .

SELECTION-SCREEN END OF BLOCK ss04 .

at selection-screen output.

loop at screen.

if screen-group1 = 'ABC'.

if p_HALB = 'X'.

screen-input = 1.

else.

screen-input = 0.

endif.

endif.

modify screen.

endloop.

Former Member
0 Kudos

hi amit,

r1 = radiobutton, r2= radiobutton 2 group should be specified

radiobuttons should be declare in a block .

to call another screen , screen number should be given

at selection-screen.

if r1 = 'x' and r2 =' '

call selection screen 100.

else

if r2 = 'x'.

call selection-screen 200.

end if.

see this code is useful