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: 

reg. selection screens

Former Member
0 Kudos

hi,

i want to give 2 options to the user. when he chooses the first one i display a selection screen with 4 options. when he chooses the second, i want to display those 4 options plus 2 more.

i want to reuse my first selection screen as a part in second selection screen. how do i do that ?

thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi check this ..

call subscreens from the selection screen for this...

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba66935c111d1829f0000e829fbfe/frameset.htm

5 REPLIES 5

Former Member
0 Kudos

hi check this ..

call subscreens from the selection screen for this...

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba66935c111d1829f0000e829fbfe/frameset.htm

Former Member
0 Kudos

Hii!

Check out this sample code


REPORT z_sdn.

PARAMETERS:
  p_num RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND abc,
  p_char RADIOBUTTON GROUP rad1.

PARAMETERS:
  p_num1 TYPE i MODIF ID num,
  p_num2 TYPE i MODIF ID num,
  p_char1 TYPE c MODIF ID chr,
  p_char2 TYPE c MODIF ID chr.


AT SELECTION-SCREEN OUTPUT.
  IF p_num EQ 'X'.
    LOOP AT SCREEN.
      IF screen-group1 EQ 'CHR'.
        screen-active = 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-group1 EQ 'NUM'.
        screen-active = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

Regards

Abhijeet

0 Kudos

Thanks to all. I was just expecting simple statement such as

selection-screen include blocks b1.

where b1 is already defined in another selection screen definition..thks

Former Member
0 Kudos

Hi,

Try this code. Logic is same as the one you are expecting.

 *&---------------------------------------------------------------------*
*& Report  ZSELECTSCREEN1
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zselectscreen1.

TABLES: sflight.

DATA: iflight TYPE TABLE OF sflight WITH HEADER LINE.

PARAMETERS: showdate AS CHECKBOX USER-COMMAND flag.

SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME.
PARAMETERS: scarrid LIKE sflight-carrid,
            sconnid LIKE sflight-connid.
SELECTION-SCREEN END OF BLOCK b.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: sfldate LIKE sflight-fldate MODIF ID sg1.
SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF showdate <> 'X' AND screen-group1 = 'SG1'.
      screen-active = '0'.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.




START-OF-SELECTION.
  IF showdate = 'X'.
    SELECT * FROM sflight INTO TABLE iflight WHERE carrid = scarrid
                                             AND   connid = sconnid
                                             AND   fldate = sfldate.
    IF sy-subrc = 0.
      LOOP AT iflight.
        WRITE: / iflight-carrid , iflight-connid , iflight-fldate , iflight-price, iflight-currency, iflight-planetype.
      ENDLOOP.
    ELSE.
      WRITE 'error'.
    ENDIF.
  ELSE.
    SELECT * FROM sflight INTO TABLE iflight WHERE carrid = scarrid
                                             AND   connid = sconnid.
    IF sy-subrc = 0.
      LOOP AT iflight.
        WRITE: / iflight-carrid , iflight-connid , iflight-fldate , iflight-price, iflight-currency, iflight-planetype.
      ENDLOOP.
    ELSE.
      WRITE 'error'.
    ENDIF.

  ENDIF. 

Thanks,

Matt

Former Member
0 Kudos

HIII

use following code

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS p_rad1 TYPE c RADIOBUTTON GROUP gr  DEFAULT 'X' USER-COMMAND
usr .
SELECTION-SCREEN COMMENT 3(16) text-005.
SELECTION-SCREEN END OF LINE.


SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS p_rad2 TYPE c RADIOBUTTON GROUP gr.
SELECTION-SCREEN COMMENT 3(16) text-006.
SELECTION-SCREEN END OF LINE.


PARAMETERS:
  p_num1 TYPE i MODIF ID ABC,
  p_num2 TYPE i MODIF ID ABC,
  p_char1 TYPE c MODIF ID DEF,
  p_char2 TYPE c MODIF ID DEF.



AT SELECTION-SCREEN OUTPUT .

  IF p_rad2 IS INITIAL .
    LOOP AT SCREEN.
      IF screen-group1 = 'ABC'.
        screen-active = 0.
        MODIFY SCREEN.
      ENDIF.                           " IF screen-name CS 'p_docno'.
    ENDLOOP.                           " LOOP AT SCREEN.

  ELSE.
    LOOP AT SCREEN .
      IF screen-group1 = 'DEF'.
        screen-active = 1.
        screen-input = 1.
        MODIFY SCREEN.
      ENDIF.                           " IF screen-name CS 'p_docno'.
    ENDLOOP.                           " LOOP AT SCREEN .
  ENDIF.                               " IF p_rad2 IS INITIAL .

regards

twinkal