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

Modify screen by loop at screen not working

Former Member
0 Likes
7,567

Hi all,


I created two radio buttons where one button click should disable a (inactive area where cannot input values) selection screen block. below is the code for radion buttons and the block.


*SELECTION-SCREEN BEGIN OF LINE .

*  SELECTION-SCREEN COMMENT 5(10)  text-006.

*  SELECTION-SCREEN POSITION 2.

*  PARAMETERS : rb_ff RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND rb_f.

*

*  SELECTION-SCREEN COMMENT 18(10) text-007.

*  SELECTION-SCREEN POSITION 16.

*  PARAMETERS : rb_fu RADIOBUTTON GROUP g1.

*SELECTION-SCREEN END OF LINE.



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

PARAMETERS :

   p_lgnum TYPE ltak-lgnum OBLIGATORY DEFAULT 'UN1' MODIF ID fu,

   p_bwlvs TYPE ltak-bwlvs OBLIGATORY DEFAULT '999' MODIF ID fu,

   p_werks TYPE ltap-werks OBLIGATORY DEFAULT 'UN01' MODIF ID fu,

   p_vltyp TYPE ltap-vltyp OBLIGATORY DEFAULT '998' MODIF ID fu,

   p_vlber TYPE ltap-vlber OBLIGATORY DEFAULT '001' MODIF ID fu,

   p_vlpla TYPE ltap-vlpla OBLIGATORY DEFAULT 'AUFNAHME' MODIF ID fu.

SELECTION-SCREEN END OF BLOCK b2.


Then I used this code to make the change. When I debug the program runs inside the " IF screen-group1 EQ 'FU' AND rb_fu = 'X'." condition but it is not provide expected results.

I used screen-invisible, input, output also but now worked.


*AT SELECTION-SCREEN ON RADIOBUTTON GROUP g1.

*

*

*    LOOP AT SCREEN.

*      IF screen-group1 EQ 'FU' AND rb_fu = 'X'.

*

*

*        screen-active = '0'.

*

*

*      ENDIF.

*MODIFY SCREEN.

*

*    ENDLOOP.


Can anyone tell me what's wrong in my code.

Thanks and Regards,


1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,112

Put the LOOP AT/MODIFY SCREEN in PBO (in AT SELECTION-SCREEN OUTPUT section)

You wrote your code is in PAI, so its effect vanished as soon as PBO is triggered (it set back SCREEN attributes to dynpro definition at start of PBO)

Regards,

Raymond

5 REPLIES 5
Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,113

Put the LOOP AT/MODIFY SCREEN in PBO (in AT SELECTION-SCREEN OUTPUT section)

You wrote your code is in PAI, so its effect vanished as soon as PBO is triggered (it set back SCREEN attributes to dynpro definition at start of PBO)

Regards,

Raymond

Read only

0 Likes
3,112

Thanks, It worked.

Read only

former_member199670
Participant
3,112

Hi ,

   Try using below code

AT SELECTION-SCREEN OUTPUT.

  IF rb_fu IS Not INITIAL.

    LOOP AT SCREEN.

      IF  screen-group1 = 'FU'.

        screen-input = 0.

        screen-invisible = 1.

        MODIFY SCREEN.

      ENDIF.

    ENDLOOP.

  ENDIF.

If you click second radio button the selection screen will not appear.

Thanks

Manimaran K

Read only

Former Member
3,112

Hi Chinthaka,

Try belwo code,it should work.


AT SELECTION-SCREEN OUTPUT.

IF rb_fu = 'X'
    LOOP AT SCREEN.

      IF screen-group1 EQ 'FU'.

          screen-active = '0'.

          screen-input = 0.

          MODIFY SCREEN.

    ENDLOOP.

     ENDIF.

ENDIF.

Cheers,

Pravin

Read only

Former Member
0 Likes
3,112

Hi,

I set always USER-COMMAND DUMMY in first radiobutton Parameter and it works.

Regards, Dieter