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

Dynamic selection options on selection screen.

Former Member
0 Likes
551

Hello Gurus,

I am using following blocks in my selection screen. I want only block one to be displayed first. After user hits with data in parameters of block 1, then block 2 should appear but till then remain invisible. How can I achieve this ?

SELECTION-SCREEN BEGIN OF BLOCK BSD1 WITH FRAME Title text-001.
SELECTION-SCREEN SKIP.
PARAMETERS: l_RECNO LIKE ZAP01-RECNO,
            L_OCRTP TYPE ZAPYPE DEFAULT 'Z.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK BSD1.

SELECTION-SCREEN BEGIN OF BLOCK BSD2 WITH FRAME Title text-002.
SELECTION-SCREEN SKIP.
PARAMETERS: bukrs type bukrs,
                        vednum like lfa1-lifnr.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK BSD2.

Regards,

Jainam.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
498

Check the below code, i am confirming that everything is working good.

*&---------------------------------------------------------------------*
*& Report  YSAT_TEST3
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  YSAT_TEST3.


selection-screen skip 2.
selection-screen: begin of block blk1 with frame title  text-001.
parameters: male1(20).
selection-screen: end of block blk1.

selection-screen: begin of block blk2 with frame title  text-002.
parameters: female1(20) modif id sc2.
selection-screen: end of block blk2.


at selection-screen output.
loop at screen.
  if male1 = ''.
  if screen-group1 = 'SC1'.
   screen-invisible = '0'.
   screen-input = '1'.
   modify screen.
  endif.
  if screen-group1 = 'SC2'.
   screen-invisible = '1'.
   screen-input = '0'.
   modify screen.
  endif.

else.
  if screen-group1 = 'SC1'.
   screen-invisible = '1'.
   screen-input = '0'.
   modify screen.
  endif.
  if screen-group1 = 'SC2'.
   screen-invisible = '0'.
   screen-input = '1'.
   modify screen.
  endif.
endif.
endloop.

Regards,

~Satya

3 REPLIES 3
Read only

naimesh_patel
Active Contributor
0 Likes
498

Check the online help on the LOOP AT SCREEN.

Regards,

Naimesh Patel

Read only

former_member156446
Active Contributor
0 Likes
498

Check this :

REPORT  zj_test LINE-SIZE 162.

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

PARAMETERS: l_recno TYPE vbak-vbeln MODIF ID one,  "<< changed here... replace with our data
            l_ocrtp TYPE c DEFAULT 'Z' MODIF ID one. "<< changed here... replace with our data

SELECTION-SCREEN END OF BLOCK bsd1.

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

PARAMETERS: bukrs TYPE bukrs MODIF ID two,
            vednum LIKE lfa1-lifnr MODIF ID two.

SELECTION-SCREEN END OF BLOCK bsd2.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF l_recno IS INITIAL.
      IF screen-group1 = 'TWO'.
        screen-input = 0.
        screen-active = 0.
      ENDIF.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

Read only

Former Member
0 Likes
499

Check the below code, i am confirming that everything is working good.

*&---------------------------------------------------------------------*
*& Report  YSAT_TEST3
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  YSAT_TEST3.


selection-screen skip 2.
selection-screen: begin of block blk1 with frame title  text-001.
parameters: male1(20).
selection-screen: end of block blk1.

selection-screen: begin of block blk2 with frame title  text-002.
parameters: female1(20) modif id sc2.
selection-screen: end of block blk2.


at selection-screen output.
loop at screen.
  if male1 = ''.
  if screen-group1 = 'SC1'.
   screen-invisible = '0'.
   screen-input = '1'.
   modify screen.
  endif.
  if screen-group1 = 'SC2'.
   screen-invisible = '1'.
   screen-input = '0'.
   modify screen.
  endif.

else.
  if screen-group1 = 'SC1'.
   screen-invisible = '1'.
   screen-input = '0'.
   modify screen.
  endif.
  if screen-group1 = 'SC2'.
   screen-invisible = '0'.
   screen-input = '1'.
   modify screen.
  endif.
endif.
endloop.

Regards,

~Satya