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: 

how to display mandatoryoption for a field when radio button is selected

Former Member
0 Kudos

Hi All,

My requirement is:

in my selection screen i am having two fields plant and purchasing group.here plant is mandatory field and i am having two radio buttons 1) normal and 2) live share.

when i select normal radiobutton it has to show plant has mandatory field and when i select live share radiobutton it has to show plant and purchasing group has mandatory options.

anybody can send me the code how to write...

thanks,

maheedhar

1 ACCEPTED SOLUTION

former_member194152
Contributor
0 Kudos

Hi..

Try this code may be it can resolve ur problem...

tables : mara,aufk.

SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_bukrs LIKE aufk-bukrs obligatory  modif id AB.
SELECT-OPTIONS: s_matkl FOR mara-matkl  .   "Mat Group
SELECTION-SCREEN: END   OF BLOCK b1 .

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

parameter : r1   radiobutton group a DEFAULT 'X' modif id EE USER-COMMAND check,
          : r2   radiobutton group a.

SELECTION-SCREEN: END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.


    LOOP AT SCREEN.
    IF  r1 = 'X'.
      if screen-group1 = 'AB'.
        screen-active = 0.
        MODIFY SCREEN.
       endif.
      ENDIF.
    ENDLOOP.

Rewards if helpful

Regards

Gagan

2 REPLIES 2

Former Member
0 Kudos

at selection-screen output.

loop at screen.

if p_rad EQ 'X' and screen-name EQ ' ".

sreen-REQUIRED = 'X'.

modify screen

endloop.

former_member194152
Contributor
0 Kudos

Hi..

Try this code may be it can resolve ur problem...

tables : mara,aufk.

SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_bukrs LIKE aufk-bukrs obligatory  modif id AB.
SELECT-OPTIONS: s_matkl FOR mara-matkl  .   "Mat Group
SELECTION-SCREEN: END   OF BLOCK b1 .

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

parameter : r1   radiobutton group a DEFAULT 'X' modif id EE USER-COMMAND check,
          : r2   radiobutton group a.

SELECTION-SCREEN: END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.


    LOOP AT SCREEN.
    IF  r1 = 'X'.
      if screen-group1 = 'AB'.
        screen-active = 0.
        MODIFY SCREEN.
       endif.
      ENDIF.
    ENDLOOP.

Rewards if helpful

Regards

Gagan