Skip to Content

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

Problem on "at selection-screen output." command

Hi ,

in my programe a part of code is :-

selection-screen : begin of block b0 with frame title text-000.

selection-screen: skip 1.

parameters: s_box1 radiobutton group g1 user-command u1 default 'X',

s_box2 radiobutton group g1.

selection-screen : end of block b0 .

....

......

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

select-options : s_vend for bseg-lifnr modif id m1 .

selection-screen : end of block b2 .

selection-screen : begin of block b3 with frame title text-003.

select-options : s_budat for bkpf-budat modif id m2 .

selection-screen : end of block b3 .

at selection-screen output.

if s_box1 = 'X'.

loop at screen.

if screen-group1 = 'M2'.

screen-active = '0'.

modify screen.

elseif screen-group1 = 'M1' .

screen-active = '1'.

modify screen.

endif.

endloop.

elseif s_box2 = 'X'.

loop at screen.

if screen-group1 = 'M2' .

screen-active = '1'.

modify screen.

elseif screen-group1 = 'M1'.

screen-active = '0'.

modify screen.

endif.

endloop.

endif.

while executing this one...

while clicking S_BOX2 from S_BOX1 , S_VEND is changing to S_BUDAT but if I click again S_BOX1 this program goes to infinite loop.

Please help me to correct this problem.

Thankx in adv.

Biswajit

N.B:- This is a test code. no coding convention is followed.

Former Member
replied

I just copied your code and Tested it is working fine with out any problem.

REPORT  zscreen_test_.
TABLES:bseg,bkpf.
SELECTION-SCREEN : BEGIN OF BLOCK b0 WITH FRAME TITLE text-000.
SELECTION-SCREEN: SKIP 1.
PARAMETERS: s_box1 RADIOBUTTON GROUP g1 USER-COMMAND u1 DEFAULT 'X',
s_box2 RADIOBUTTON GROUP g1.
SELECTION-SCREEN : END OF BLOCK b0 .

SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECT-OPTIONS : s_vend FOR bseg-lifnr MODIF ID m1 .

SELECTION-SCREEN : END OF BLOCK b2 .

SELECTION-SCREEN : BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
SELECT-OPTIONS : s_budat FOR bkpf-budat MODIF ID m2 .

SELECTION-SCREEN : END OF BLOCK b3 .

AT SELECTION-SCREEN OUTPUT.
  IF s_box1 = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'M2'.
        screen-active = '0'.
        MODIFY SCREEN.
      ELSEIF screen-group1 = 'M1' .
        screen-active = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSEIF s_box2 = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'M2' .
        screen-active = '1'.
        MODIFY SCREEN.
      ELSEIF screen-group1 = 'M1'.
        screen-active = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
"If you have any code next to this place that under appropriate 
"events.

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