Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

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

Tags:
Former Member
Former Member replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question