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

Sel screen with Radio button & Parameter

Former Member
0 Likes
1,068

Hi folks,

In my Selection Screen, i have a radio button & a parameter .

i have a scenario where if i select this radio button then the

parameter should get invisible. ......how to code it.

Regards,

Sreekanth.

Points will be rewarded if stood useful..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
858

hi

while declaring the radio button,

declare it with user command:

radiobutton group g USER-COMMAND fcode.

at selection-screen.

case sy-ucomm.

when fcode.

loop at screen.

if screen-name = 'parameter'.

screen-active = 0.

modify screen.

endif.

endloop.

Regards,

Talwinder

5 REPLIES 5
Read only

Former Member
0 Likes
858

TRY THIS CODE

----


  • SELECT OPTIONS

----


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

PARAMETERS: r1 RADIOBUTTON GROUP rad1 MODIF ID sc7 USER-COMMAND cli

DEFAULT 'X',

r2 RADIOBUTTON GROUP rad1 MODIF ID sc6.

SELECTION-SCREEN END OF BLOCK b2.

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

PARAMETERS : s_werks TYPE ekpo-werks MODIF ID sc1, "Plant

s_lifnr TYPE ekko-lifnr MODIF ID sc2. "Vendor

SELECT-OPTIONS: s_matnr FOR mara-matnr MODIF ID sc3. "Material

SELECT-OPTIONS: s_date FOR sy-datum MODIF ID sc4

NO INTERVALS NO-EXTENSION. "Date

SELECT-OPTIONS: s_lifnr1 FOR ekko-lifnr MODIF ID sc8

NO INTERVALS NO-EXTENSION. "Delivery to

PARAMETERS: s_pri TYPE c MODIF ID sc5. "Priority

SELECTION-SCREEN END OF BLOCK b1.

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

PARAMETERS: s_txt1 LIKE zmm_collection-txt01 MODIF ID sc9, "Plant

s_txt2 type zmm_collection-txt01 modif id s10, "Vendor

s_txt3 type zmm_collection-txt01 modif id s11. "Vendor

SELECTION-SCREEN END OF BLOCK b3.

*pushbutton

----


  • AT SELECTIONSCREEN OUTPUT

----


AT SELECTION-SCREEN OUTPUT.

  • CASE sy-ucomm.

  • WHEN 'E'.

  • WHEN 'ENDE'.

  • WHEN 'ECAN'.

  • WHEN 'PRIN'.

  • ENDCASE.

IF r2 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'SC2' OR screen-group1 = 'SC3' OR screen-group1

= 'SC5' OR screen-group1 = 'SC8' OR

screen-group1 = 'SC9' OR screen-group1 = 'S10' OR screen-group1 = 'S11'.

screen-input = '0'.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

*F4 Help for Priority field

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_pri.

PERFORM refresh_tables.

PERFORM fill_gt_help.

*To get current screen stepl(Screens,current table line index)

CALL FUNCTION 'DYNP_GET_STEPL'

IMPORTING

povstepl = g_stepl

EXCEPTIONS

stepl_not_found = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE s050.

ENDIF.

*To create F4 help as per our internal tabel (gt_prodhelp)

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'PRI'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'S_PRI'

stepl = g_stepl

window_title = 'CHOICES'

value_org = 'S'

TABLES

value_tab = gt_help

return_tab = gt_return

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc = 0.

READ TABLE gt_return INDEX 1.

s_pri = gt_return-fieldval.

ENDIF.

Read only

Former Member
0 Likes
858

this is sample code for it

selection-screen begin of block v1 with frame title text-001.

parameters : p_name type char10 modif id g2,

p_id type char10 modif id g2,

p_age type i modif id g2,

p_salary type i modif id g2.

selection-screen end of block v1.

selection-screen: pushbutton 10(15) text-005 user-command fc02 modif id g2,

pushbutton 27(15) text-011 user-command fc01 modif id g2.

selection-screen begin of block v2 with frame title text-002.

select-options : s_name for e_name modif id g1.

selection-screen end of block v2.

AT SELECTION-SCREEN OUTPUT.

if ok_code = 'FC02'.

loop at screen.

if screen-group1 = 'G1'.

screen-active = 1.

screen-input = 1.

screen-invisible = 0.

screen-output = 1.

elseif screen-group1 = 'G2'.

screen-active = 0.

screen-input = 0.

screen-invisible = 1.

endif.

modify screen.

endloop.

endif.

endmethod. "display_screen

plz reward if useful

vivek

Read only

Former Member
0 Likes
858

Hi,

check the below code......

PARAMETERS : rb1 RADIOBUTTON GROUP rad USER-COMMAND rad,
             rb2 RADIOBUTTON GROUP rad,
             p_para1 TYPE p MODIF ID id,
             p_para2 TYPE p MODIF ID id.

AT SELECTION-SCREEN OUTPUT.

  CASE 'X'.
    WHEN rb1.
      LOOP AT SCREEN.
        IF screen-group1 = 'ID'.
          screen-invisible = 0.
          screen-active    = 1.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    WHEN rb2.
      LOOP AT SCREEN.
        IF screen-group1 = 'ID'.
          screen-invisible = 1.
          screen-active    = 0.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
  ENDCASE.

Cheers,

jose.

Read only

Former Member
0 Likes
859

hi

while declaring the radio button,

declare it with user command:

radiobutton group g USER-COMMAND fcode.

at selection-screen.

case sy-ucomm.

when fcode.

loop at screen.

if screen-name = 'parameter'.

screen-active = 0.

modify screen.

endif.

endloop.

Regards,

Talwinder

Read only

Former Member
0 Likes
858

hi,

Check this code

If you have radiobuttoons and have to display corresponing parameters based on the selction of radiobutton.

For this

Declare variables like

PARAMETERS: rb_woxre RADIOBUTTON GROUP grp1 DEFAULT 'X' USER-COMMAND rusr.

SELECT-OPTIONS: s_sapwo FOR zfi1_wo_xref-sap_wo_no MODIF ID bl1,

s_legwo FOR zfi1_wo_xref-legacy_wo_no MODIF ID bl1.

PARAMETERS: rb_ccxre RADIOBUTTON GROUP grp1.

SELECT-OPTIONS: s_sapcom FOR zfi1_cc_xref-sap_company_code MODIF ID bl3,

s_sapcos FOR zfi1_cc_xref-sap_cost_center MODIF ID bl3,

s_legloc FOR zfi1_cc_xref-legacy_location MODIF ID bl3,

s_legfcn FOR zfi1_cc_xref-legacy_function MODIF ID bl3.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF rb_woxre = 'X'.

IF screen-group1 = 'BL2' OR screen-group1 = 'BL3' .

screen-active = '0'.

ELSE.

screen-active = '1'.

ENDIF.

MODIFY SCREEN.

ELSEIF rb_ccxre = 'X'.

IF screen-group1 = 'BL1' OR screen-group1 = 'BL2' .

screen-active = '0'.

ELSE.

screen-active = '1'.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Reward points if it is helpful.

Ragards,

Srilatha.