Application Development and Automation 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: 
Read only

Selection screen in display mode

Former Member
0 Likes
1,532

Hi all,

I have a selection screen with 2 radio buttons & 2 text boxes. If I click the first radio button, the 2nd text box shud be in display mode & if I click the 2nd radio button, the 1st text box shud be in display mode.

How to do it?

Thanks in advance.

SELECTION-SCREEN BEGIN OF BLOCK MODE WITH FRAME TITLE title.

parameters : s_pr radiobutton group g1,

s_po radiobutton group g1.

select-options : s_prnum for eban-banfn.

select-options : s_ponum for eban-ebeln.

SELECTION-SCREEN END OF BLOCK MODE.

Pls look into the code above.

G.Vijay

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,202

Hi vijaykumar,

1. simple.

2. your code only,

just copy paste.

3. It will work as u require.

4.

report abc.

TABLES : EBAN.

SELECTION-SCREEN BEGIN OF BLOCK MODE WITH FRAME TITLE title.

parameters : s_pr radiobutton group g1 <b>USER-COMMAND RAD DEFAULT 'X'</b>,

s_po radiobutton group g1.

select-options : s_prnum for eban-banfn <b>MODIF ID M1</b>.

select-options : s_ponum for eban-ebeln <b>MODIF ID M2</b>.

SELECTION-SCREEN END OF BLOCK MODE.

*----


<b>at selection-screen output.</b>

LOOP AT SCREEN.

IF S_PR = 'X' AND SCREEN-GROUP1 = 'M2'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

IF S_PO = 'X' AND SCREEN-GROUP1 = 'M1'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

regards,

amit m.

Hi all,

I have a selection screen with 2 radio buttons & 2 text boxes. If I click the first radio button, the 2nd text box shud be in display mode & if I click the 2nd radio button, the 1st text box shud be in display mode.

How to do it?

Thanks in advance.

SELECTION-SCREEN BEGIN OF BLOCK MODE WITH FRAME TITLE title.

parameters : s_pr radiobutton group g1,

s_po radiobutton group g1.

select-options : s_prnum for eban-banfn.

select-options : s_ponum for eban-ebeln.

SELECTION-SCREEN END OF BLOCK MODE.

Pls look into the code above.

G.Vijay

6 REPLIES 6
Read only

Former Member
0 Likes
1,203

Hi vijaykumar,

1. simple.

2. your code only,

just copy paste.

3. It will work as u require.

4.

report abc.

TABLES : EBAN.

SELECTION-SCREEN BEGIN OF BLOCK MODE WITH FRAME TITLE title.

parameters : s_pr radiobutton group g1 <b>USER-COMMAND RAD DEFAULT 'X'</b>,

s_po radiobutton group g1.

select-options : s_prnum for eban-banfn <b>MODIF ID M1</b>.

select-options : s_ponum for eban-ebeln <b>MODIF ID M2</b>.

SELECTION-SCREEN END OF BLOCK MODE.

*----


<b>at selection-screen output.</b>

LOOP AT SCREEN.

IF S_PR = 'X' AND SCREEN-GROUP1 = 'M2'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

IF S_PO = 'X' AND SCREEN-GROUP1 = 'M1'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

regards,

amit m.

Read only

Former Member
0 Likes
1,202

Hi,

try this code. This works.

TABLES: mara,ekko.

SELECTION-SCREEN begin of line .

PARAMETERS: rad1 RADIOBUTTON GROUP grp1.

SELECT-OPTIONS: date FOR mara-matnr MODIF ID mo1.

SELECTION-SCREEN end of line .

SELECTION-SCREEN begin of line .

PARAMETERS: rad2 RADIOBUTTON GROUP grp1.

SELECT-OPTIONS: date1 FOR mara-matnr MODIF ID mo1.

SELECTION-SCREEN end of line .

AT SELECTION-SCREEN OUTPUT.

IF rad2 = 'X'.

LOOP

AT SCREEN. IF screen-name = 'DATE-LOW' OR screen-name =

'DATE-HIGH'. screen-input = 0. MODIFY SCREEN. ENDIF.

ENDLOOP. ENDIF.

IF rad1 = 'X'.

LOOP

AT SCREEN. IF screen-name = 'DATE1-LOW' OR screen-name =

'DATE1-HIGH'. screen-input = 0. MODIFY SCREEN. ENDIF.

ENDLOOP. ENDIF.

mark if you find this helpful.

Regards,

Sumit.

Read only

Former Member
0 Likes
1,202

You need to attach a user command to the radio button and a MODIF ID to the texts that you want to change.

See these threads

For sample code see here

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba70535c111d1829f0000e829fbfe/frameset.htm

Regards,

Ravi

Note :Please mark all the helpful answers

Read only

Former Member
0 Likes
1,202

hi vijay,

at selection-screen.

if s_pr = 'X'.

screen-fieldname = 's_ponum'.

screen-input = 1.

elseif s_po = 'X'.

screen-fieldname = 's_prnum'.

screen-input = 1.

endif.

modify screen.

endloop.

Message was edited by: Priya

Read only

Former Member
0 Likes
1,202

This should solve your problem

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

PARAMETERS : rb_pr RADIOBUTTON GROUP g1 DEFAULT 'X'

USER-COMMAND ucomm, "For Presentation

rb_pr RADIOBUTTON GROUP g1. "For Application

SELECT-OPTIONS: s_prnum for eban-banfn MODIF ID rb1, "Input File

s_ponum for eban-ebeln MODIF ID rb2. "Input File

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF rb_pc = 'X' AND screen-group1 = 'RB2'.

screen-input = '0'.

MODIFY SCREEN.

ELSEIF rb_srv = 'X' AND screen-group1 = 'RB1'.

screen-input = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Read only

Former Member
0 Likes
1,202

Copy paste this code and change the parameters to suit ur code requiremenst.

REPORT z_52341_test.

tables: mara, marc.

SELECTION-SCREEN BEGIN OF BLOCK MODE WITH FRAME TITLE title.

parameters : s_pr radiobutton group g1 default 'X' user-command ck modif id g1 ,

s_po radiobutton group g1 modif id g1.

select-options : s_prnum for mara-matnr.

select-options : s_ponum for marc-matnr.

SELECTION-SCREEN END OF BLOCK MODE.

at selection-screen output.

loop at screen.

if screen-name = 'S_PRNUM-HIGH' or screen-name = 'S_PRNUM-LOW'.

if s_po = 'X'.

screen-input = 0.

screen-output = 1.

modify screen.

else.

screen-input = 1.

screen-output = 0.

modify screen.

endif.

endif.

if screen-name = 'S_PONUM-HIGH' or screen-name = 'S_PONUM-LOW'.

if s_pr = 'X'.

screen-input = 0.

screen-output = 1.

modify screen.

else.

screen-input = 1.

screen-output = 0.

modify screen.

endif.

endif.

endloop.