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: 

selection-screen block disappearing

Former Member
0 Kudos

Hi All ,

Can any one tell me how can i make a block in the selection screen invisible . rt now i am using the below code for selection screen ,

SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.

PARAMETERS: P_SALE RADIOBUTTON GROUP GRP DEFAULT 'X',

P_BILL RADIOBUTTON GROUP GRP .

SELECTION-SCREEN END OF BLOCK BLK1.

SELECTION-SCREEN BEGIN OF BLOCK BLK2 WITH FRAME TITLE TEXT-002.

  • PARAMETERS MODIF ID SAL.

SELECT-OPTIONS: S_vkorg for TVKO-VKORG obligatory MODIF ID SAL,

S_VTWEG for TVTW-VTWEG obligatory MODIF ID SAL,

S_SPART for TSPA-SPART obligatory MODIF ID SAL.

SELECTION-SCREEN END OF BLOCK BLK2.

SELECTION-SCREEN BEGIN OF BLOCK BLK3 WITH FRAME TITLE TEXT-003.

SELECT-OPTIONS: S_vkorg1 for TVKO-VKORG obligatory MODIF ID BIL,

S_VTWEG1 for TVTW-VTWEG obligatory MODIF ID BIL,

S_SPART1 for TSPA-SPART obligatory MODIF ID BIL,

S_FKDAT for VBRK-FKDAT obligatory MODIF ID BIL.

SELECTION-SCREEN END OF BLOCK BLK3.

my requirement is , when i select the RB P_SALE the BLK3 have to be invisible and when i select the RB P_BILL BLK2 have to be invisible .

Thanks & Regards ,

Sabu.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Try like this.....


TABLES : tvko , tvtw , tspa , vbrk.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.

PARAMETERS: p_sale RADIOBUTTON GROUP grp DEFAULT 'X' USER-COMMAND flag1, " dont forget to add user-command
p_bill RADIOBUTTON GROUP grp .

SELECTION-SCREEN END OF BLOCK blk1.

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

* PARAMETERS MODIF ID SAL.

SELECT-OPTIONS: s_vkorg FOR tvko-vkorg   MODIF ID sal,
s_vtweg FOR tvtw-vtweg   ID sal,
s_spart FOR tspa-spart   MODIF ID sal.
SELECTION-SCREEN END OF BLOCK blk2.

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

SELECT-OPTIONS: s_vkorg1 FOR tvko-vkorg   MODIF ID bil,
s_vtweg1 FOR tvtw-vtweg   MODIF ID bil,
s_spart1 FOR tspa-spart   MODIF ID bil,
s_fkdat FOR vbrk-fkdat   MODIF ID bil.
SELECTION-SCREEN END OF BLOCK blk3.

AT SELECTION-SCREEN OUTPUT.

  IF p_sale = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'BIL'.
        screen-active = '0'.
      ELSE.
        screen-active = 1.

      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ELSEIF p_bill = 'X'.
   BREAK-POINT.
    LOOP AT SCREEN.
      IF screen-group1 = 'SAL'.
        screen-active = '0'.
      ELSE.
        screen-active = 1.

      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
ENDIF.

Regards

Debarshi

7 REPLIES 7

Former Member
0 Kudos

HI ...

you need write this code in

AT Selection-screen output.

loop at screen.

you need to check the condition on which you want disable the block and fill the values in screen structure.

Modufy screen.

endloop.

Former Member
0 Kudos

at selection-screen output.

loop at screen.

if screen-name = 'blockname'.

screen-active = 0.

modify screen.

endif.

endloop.

Former Member
0 Kudos

Hi,

you have to do little modification to your selection scree.

yse the following logic which i have used.

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

*parameters : so_plant radiobutton group a USER-COMMAND fcod MODIF ID m1 DEFAULT 'X'.

*parameters : so_ven radiobutton group a MODIF ID m1 .

*parameters : so_cust radiobutton group a MODIF ID m1.

*selection-screen end of block blk11.

*at selection-screen OUTPUT .

  • PERFORM chng_screen.

*

*

*AT SELECTION-SCREEN.

  • LOOP AT SCREEN.

  • IF screen-group1 = 'M2'.

  • IF screen-input NE '1'.

*

  • v_flag = 'X'.

  • ELSE.

  • clear v_flag.

  • ENDIF.

  • ENDIF.

  • endloop.

*

*form chng_screen.

*LOOP AT SCREEN.

  • if so_plant = 'X'.

  • IF screen-group1 = 'M3'.

    • screen-input = space.

  • screen-active = 0.

  • modify screen.

  • ELSEIF screen-group1 = 'M2'.

    • screen-input = 1.

  • screen-active = 1.

  • modify screen.

  • ELSEIF screen-group1 = 'M4'.

    • screen-input = 1.

  • screen-active = 0.

  • modify screen.

  • ENDIF.

  • ELSEIF SO_VEN = 'X'.

  • IF screen-group1 = 'M2'.

  • screen-input = space.

  • screen-active = 0.

  • modify screen.

  • elseif screen-group1 = 'M3'.

    • screen-input = 1.

  • screen-active = 1.

  • modify screen.

  • ELSEIF screen-group1 = 'M4'.

    • screen-input = 1.

  • screen-active = 0.

  • modify screen.

  • ENDIF.

  • ELSEIF SO_CUST = 'X'.

  • IF screen-group1 = 'M2'.

    • screen-input = space.

  • screen-active = 0.

  • modify screen.

  • ELSEIF screen-group1 = 'M3'.

    • screen-input = 1.

  • screen-active = 0.

  • modify screen.

  • ELSEIF screen-group1 = 'M4'.

    • screen-input = 1.

  • screen-active = 1.

  • modify screen.

  • ENDIF.

*

  • ENDIF.

*ENDLOOP.

*

*endform.

Former Member
0 Kudos

Hi,

Try like this.....


TABLES : tvko , tvtw , tspa , vbrk.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.

PARAMETERS: p_sale RADIOBUTTON GROUP grp DEFAULT 'X' USER-COMMAND flag1, " dont forget to add user-command
p_bill RADIOBUTTON GROUP grp .

SELECTION-SCREEN END OF BLOCK blk1.

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

* PARAMETERS MODIF ID SAL.

SELECT-OPTIONS: s_vkorg FOR tvko-vkorg   MODIF ID sal,
s_vtweg FOR tvtw-vtweg   ID sal,
s_spart FOR tspa-spart   MODIF ID sal.
SELECTION-SCREEN END OF BLOCK blk2.

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

SELECT-OPTIONS: s_vkorg1 FOR tvko-vkorg   MODIF ID bil,
s_vtweg1 FOR tvtw-vtweg   MODIF ID bil,
s_spart1 FOR tspa-spart   MODIF ID bil,
s_fkdat FOR vbrk-fkdat   MODIF ID bil.
SELECTION-SCREEN END OF BLOCK blk3.

AT SELECTION-SCREEN OUTPUT.

  IF p_sale = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'BIL'.
        screen-active = '0'.
      ELSE.
        screen-active = 1.

      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ELSEIF p_bill = 'X'.
   BREAK-POINT.
    LOOP AT SCREEN.
      IF screen-group1 = 'SAL'.
        screen-active = '0'.
      ELSE.
        screen-active = 1.

      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
ENDIF.

Regards

Debarshi

0 Kudos

Thank you so much..

issue is resolved..

Sabu

former_member207020
Active Contributor
0 Kudos

hi Sabu

Check this code , hope it helps you.

SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
PARAMETERS: p_sale RADIOBUTTON GROUP grp USER-COMMAND ud DEFAULT 'X',
             p_bill RADIOBUTTON GROUP grp .
SELECTION-SCREEN END OF BLOCK blk1.

SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
* parameters modif id sal.
SELECT-OPTIONS: s_vkorg FOR tvko-vkorg  MODIF ID sal,
s_vtweg FOR tvtw-vtweg  MODIF ID sal,
s_spart FOR tspa-spart  MODIF ID sal.
SELECTION-SCREEN END OF BLOCK blk2.

SELECTION-SCREEN BEGIN OF BLOCK blk3 WITH FRAME TITLE text-003.
SELECT-OPTIONS: s_vkorg1 FOR tvko-vkorg  MODIF ID bil,
s_vtweg1 FOR tvtw-vtweg  MODIF ID bil,
s_spart1 FOR tspa-spart  MODIF ID bil,
s_fkdat FOR vbrk-fkdat  MODIF ID bil.
SELECTION-SCREEN END OF BLOCK blk3.

AT SELECTION-SCREEN OUTPUT.
  IF p_sale = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'BIL'.
        screen-active = 0.
        MODIFY SCREEN.
      ELSE.
        screen-active = 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSEIF p_bill = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'SAL'.
        screen-active = 0.
        MODIFY SCREEN.
      ELSE.
        screen-active = 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

Thank & Regards

Former Member
0 Kudos

As you have put select options as mandatory, you need to enter the values for those fields and then change the radiobutton from p_sale to p_bill. Else the hidden fields cannot be recovered.

definition of USE-COMMAND is mandatory at the radiobutton, else the selection-screen output event won't be triggered when the radiobutton is changed from P_SALE to P_BILL.

Code:-

TABLES: tvko,

tvtw,

tspa,

vbrk.

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

PARAMETERS: p_sale RADIOBUTTON GROUP grp Default 'X' USER-COMMAND abc ,

p_bill RADIOBUTTON GROUP grp.

SELECTION-SCREEN END OF BLOCK blk1.

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

*PARAMETERS MODIF ID SAL.

SELECT-OPTIONS: s_vkorg FOR tvko-vkorg OBLIGATORY MODIF ID sal,

s_vtweg FOR tvtw-vtweg OBLIGATORY MODIF ID sal,

s_spart FOR tspa-spart OBLIGATORY MODIF ID sal.

SELECTION-SCREEN END OF BLOCK blk2.

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

SELECT-OPTIONS: s_vkorg1 FOR tvko-vkorg OBLIGATORY MODIF ID bil,

s_vtweg1 FOR tvtw-vtweg OBLIGATORY MODIF ID bil,

s_spart1 FOR tspa-spart OBLIGATORY MODIF ID bil,

s_fkdat FOR vbrk-fkdat OBLIGATORY MODIF ID bil.

SELECTION-SCREEN END OF BLOCK blk3.

INITIALIZATION.

AT SELECTION-SCREEN OUTPUT.

IF NOT p_sale IS INITIAL.

PERFORM hide_block3.

ENDIF.

&----


*& Form HIDE_BLOCK3

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form HIDE_BLOCK3 .

LOOP AT SCREEN.

IF screen-group1 CS 'BIL'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

endform.